[PATCH 2/2] ntdll: Report SegDs to be identical to SegSs in x86_64 exception handlers.

Alexandre Julliard julliard at winehq.org
Fri Mar 26 11:21:26 CDT 2021


"Zebediah Figura (she/her)" <zfigura at codeweavers.com> writes:

> On 3/26/21 6:19 AM, Alexandre Julliard wrote:
>> Zebediah Figura <z.figura12 at gmail.com> writes:
>> 
>>> @@ -1500,11 +1500,6 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex
>>>       context->SegFs  = FS_sig(sigcontext);
>>>       context->SegGs  = GS_sig(sigcontext);
>>>       context->EFlags = EFL_sig(sigcontext);
>>> -#ifdef DS_sig
>>> -    context->SegDs  = DS_sig(sigcontext);
>>> -#else
>>> -    __asm__("movw %%ds,%0" : "=m" (context->SegDs));
>>> -#endif
>>>   #ifdef ES_sig
>>>       context->SegEs  = ES_sig(sigcontext);
>>>   #else
>>> @@ -1515,6 +1510,9 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex
>>>   #else
>>>       __asm__("movw %%ss,%0" : "=m" (context->SegSs));
>>>   #endif
>>> +   /* Legends of Runeterra depends on having SegDs == SegSs in an exception
>>> +    * handler. */
>>> +    context->SegDs  = context->SegSs;
>> Is there a reason you are not fixing %es too while you are at it?
>> 
>
> The application doesn't care about %es, and I wanted to make the patch
> as uninvasive as possible. A proper fix could mean quite a lot of 
> changes (some riskier than others), and it isn't clear to me where a
> line can reasonably be drawn.

It would be interesting to have at least tests for the other
registers.

As far as the fix, I'm not sure we want to do it so early in the signal
handling, we may need the actual segment values when running 32-bit code
inside a 64-bit process.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list