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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Tue, 19 Apr 2022 15:39:14 +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=PAwZASUasGY0RMM6nJT+C6GVW5YFgqKorJo3o8ipHOY=; b=TpaDcgqFFoOJAlzICG3vDsKDWi6L9driq07LtqN02A4xBV5WjkIYXH3EcjjTuj+yTjih1+oESb1nI50qrzOpJwTekmhJXT5ORgD9Oqz/5S1KyxRHmqAnwL1AZwEK135pAQZ3IILol0/Syb1oENkTz2nANSV8adUiFDjBaSvuTku4GQwr0YVvsZonwqLAROaWEXxhy/vFV4gdKAbVub+HO1GGHnlZhuc/Oqi34GY5tgb7iT16MDamXaB+LkaQnWVOYCEkbNhKGQX/Yos4GGHkBJO13n07ap9ozZH43xodhyq7vcTetzTvu62RLyNYW9MrsWo7P87YsdFCnLLQAUAGjA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QaxKK7QFRdY6QW/phFJwTUcQABfA8aTeicilQgZdoaOxRFxtm33DFzH78LRFfmRbTC7VgUak3Sd0Zdfn9escmq95CaPvgbdSz4oLVfGN2kotFT4m24W1txlDy10wbUfGgmZlvPtqfCv/P/NEdDYC0K9JmUc+ImT1nVSVLMUFbAmLDrccfPwuu3tSOonwqHBbKDaT348AHn5KzZZiVDdwXqsPwqLbvswxMSVQ8WLZOyDdRcidf9o8yj8Ugn1E9WBjfMclo4QezmH10VfPXwigdYBBmUUpakyfgH1enncPtTyyi+Mv6DaPXTZXa6Ytxjxk84+NqaXlcvuQ41o598JhnA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Paul Durrant <paul@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 19 Apr 2022 15:39:39 +0000
  • Ironport-data: A9a23:wk+DHKkfXWszyZYA/kxa5CHo5gz9J0RdPkR7XQ2eYbSJt1+Wr1Gzt xIdCGjSb/+CYzDxe48ia9iwoUIE75GHytJjHQo9+C08RiMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BCpC48T8kk/vgqoPUUIYoAAgoLeNfYHpn2EoLd9IR2NYy24DlWlLV4 7senuWEULOb828sWo4rw/rrRCNH5JwebxtB4zTSzdgS1LPvvyF94KA3fMldHFOhKmVgJcaoR v6r8V2M1jixEyHBqD+Suu2TnkUiGtY+NOUV45Zcc/DKbhNq/kTe3kunXRa1hIg+ZzihxrhMJ NtxWZOYajoCG7LRsdQnfkdISCZPL5RUx4T4CC3q2SCT5xWun3rE5dxLVRlzF6tHv+F9DCdJ6 OASLy0LYlabneWqzbmnS+5qwMM+MM3sO4BZsXZlpd3bJa9+HdafHOOVvZkBhGpYasNmRJ4yY +IwbzZ1YQuGSBpIIloNU7o1nfuyh2m5eDpdwL6QjfVuszSOnVUruFTrGPrJIezQQZ8EpUSJl ETc7UPwUh4FO8PKnFJp9Vrp3IcjhxjTWogfCbm5/f5Cm0CIyyoYDxh+fUOyvP2RmkO4HdVFJ CQ86ico6KQ/6kGvZt38RAGj5m6JuAYGXNhdGPF87xuCopc4+C6cD2kACzRHN9ovsZZuQSRwj wfU2dT0GTZorbuZD2qH8auZpi+zPi5TKnIeYSgDTk0O5NyLTJwPsy8jh+1LSMad5uAZ0xmqk 1hmcABWa20vsPM2
  • Ironport-hdrordr: A9a23:mhaBraEbz9cXi1FRpLqFsZLXdLJyesId70hD6qkvc3Fom52j/f xGws5x6fatskdrZJkh8erwW5Vp2RvnhNJICPoqTM2ftW7dySSVxeBZnMbfKljbdxEWmdQtsp uIH5IeNDS0NykDsS+Y2nj3Lz9D+qjgzEnAv463oBlQpENRGthdBmxCe2Sm+zhNNW177O0CZf +hD6R8xwaISDAyVICWF3MFV+/Mq5ngj5T9eyMLABYh9U2nkS6owKSSKWnZ4j4uFxd0hZsy+2 nMlAL0oo+5teug9xPa32jPq7xLhdrazMdZDsDksLlXFtyssHfrWG1SYczHgNkHmpDp1L/sqq iLn/4UBbU315oWRBDtnfKi4Xi57N9k0Q6e9bbRuwqenSW+fkN6NyMJv/MmTvOSgXBQw+1Uwe ZF2XmUuIFQCg6FlCPh58LQXxUvjUasp2E++NRjx0C3fLFuHoO5l7ZvtX+90a1wbh7S+cQiCq 1jHcvc7PFZfReTaG3YpHBmxJipUm4oFhmLT0AesojNugIm1kxR3g8d3ogSj30A/JUyR91N4P nFKL1hkPVLQtUNZaxwCe8dSY+8C3DLQxjLLGWOSG6XX50vKjbIsdr68b817OaldNgBy4Yzgo 3IVBdCuWs7ayvVeLqzNV1wg2TwqUmGLETQI5tllulEU5XHNcnWGDzGTkwymM29pPhaCtHHWp +ISedrP8M=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYU9FUwjuogeCS0EWgGeBVFIanqKz3DoiAgAACxwCAAE5MAA==
  • Thread-topic: [PATCH] IOMMU: make domctl handler tolerate NULL domain

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.

~Andrew

 


Rackspace

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