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

[PATCH v6 03/11] xen/arm: Allow device-passthrough even the IOMMU is off


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>
  • From: Penny Zheng <penny.zheng@xxxxxxx>
  • Date: Mon, 14 Feb 2022 03:19:48 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); 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=oRbPxrfxtUguB6iv9k6N/YrNB/mDdmcGGUpf5LaQEEM=; b=XSJMtEzIpVWbVItoH67FfefwmcRj3Jmd/2XecuMbxWfaJFmKkXzpz09/B9LPE/M7ye5BIKfKO1j0LNyg7boKeJ0ZeVibf2ITNpEuw4qDBzMGAzHTByV50mDUd95SsFkaGXVOGL99LPKeaXR8EjOCU0PAjClmUIEtzQf42SgDYDpmHnf59NSP5/xrjxpvUWNOvSk0nNb6XgPZmY5LMUgY/2NvlvzOegOnqFS+7QRR7X7c5i5pIzLkCy1zYNrK0XV3tcMAGNyErBt03K6xWnfalwpPB646uXqctnMpOM16o3Z027msAVQQeV6zFmYVU1Q3w4DZ6aydGwmgT9kWSrXJIg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qn7t9wL/8zslFhuNOCp+J8soot3UWDQ3Koi6/Ht1ctiI/tetglwQ9acSck/+wJK2D9ff6LEafTCWqcIsXPuCi/x59cJSuOqkMnOip3qbgVqICyIn/CFgQAL4GMZBXrJA5nSgu1kYdbj+QB3ieuLQKQNEq8p+f3ZHsiMRDoyiJuadeiweyOcUL1rVDjgTCcm3PS6VOkPN14JqvqjpAKjhZxubS0u4e1YeJC45mtjoVFCnGpraLWSquVERM5kIhDftNa7vUG5yRzvt39Ah2v87I8ovXdQs/YmfcSwejIKCK6pnvRdfTuWAEdog2u2oqY3/ctU6/ZTZmL8m5TeKM6lC4g==
  • Cc: <Bertrand.Marquis@xxxxxxx>, <Wei.Chen@xxxxxxx>
  • Delivery-date: Mon, 14 Feb 2022 03:21:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

From: Stefano Stabellini <sstabellini@xxxxxxxxxx>

At the moment, we are only supporting device-passthrough when Xen has
enabled the IOMMU. There are some use cases where it is not possible to
use the IOMMU (e.g. doesn't exist, hardware limitation, performance) yet
it would be OK to assign a device to trusted domain so long they are
direct-mapped or the device doesn't do DMA.

Note that when the IOMMU is disabled, it will be necessary to add
xen,force-assign-without-iommu for every device that needs to be assigned.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
Tested-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
v3 changes:
- new commit, split from the original "[PATCH v2 2/6] xen/arm: introduce
direct-map for domUs"
---
v4 changes:
- explain briefly in the commit message why we want to do device assignment
without IOMMU.
---
v5 changes:
- nothing changed
---
v6 changes
- commit message refinement
---
 xen/arch/arm/domain_build.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 6467e8ee32..c1e8c99f64 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -3047,7 +3047,8 @@ void __init create_domUs(void)
             panic("Missing property 'cpus' for domain %s\n",
                   dt_node_name(node));
 
-        if ( dt_find_compatible_node(node, NULL, "multiboot,device-tree") )
+        if ( dt_find_compatible_node(node, NULL, "multiboot,device-tree") &&
+             iommu_enabled )
             d_cfg.flags |= XEN_DOMCTL_CDF_iommu;
 
         if ( !dt_property_read_u32(node, "nr_spis", &d_cfg.arch.nr_spis) )
-- 
2.25.1




 


Rackspace

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