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

Re: [PATCH 03/15] xen/arm: Always enable IOMMU


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <xin.wang2@xxxxxxx>
  • Date: Thu, 25 Apr 2024 09:02:07 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=XsgmqaFZXQKMwMS2Vv/ByvyZpviQmVP6xXgrWBRj1G4=; b=gNK8cZrErClZPNMHexzfFKTq8mjYaf9Jsg1JYxk5ekiVjYvN4oxUg35nsbztw3iP3FhObEloVNsQ7Pe3EHo6d6NmznboM0e4/WcUNClfqIqnpBiXB4BxoTd4gPMMa90z1WtTTU5zOgV3ar36ojReYj32Ow0Jbx2JBMimQozMgliH4UTUgxOo00DQT+eFnwsz/7J/zDrLYiAbzwFgyopCG4PDHUwj7ovjXbqRB7LoKJzsTnmQOLp8UnA3MMzRAZGEQTDoBJs2Lma8WNdT1hXdPKjcZ7iEVDKuF1MWjQTA44UAWleB2gmP96v7yBA9ECfKr8Bp3GgMHw9xEmk258iiMQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XdcClE37D9+/RPsLwTD7M7MKE4g7b2ELbZJIhEE2RnY9qPy0Yi8qRaXd0PvxFGDrrJzQ452+7pqOU/qgignYbIrmsY25iyikHHAsDbjo2Xtt9/3T30z6wQyGS1SesncIoPDeKVUhovYAX5XtaVh2IMVCn5nNC2gp7jfXX19f6RjqrfbGuzHMfaSjE2rAiX0CH0jCS9NvoA879axrq4nrrZh5SjGfCAk/VzSX+YrXhxt/ZDSxlYf59u6jgKjkWyFZqSrHRkx75FNTv7U5HviaiSq+bEMfe9BvyiwJzjqhlIs8/0YEmOFs8JVQyOvccGAl8BZVo5znwSm/trKtP1h5Ag==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 25 Apr 2024 01:02:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,

On 4/24/2024 9:03 PM, Julien Grall wrote:
Hi Henry,

On 24/04/2024 04:34, Henry Wang wrote:
From: Vikram Garhwal <fnu.vikram@xxxxxxxxxx>

For overlay with iommu functionality to work with running VMs, we need to enable
IOMMU by default for the domains.

Signed-off-by: Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
Signed-off-by: Henry Wang <xin.wang2@xxxxxxx>
---
  xen/arch/arm/dom0less-build.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index fb63ec6fd1..2d1fd1e214 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -894,7 +894,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 ( (IS_ENABLED(CONFIG_OVERLAY_DTB) ||

Similar to the first patch, building Xen with the DTB overlay doesn't mean the user will want to use it (think of distros that may want to provide a generic Xen).

Instead, we should introduce a new DT property "passthrough" that would indicate whether the IOMMU should be used.

To be futureproof, I would match the values used by xl.cfg (see docs/man/xl.cfg.5.pod.in).

That sounds good. I can introduce a new DT property as suggested. Thanks for the suggestion!

Kind regards,
Henry


+ dt_find_compatible_node(node, NULL, "multiboot,device-tree")) &&
               iommu_enabled )
              d_cfg.flags |= XEN_DOMCTL_CDF_iommu;

Cheers,





 


Rackspace

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