On 18.07.2022 12:11, Andrew Cooper wrote:
> On 18/07/2022 11:00, Jan Beulich wrote:
>> On 18.07.2022 09:18, Andrew Cooper wrote:
>>> @@ -199,9 +211,18 @@ void check_wakeup_from_wait(void)
>>>      }
>>>  
>>>      /*
>>> -     * Hand-rolled longjmp().  Returns to __prepare_to_wait(), and lands 
>>> on a
>>> -     * `rep movs` instruction.  All other GPRs are restored from the 
>>> stack, so
>>> -     * are available for use here.
>>> +     * Hand-rolled longjmp().
>>> +     *
>>> +     * check_wakeup_from_wait() is always called with a shallow stack,
>>> +     * immediately after the vCPU has been rescheduled.
>>> +     *
>>> +     * Adjust %rsp to be the correct depth for the (deeper) stack we want 
>>> to
>>> +     * restore, then prepare %rsi, %rdi and %rcx such that when we 
>>> intercept
>>> +     * the rep movs in __prepare_to_wait(), it copies from wqv->stack over 
>>> the
>>> +     * active stack.
>> I'm struggling with the use of "intercept" here, but I guess that's just
>> because I'm not a native speaker.
> 
> "intercept" is the same terminology used in the middle of
> __prepare_to_wait()'s block.
> 
> It's because we have a weird setup where this is (now) a noreturn
> function merging into the middle of a function which already executed once.
> 
> I'm happy to change it if it's unclear, but I can't think of a better
> description.

"... when we go back to ..."? (But I'm not meaning to insist on a
wording change.)

Jan

Reply via email to