lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210915120046.62936-1-yaohongbo@linux.alibaba.com>
Date:   Wed, 15 Sep 2021 20:00:46 +0800
From:   Yao Hongbo <yaohongbo@...ux.alibaba.com>
To:     yaohongbo@...ux.alibaba.com
Cc:     zhangliguang@...ux.alibaba.com,
        alikernel-developer@...ux.alibaba.com, will@...nel.org,
        robin.murphy@....com, lorenzo.pieralisi@....com,
        guohanjun@...wei.com, sudeep.holla@....com,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: [PATCH] ACPI/IORT: Add 'smmu=off' command line option

Add a generic command line option to disable arm smmu drivers.
iommu.passthrough can only bypass the IOMMU for DMA, but
sometimes we need to ignore all available SMMUs.

This patch is only used for acpi on arm64.

Signed-off-by: Yao Hongbo <yaohongbo@...ux.alibaba.com>
---
 Documentation/admin-guide/kernel-parameters.txt |  4 ++++
 drivers/acpi/arm64/iort.c                       | 18 +++++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 91ba391f..6cffd91 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -5198,6 +5198,10 @@
 	smart2=		[HW]
 			Format: <io1>[,<io2>[,...,<io8>]]
 
+	smmu=           [ARM64]
+			Format: {off}
+			off: Disable arm smmu driver.
+
 	smsc-ircc2.nopnp	[HW] Don't use PNP to discover SMC devices
 	smsc-ircc2.ircc_cfg=	[HW] Device configuration I/O port
 	smsc-ircc2.ircc_sir=	[HW] SIR base I/O port
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index 3b23fb7..70f92e7 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -40,6 +40,22 @@ struct iort_fwnode {
 static LIST_HEAD(iort_fwnode_list);
 static DEFINE_SPINLOCK(iort_fwnode_lock);
 
+static bool acpi_smmu_disabled;
+
+static int __init acpi_smmu_parse(char *str)
+{
+	if (!str)
+		return -EINVAL;
+
+	if (!strncmp(str, "off", 3)) {
+		acpi_smmu_disabled = true;
+		pr_info("SMMU disabled\n");
+	}
+
+	return 0;
+}
+__setup("smmu=", acpi_smmu_parse);
+
 /**
  * iort_set_fwnode() - Create iort_fwnode and use it to register
  *		       iommu data in the iort_fwnode_list
@@ -1596,7 +1612,7 @@ static void __init iort_init_platform_devices(void)
 		iort_enable_acs(iort_node);
 
 		ops = iort_get_dev_cfg(iort_node);
-		if (ops) {
+		if (ops && !acpi_smmu_disabled) {
 			fwnode = acpi_alloc_fwnode_static();
 			if (!fwnode)
 				return;
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ