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

Re: [PATCH] IOMMU: make domctl handler tolerate NULL domain


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 19 Apr 2022 18:09:59 +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=gvGw7Hb4+0vYtzFeEsJZSnAYfW4hflet8Jt85t+40xM=; b=nW29xzVYHpi6L+d4o7LZIhQQ60jRgsEwaO5ghssE3UKHT1N6CvZx411ZkBWQn7NAVr/5MgNYtYMn0vVseUVoUXBfni9MnmtZlfn+pb7m8kz28jPzATNmUIPVd0fLD/vZ+VvlEtbbzJvaq9037ER2eU+PqFZXJAiQN4Vl+dITuOKXyrLA6TKA4zVmFt3oeLmjmUtpZw/WNpgzqeB70MY8LzpaxQkZeOmv/QcN8zzwwpC4/EB/+d7bGSewE4cjqryETmUqYubLuJ1hgFKR7D4SbO+Uuh4+qWwD8ZWdRDPyZWh5RXHy4+VpMAH7yRKPC1/FcdkFaM2AU/6B6FJlbsJ9VA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RnOedifyUeTDNLUuZuIQXr+YlNB16xgfsV9UHaccBxUsbSSKLA6xNQS1IeY+jzDr/ZVlgVIRn2GV6bGZP0DVEYtv/i5Lv6Sqzc4Dnfmr40J6H5s6u+htePRpvHXWY4oF73NaOHJfuLVExAVg0JceaKeRDpvvW7BELImIpXztiW4DaBZREI80Mkw8owV8t/7slWsO6vxQZdMkxrYm1jELDZugC3ueOToUDnLPJ5trQfgoWj/a4XvufTfiTEJSnG/HTtHVRPllqBM07ysX40LpO03GezvvyiF/hCz4o0IFo5eho/ETdJogh7t+q2oQbJWeRURMwvp25+7dlFEWpPDcTA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Paul Durrant <paul@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 19 Apr 2022 16:10:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.04.2022 17:39, Andrew Cooper wrote:
> On 19/04/2022 11:59, Jan Beulich wrote:
>> On 19.04.2022 12:49, Andrew Cooper wrote:
>>> On 19/04/2022 10:39, Jan Beulich wrote:
>>> Furthermore, under what circumstances is test_assign_device legitimate
>>> when passing DOMID_INVALID ?  This has been broken for 3 years now
>>> without report, so it's clearly an unused codepath under both xl's and
>>> xapi's idea of passthrough.
>> I guess xend had a way to drive the domctl this way.
> 
> Looking at the xend code, it always called with domid 0.
> 
> I can't see any evidence that there has actually been a caller passing
> DOMID_INVALID, but this is an utter mess.
> 
>>  Iirc this was
>> to find out whether a device is assignable at all, without needing
>> to know of any particular valid domain.
> 
> In a correctly architected IOMMU subsystem (which Xen most definitely
> does not have at this juncture), that question is "Does the device have
> an upstream IOMMU".
> 
> Xen doesn't currently have a working idea of an x86 system with IOMMUs
> but not covering all devices.  While such a system is unlikely to exist
> in reality, there are cases where quirks create asymmetric coverage. 
> Either way, this is fully subsumed by the future work to assign IOMMU
> groups.
> 
> Also at the moment, because Xen doesn't support per-device IOMMU
> contexts, another check not performed is whether this devices identity
> maps are compatible with the identity maps in the target domain.  Extra
> complexity here is that it will not occur on a single system
> (Conflicting RMRRs/IVHDs on a single system is definitely a firmware
> bug, not an accurate description of the system); only with migration
> between systems where equivalent logical devices have differing identity
> requirements on different systems.
> 
> 
> I don't see anything useful the "with a domid" version gets you.

Hence I guess someone thought allowing DOMID_INVALID there would be a
good idea, irrespective of whether xend actually did things this way.

Jan




 


Rackspace

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