>From 492ea48f537934e7b54de66c5018c349c0123c9a Mon Sep 17 00:00:00 2001 Message-Id: <492ea48f537934e7b54de66c5018c349c0123c9a.1756239431.git.ehem+xen@xxxxxxx> From: Elliott Mitchell Date: Wed, 22 Jul 2020 10:43:57 -0700 Subject: [PATCH] xen/arm: ACPI: Change default configuration Xen/ARM64 support for ACPI has been mostly implemented. The remaining issue is handling the IORT table for proper IOMMU support. This means systems booting with ACPI will not be protected from misbehaving or misprogrammed hardware. Pass-through of hardware will be unsafe. Systems without an IOMMU are already unsafe so there is no additional warning. For such systems defaulting ACPI enabled may allow easier setup, so change the default. Presently device-trees are honored before ACPI tables are. This seems the best default balance right now. Signed-off-by: Elliott Mitchell --- xen/arch/arm/Kconfig | 7 ++++++- xen/drivers/passthrough/arm/smmu-v3.c | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 5355534f3d..a420889eb9 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -100,13 +100,18 @@ endchoice source "arch/Kconfig" config ACPI - bool "ACPI (Advanced Configuration and Power Interface) Support (UNSUPPORTED)" if UNSUPPORTED + bool "ACPI (Advanced Configuration and Power Interface) Support (UNSUPPORTED)" depends on ARM_64 && ARM_EFI + default y help Advanced Configuration and Power Interface (ACPI) support for Xen is an alternative to device tree on ARM64. This requires UEFI. + Note this is presently EXPERIMENTAL. If a given device has both + device-tree and ACPI support, it is presently (September 2025) + recommended to boot using the device-tree. + config ARM_EFI bool "UEFI boot service support" depends on ARM_64 && !MPU diff --git a/xen/drivers/passthrough/arm/smmu-v3.c b/xen/drivers/passthrough/arm/smmu-v3.c index 5e9e3e048e..580da2e210 100644 --- a/xen/drivers/passthrough/arm/smmu-v3.c +++ b/xen/drivers/passthrough/arm/smmu-v3.c @@ -82,6 +82,7 @@ #include #include #include +#include #include #include #include @@ -2364,6 +2365,9 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu) return 0; } +static bool allow_ignore_iort = false; +boolean_param("allow_ignore_iort", allow_ignore_iort); + #ifdef CONFIG_ACPI static void acpi_smmu_get_options(u32 model, struct arm_smmu_device *smmu) { @@ -2386,6 +2390,23 @@ static int arm_smmu_device_acpi_probe(struct platform_device *pdev, struct device *dev = smmu->dev; struct acpi_iort_node *node; + if (!allow_ignore_iort) { + printk(XENLOG_ERR +"A SMMUv3 is present, but only ACPI support is present in firmware. At this\n" +"time Xen's ACPI support is incomplete. In particular Xen is unable to make\n" +"use of IORT tables and is thus unable to make use of IOMMU functionality.\n" +"Booting in this configuration disables protection against malicious or\n" +"malfunctioning hardware. This also compromises pass-through of hardware.\n" +"\n" +"If you accept the risks of booting without IOMMU support, you can add\n" +"\"allow_ignore_iort=true\" to Xen's command-line. You are also welcome to\n" +"sponsor implementing support for IORT tables.\n"); + + panic("SMMUv3 is present, but IORT support is incomplete\n"); + } + + printk(XENLOG_ERR "using incomplete IORT due to command-line param\n"); + node = *(struct acpi_iort_node **)dev_get_platdata(dev); /* Retrieve SMMUv3 specific data */ @@ -2402,6 +2423,10 @@ static int arm_smmu_device_acpi_probe(struct platform_device *pdev, static inline int arm_smmu_device_acpi_probe(struct platform_device *pdev, struct arm_smmu_device *smmu) { + if (allow_ignore_iort) + printk(XENLOG_INFO "allow_ignore_iort has been set, but ACPI " + "support is absent\n"); + return -ENODEV; } #endif -- 2.39.5