[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/5] xen/wait: Extend the description of how this logic actually works


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 18 Jul 2022 12:49:49 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hBWRsFZWoZy+aNo07PP8g1OPAChz3TVdvcqm3dh3xbk=; b=eTXPRAUmDBKYmyWV+JBDGeK89qJ1M/tDAhguPAqiE6idTZYjraGC6GiehEeM96qdaKy98FA6u8xsEnxbCAO8Q6Y+dGCoCzVV/E6gzNcGnjoxrYk2lQz41ywbQm3M2CLxbdhvlS7ymEJs+drQvxntbXLFY/5y3IH/uR+1kPaSYKrYm4Z9tWAkMHWrpg1hfjZnuT+RDB/Y93XoMWIpIOFNfNBWWXVuLGgSebfO6g15V1fLLtRqJw6VSxsMSrEWMdNg0RZDAJJ43sJzdJZ3pcOpl965yJrrD2MTRUahl5AgxrA3qZ+LNO8TtgguXlBDf3KAhUDg14uCQO842wzy96ry5A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A57o0BaYKU1zdflGsj7AoP9Qi5GlfOdjnW3N/RanhW3i52w00lcZqLN4db32mBHfQKanbUevVyYYvdtpp33+sArSezl2v+4QQGiSrQsd1pSHbYxria5yZI0Kcr5QfGbmZhTmZ7zrPit3hHdopTnnafGdLBK2ruDG4jGWt2SfHgqmE+H4RHBdz4S3Ci9z17pDnWD0w0z3kZ5IZe4hT3xMwYdZ1X0bdsov736xQaGPl5ZO943m6nCHHA1i92bJ1nm1rIzz4vKg+1Xf1mYOam32spL8iRmxsofWFp/6AO9OYJrKn9jT6wwhLln4UcfGl6rQ3ePQa2CQrEZYuR7eVW5sNw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 18 Jul 2022 10:49:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.