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

Re: Design session PVH dom0


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 28 Sep 2022 11:38:11 +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=k3y/YFVAnQrNnOe4c3BcaM0Eb3FyoO40E7RDG6ER9dk=; b=mmm5QKH4BlU5+cXvMH4bnyAevxK8/M6TCrYnJjpiVWeOyoLqMHVQYwXail/mCw4tI7jV+U4lPBq++IT/XEPiT1MK05El6GSPtqT3dmQeKNAsLduttpYcirfx1YuaIRnp3TKYZhwwBg/AQKO98GJvtkp6K1wT5M0L9vTUzizXqtVuajii7SBfQsU+Yy6e2qFFhino5RPHGXBKQviXMUT0em2eUhhcgl1iOONtwNzyzz7oUiOGAKfKYhOghI6WAiO6+7Xku84bnpozoSPKqlsrVcPZAyN8CwjDyvnPcEiFWgT95c4vXjwfRnayH7Dukdc53wdJx1QNkytkcZMmOKKWcw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f/fBuDx7ceGZo5IY30qdAhrQpUM4tiT8sPrpYhNk2nzcgk9qke0pzZQil1wzVfFoiAoeIY+ZRmBljngvGgBQqTBeKf8Nc29hJyxuzUAYRiiDIBlkGOVGpaYLYZro63V5oKmTxaes9jij6d5k/k/OSfDUKSBwPj5TQlkh7r/xKUZE3BUeJ7pC634KMqskp9MWXQtKUViyVbAt1k6VXb8h41N5kOOx5oDFDynyI8TsAvPU1VtU9lEUhHrsS6Cv6Hi418BkKxEfywsnL41ScyHd1TVNl6vF/4TB2cF7cntE0CxVgRK83uTmOe68cE/GKWGznjCFEhn3heOWvmcqgpAvsw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 28 Sep 2022 09:38:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.09.2022 09:02, Juergen Gross wrote:
> On 26.09.22 17:52, Jan Beulich wrote:
>> On 26.09.2022 10:33, Juergen Gross wrote:
>>> On 26.09.22 09:53, Jan Beulich wrote:
>>>> On 23.09.2022 10:20, Juergen Gross wrote:
>>>>> My favorite solution would be some kind of buffer address qualifier for 
>>>>> each
>>>>> buffer (e.g. virtual, physical, SG-list, maybe nested SG-list). So the new
>>>>> hypercalls would not mean "physical buffer addresses", but "qualified 
>>>>> buffer
>>>>> addresses". By requiring a minimum of 4-byte alignment for each buffer 
>>>>> (can we
>>>>> do that, at least for the new hypercalls?) this would leave the 2 lowest 
>>>>> bits
>>>>> of a buffer address for the new qualifier. If by any means an unaligned 
>>>>> buffer
>>>>> is needed sometimes, it could still be achieved via a single-entry 
>>>>> SG-list.
>>>>
>>>> While this might be an option, I'm not sure I'd be really happy with such
>>>> re-use of the low address bits, nor with the implied further restriction
>>>> on buffer alignment (most struct-s we use are 4-byte aligned at least,
>>>> but I don't think it's all of them, plus we also have guest handles to
>>>> e.g. arrays of char).
>>>
>>> The unaligned cases could be handled dynamically via the single-entry
>>> SG-list.
>>
>> Can they? The first example you gave, the bitmap passed to collect the
>> output of XEN_DOMCTL_SHADOW_OP_{CLEAN,PEEK}, comes as a handle-of-uint8,
>> i.e. generally large but not necessarily aligned (even if in practice
>> the caller likely will pass a page aligned buffer of multiple pages in
>> size). If we introduced physical-address bases replacement sub-ops, I
>> think we would make the buffer described by an array of GFNs, not even
>> allowing sub-page alignment or size.
> 
> In case the buffer is crossing page boundaries, the SG-list would need to
> have more than one entry, of course (assuming the SG-list variant is chosen).

Of course, but that wasn't the point I was trying to get at. How would the
(generic, i.e. alignment unaware) copying logic know the low bits are not
a descriptor in this case? I'd rather not see us have e.g. both
copy_from_guest_pv() and copy_from_guest_pv_unaligned() (nor a 4th argument
to the former, to express the same).

Jan



 


Rackspace

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