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

Re: [PATCH RFC 04/10] domain: update GADDR based runstate guest area


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 20 Dec 2022 10:59:57 +0100
  • 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=V7jZ9za7zMXof99zuDFjFhypdN1lRLElNh62eQ8L9+c=; b=L7RqUG2oHgOA+I2WCrqXYL6J1zy2c7iN2YIX+v5te39GndN/LfiU5yG8QIexZSLzfvlkj3akZHiQ4T+5FcdPtAS4EEXTSmcbN73tZH0IysLHc1UtdXuPoKhUTnY1EWqQ/uNmrQcGQqedcjStGLXYOLovYs7sT2E37xhWcGXvZwDO5hNLcCm7IQ6ZkIlrOUeZXxzfliO7m7MkXt1KXl9PWp2MXE+4HzFNCLOgFbB1sU+Rx7q2ye1sjoy7lnnWp7/GdJgNK57X1e8D/00zgeTbL7XpIbsmqJsPVH9DdzdvXpC0PY1xzQazm5ZerSB7Lbq9tU/4t/MgYs9AvM2V2FpgYg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kLxRZG3w+Em6AWfskBDcFF9VzfgQrYiPvJsf5lVkmWvqU24W5S8uFJuLEVjTwmJBYQE6CRBP+fYYxll3Lbgpu60Z+1tCjG9MYkrIzFtorIKtucIU4DmOecKkGLCD5Y6xHn7BVj+yjLa3NWLbaX+DKvgW0z2Hig4WNZLnoZ7Xcc6XAkbL+vtaoYderSa3zIuibUyKK3Tn/sz+6nBD7Wf/UTrNzOpihsrTbY+nOwBR1I23iOXt+K6EB+IM2TkVks5I74WPJ4ZXteWn17Ia2vGfynwa9W9AkFwaTU4IQE7xD6ysxAIzBIh9eo0Nj9NEkP+R5DjWpXqKXlAJ52sH6Qsisw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 20 Dec 2022 10:00:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.12.2022 09:48, Julien Grall wrote:
> Hi Jan,
> 
> On 20/12/2022 08:45, Jan Beulich wrote:
>> On 20.12.2022 09:40, Julien Grall wrote:
>>> On 19/12/2022 12:48, Jan Beulich wrote:
>>>> On 16.12.2022 13:26, Julien Grall wrote:
>>>>> On 19/10/2022 08:41, Jan Beulich wrote:
>>>>>> RFC: HVM guests (on x86) can change bitness and hence layout (and size!
>>>>>>         and alignment) of the runstate area. I don't think it is an 
>>>>>> option
>>>>>>         to require 32-bit code to pass a range such that even the 64-bit
>>>>>>         layout wouldn't cross a page boundary (and be suitably aligned). 
>>>>>> I
>>>>>>         also don't see any other good solution, so for now a crude 
>>>>>> approach
>>>>>>         with an extra boolean is used (using has_32bit_shinfo() isn't 
>>>>>> race
>>>>>>         free and could hence lead to overrunning the mapped space).
>>>>>
>>>>> I think the extra check for 32-bit code to pass the check for 64-bit
>>>>> layout would be better.
>>>>
>>>> I'm afraid I can't derive from your reply what it is you actually want.
>>>
>>> I think for 32-bit call, we also want to check the address provide will
>>> also pass the 64-bit check (i.e. if used as a 64-bit layout, the area
>>> would not cross a page boundary and be suitably aligned).
>>
>> But that's specifically what I say I don't think is an option. First and
>> foremost because of the implication on 32-bit callers: They're need to
>> use magic to get hold of the size of the 64-bit variant of the struct.
> 
> I understand that. But I am not aware of any other (simple) approach 
> where you could have race free code.

My reference to using has_32bit_shinfo() not being race free was to avoid
suggestions in that direction. There's no use of this function in the
patch here, nor in the one where the new boolean field is actually written
to. The solution as presented is, afaict, both simple and race free. It
merely isn't very nice.

Jan

> So between a non-race free code and exposing the restriction to the 
> guest, I would chose the latter.
> 
> Cheers,
> 




 


Rackspace

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