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.

>> +     * All other GPRs are available for use; they're either restored from
>> +     * wqv->stack or explicitly clobbered.
> You talking of "other GPRs" - there aren't any which are explicitly
> clobbered. It's only the previously named ones which are. Hence I'd like
> to ask that the respective parts of the sentence be dropped. Then
> Reviewed-by: Jan Beulich <[email protected]>

It becomes true in the next patch.  I'll try and shuffle things.

~Andrew

Reply via email to