[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Mon, 18 Jul 2022 10:11:16 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=zVxoY6IXl/6MojUYRI21I/D5pL0heFwimBj6noRG9w8=; b=B/g0H5YItiHtUCo67JvgP5tbVHJ9C3n7NyETuqKtAyaKOlHDssz3XEexAf1ZZRhlsJcHRwbgaiUGJmVTGHRedB+5GtyoKKdYvX7qKk+KqhuqUR8q9m+kU22E6qAJqP0S/sfF8vQjhYaFMTEW+QEXL9Jxf4LjFQJ7sIQUruKVTsXqBoWOIegmsg4S9hlsv7YdNXXIuC8hUUizDAAePwboj0mHr/UXoAeEHRVjk2TXjOa9AjDw992Fqz+p6ejA9UkoXd90WYo+JhZkPBMLmEhoc9lQHleBE8r0Pb5G09jUBZPP63SlOA38aC/8x6/kEYeX+3c8u8G2riZda5ml7XdXXQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DV2PQIBSES6vy8jqxx15oIFPilrvMytjy8VC1+tg8bY3ke3Zq3N4kA4Z4HuoRE56Au64avqc4bj2dzaFglBEIezRz6tHJrb6aYBVf+fXnGbI7dTVK+RtWf3TkGgNDs6YUMfMlBm617ithM00/7OS0HthJmk+HLJcJbvHHCG6Lft41m8kDknHtWCOXNyDBptiRKl/PqSl/irPODsvEGqGKP19kR8JqM4Ee2XHC6llsBQ8L8IdMvYOMb0uo5lY5JDvF/AqypyehvObfZo/sbKHhd7JO+qrtXECjeV3ow1u1tK48RXsjqK9IknqXN+cdXfqcfFuR4uloWTqEJ3i7rjquw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 18 Jul 2022 10:11:38 +0000
  • Ironport-data: A9a23:Jhlip6nh8InNcrw94TNMO9Lo5gyYJ0RdPkR7XQ2eYbSJt1+Wr1Gzt xJLCG/VPf+KMDfyfdx3Poq/9U0B7ZfQzIA2SQFtriEwRCMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BCpC48T8mk/ngqoPUUIbsIjp2SRJvVBAvgBdin/9RqoNziJ2yDhjlV ena+qUzA3f4nW8uWo4ow/jb8kk3462t4GlwUmEWPpingnePzxH5M7pHTU2BByOQapVZGOe8W 9HCwNmRlo8O105wYj8Nuu+TnnwiGtY+DyDX4pZlc/HKbix5jj4zys4G2M80Mi+7vdkrc+dZk 72hvbToIesg0zaldO41C3G0GAkmVUFKFSOuzdFSfqV/wmWfG0YAzcmCA2ltHNNEp/hrBl1u2 sNbOSEmYSulov6plefTpulE3qzPLeHNFaZG4zRM6G+cCvwrB5feX6/N+NlUmi8qgdxDFurfY MxfbidzaBPHYFtEPVJ/5JAWxb/0wCWgNWAH7gvK/8Lb4ECKpOB1+JHrPMDYZZqhQsJNk1zDj mnH4374ElcRM9n3JT+trSzw27WRw3+TtIQ6RaL/+e5a20aqnEsKLBEaclC+kMiglRvrMz5YA wlOksY0loAw/kG2Stj2XzWjvWWJ+BUbXrJ4DOkS+AyLjK3O7G6xFmUCCzJMdtEinMs3XiAxk E+EmcvzAj5iu6HTTmiSnop4thu3MCkRaGMHOykNSFJc58G5+d5pyBXSUtxkDai5yMXvHi39y CyLqy54gKgPickM1OOw+lWvby+Qm6UlhzUdvm3/Nl9JJCspDGJ5T+REMWTm0Ms=
  • Ironport-hdrordr: A9a23:lsRCI6+qs3By1CPc7Lhuk+F7db1zdoMgy1knxilNoENuH/Bwxv rFoB1E73TJYW4qKQodcdDpAtjifZtFnaQFrLX5To3SJjUO31HYYL2KjLGSiQEIfheTygcz79 YGT0ETMrzN5B1B/L7HCWqDYpkdKbu8gcaVbI7lph8DIz2CKZsQljuRYTzrcHGeMTM2YabRY6 Dsg/avyQDBRV0nKuCAQlUVVenKoNPG0Lj8ZwQdOhIh4A6SyRu19b/TCXGjr1YjegIK5Y1n3X nOkgT/6Knmmeq80AXg22ja6IkTsMf9y+FEGNeHhqEuW3XRY0eTFcdcso+5zXUISdKUmRIXeR 730lAd1vFImjHsl6eO0F3QMkfboW8TAjTZuCKlaDPY0LDErXQBeoR8bMtiA2XkAwBLhqAC7I tbm22erJZZFhXGgWD04MXJTQhjkg6urWMlivN7tQ0XbWIyUs4nkWUkxjIiLL4QWCbhrIw3Gu hnC8/RoP5QbFOBdnjc+m1i2salUHg/FgqPBhFqgL3f7xFG2HRii0cIzs0WmXkNsJo7Vplf/u zBdqBljqtHQMMaZb90QO0BXcy0AGrQRg+kChPbHX33UKUcf37doZ/+57s4oOmsZZwT1ZM33I /MVVtJ3FRCD34Gyff+qaGj3iq9MFlVBw6du/22z6IJyYHUVf7sLTCJTkwono+pv+gfa/erKc qOBA==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYmnakh8+7xfqMQ0Kng4mRuadHxa2D5W+AgAADEgA=
  • Thread-topic: [PATCH 2/5] xen/wait: Extend the description of how this logic actually works

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 <jbeulich@xxxxxxxx>

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

~Andrew

 


Rackspace

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