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

[PATCH v5 03/11] xen/arm: avoid setting XEN_DOMCTL_CDF_iommu when IOMMU off


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>
  • From: Penny Zheng <penny.zheng@xxxxxxx>
  • Date: Thu, 27 Jan 2022 07:49:21 +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=Rl3pkQoUExfheoWKn2LL1MYHodWIJQAVAKmSODsmtEM=; b=PP7HDOL8M5HYSdUzE42w5OIGGhMB43wD/oODVYTMmpjSg3A2OjRVdJQehv7MzH5LizpN/UNXU/2+TmCa1GNDogkxSqp1D2Cd8z2y0hH2g3qqjNOG+0HsBnhekaKfMwuOHKEt4+A3FstBktPa7ztGYDJoXEx5Ps+s/M+O0k13uNNbI207LqBQ1jd5PE42umtVz/PWSmt2DKMgR/REFJq7dYMuI3/DL54gm+C3KQPsKD3mF7ySPgBjZdcaTTggTq1+grzrbZU8VDPs75eNTgmfADgHYcW8FC5dT3+wNJjQ6SWY+hC+KAeAvkVZ+vWt821IZUHBHVLi+MM8NreN39vn5w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FEAwo/xv1/topxQPlBp6JoeF2VhN/T61cESr/Ghdfq0YwbjX0bPkyFrqYB8iM56NEIQZShbc01WhlyeSgCFYb4OS/m+DCPqQdD/MSgdezQh2lQA+K/PHfURaULzgSDbaqBx2LlknAgwJDc92MUXPsqUZFRLcETRB9gCF9JZqWdfagSNL8r/wZVd+vzFXc8P3TB2blTmQB953Sxe02MyDVnxE/KS9Dfpt8A5xolUME/xdJDnWncSv+TLi+jzKJgz+AfNUUbOSg4czzE0olYjmZbT7V0IysMD+Ji9d2YBIOioo5+bGxxzLsRQ3F1h9mSkrufYUl6S6aOOzQRlD+YnOkA==
  • Cc: <Bertrand.Marquis@xxxxxxx>, <Wei.Chen@xxxxxxx>
  • Delivery-date: Thu, 27 Jan 2022 07:51:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

From: Stefano Stabellini <sstabellini@xxxxxxxxxx>

When IOMMU is absent or shall not be used (trusted domain, performance,
hardware limitation, ..., etc), in which cases this commit avoids setting
XEN_DOMCTL_CDF_iommu to make those user cases possible and prevent failure
later during device assignment.

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
---
 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®.