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

Re: [PATCH v1 2/2] xen/mmu: enable SMMU subsystem only in MMU


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>, Julien Grall <julien@xxxxxxx>
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Mon, 11 Nov 2024 18:10:22 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=OtD2GnUK0+mfyB1eRGsmdswnzuPIbcl55K42OhSdq8Y=; b=DyYxly6ibQCSfqCpUOox9JL5WN9+sgrZ3wJ1s9EzD4N6EIFOATnLbTYGDImm44Puw4sOxYB1T1ASovB5mXYSI3iqAaVwGBIpHv7iAjWZwaDYKHBTQakCkkZBW5X02gI+ZDjOOMlNbIlgw/MOcPXTlTsU628gM/uWTfxxaNZwtsD/kH78nGrZg81Pvt+uFqkdzRwntf6EVB6B4Oh9+Qs24n/VYNie0E24/5Cy1+0DL9K329XlSe0gWM0eQgI6a8k94MqYF0g1c7jc2w6+B8OmXBSnRAfn3YW/Zgr+LvMDsNzzAiFoa9p4+io4cPZTuMlSrX8kYn7rszwZs9HuWI9Olg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UUi6NVmjzZkkFJSSZ6Vm6rWuZCSllXkES6/2f5ywYrmMdbLz0jdZIIVeZU4U9GSP2U7R+SCzWuXsQDKU4HV4Cv4SntBvPCT43sul2R5ZQrxLKYStfDXHeZdjOHh0p5YGTA37BvnC76KLISW2zb9EnrJixYtw2WQOBL1LzewcnBtv1BH0RGL5zltPsxgMnbKTG2WBrmAzQ74fgDFwYwk3dS8aJAOv9cv3mKiDnlB8iSSYKxkrJrrO9qU/ewFYqYjFy2x4En81rumjNkVf+wNlqtCf7q2YFDIRn1h7Qbckycd/HuaXADEwf9bHnEBTseRzmwb4T1E9GjlTx7mSh8URqg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Rahul Singh <Rahul.Singh@xxxxxxx>
  • Delivery-date: Mon, 11 Nov 2024 18:10:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Luca/Julien,

On 11/11/2024 16:33, Luca Fancellu wrote:
Hi Ayan,


On 11 Nov 2024, at 16:00, Ayan Kumar Halder <ayankuma@xxxxxxx> wrote:


On 11/11/2024 13:45, Julien Grall wrote:
Hi Ayan,
Hi Julien,
On 11/11/2024 13:24, Ayan Kumar Halder wrote:
On 11/11/2024 11:12, Julien Grall wrote:
Hi,
Hi Julien,
On 08/11/2024 19:59, Ayan Kumar Halder wrote:
From: Penny Zheng <Penny.Zheng@xxxxxxx>

In Xen, SMMU subsystem is supported for MMU system only. The reason being SMMU
driver uses the same page tables as MMU.
Thus, we make it dependent on CONFIG_MMU.

Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
---
   xen/arch/arm/Kconfig            | 2 +-
   xen/drivers/passthrough/Kconfig | 3 ++-
   2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 15b2e4a227..3699e148e9 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -16,7 +16,7 @@ config ARM
       select HAS_DEVICE_TREE
       select HAS_PASSTHROUGH
       select HAS_UBSAN
-    select IOMMU_FORCE_PT_SHARE
+    select IOMMU_FORCE_PT_SHARE if MMU
Realistically, everything under drivers/passthrough is MMU specific. So does it 
actually make any sense to select HAS_PASSTHROUGH right now?
Actually we are able to assign devices to different DomUs (eg UART1 to domU1) 
as long as the device isn't behind an IOMMU. So in our case, the passthrough 
device tree has this node

          uart@9c0b0000 {
              compatible = "arm,pl011\0arm,primecell";
              reg = <0x00 0x9c0b0000 0x00 0x10000>;
              interrupt-parent = <0x01>;
              interrupts = <0x00 0x07 0x04>;
              clock-names = "uartclk\0apb_pclk";
              clocks = <0x06 0x07>;
              xen,path = "/uart@9c0b0000";
              xen,reg = <0x00 0x9c0b0000 0x00 0x10000 0x00 0x9c0b0000>;
              xen,force-assign-without-iommu;
So how devices will be protected on an MPU systems?

          };> So, should we still disable HAS_PASSTHROUGH for MPU ?
While it may work, a lot of code in drivers/passthrough is IOMMU specific (see 
all the function named iommu_*). So I find really odd that you disable 
IOMMU_FORCE_PT_SHARE but all the rest is still present...

I think we need some consistency. If you are planning to do device passthrough 
without any protection, then I don't think you need any code within 
drivers/passthrough/ (at least for platform devices).

Overall, for this patch, I think it would be better to simply select 
HAS_PASSTHROUGH when MMU is enabled. We can revisit device passthrough once we 
have the patches on the ML.
Yes, this makes sense. I will wait for Luca to confirm as well.
It makes sense to don’t compile all that stuff, anyway we are using some 
functions from drivers/passthrough/device_tree.c to pass the pl011 to the guests, we 
will try to handle them later in the series then.

Agreed.

Actually, MPU does not use much from drivers/passthrough. However, if you disable CONFIG_HAS_PASSTHROUGH for MPU, then we need to add a bunch of #if-def in the arm specific common code.

Please have a look at "xen/arm: Enclose all iommu related access within CONFIG_HAS_PASSTHROUGH" and let me know if you still prefer to disable it.

- Ayan




 


Rackspace

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