iommu/amd: Add amd_iommu=force_enable option
Subsystems (3)
Joerg Roedel
maintainerPATCH 1/1 iommu/amd: Add amd_iommu=force_enable option
From: Joerg Roedel <[email protected]>
Add this option to enable the IOMMU on platforms like AMD Stoney, where the kernel usually disables it because it may cause problems in some scenarios.
--- Documentation/admin-guide/kernel-parameters.txt | 3 +++ drivers/iommu/amd/init.c | 7 +++++++ 2 files changed, 10 insertions(+)
Documentation/admin-guide/kernel-parameters.txt +3 -0
@@ -303,6 +303,9 @@ allowed anymore to lift isolation requirements as needed. This option does not override iommu=pt + force_enable - Force enable the IOMMU on platforms known + to be buggy with IOMMU enabled. Use this + option with care. amd_iommu_dump= [HW,X86-64] Enable AMD IOMMU driver option to dump the ACPI table
drivers/iommu/amd/init.c +7 -0
@@ -155,6 +155,7 @@ static int amd_iommu_xt_mode = IRQ_REMAP_XAPIC_MODE;static bool amd_iommu_detected;static bool __initdata amd_iommu_disabled; +static bool __initdata amd_iommu_force_enable;static int amd_iommu_target_ivhd_type;u16 amd_iommu_last_bdf;/* largest PCI device id we have
@@ -2882,6 +2883,9 @@ static bool detect_ivrs(void)acpi_put_table (ivrs_base); +if (amd_iommu_force_enable) + goto out; +/* Don't use IOMMU if there is Stoney Ridge graphics */ for (i =0 ; i <32 ; i++) {u32 pci_id;
@@ -2893,6 +2897,7 @@ static bool detect_ivrs(void) } } +out:/* Make sure ACS will be enabled during PCI probe */ pci_request_acs ();
@@ -3148,6 +3153,8 @@ static int __init parse_amd_iommu_options(char *str)for (; *str; ++str) {if (strncmp (str,"fullflush" ,9 ) ==0 ) amd_iommu_unmap_flush = true; +if (strncmp (str,"force_enable" ,12 ) ==0 ) + amd_iommu_force_enable = true;if (strncmp (str,"off" ,3 ) ==0 ) amd_iommu_disabled = true;if (strncmp (str,"force_isolation" ,15 ) ==0 )
Signature · 1 line
2.31.1
[AMD Public Use]
Quoted 10 lines
-----Original Message-----
From: Joerg Roedel <[email protected]>
Sent: Thursday, April 22, 2021 9:07 AM
To: [email protected]
Cc: Joerg Roedel <[email protected]>; Will Deacon <[email protected]>; Deucher, Alexander <[email protected]>; [email protected]; [email protected]; linux- [email protected]; Joerg Roedel <[email protected]>
Subject: [PATCH] iommu/amd: Add amd_iommu=force_enable option
Quoted 7 lines
From: Joerg Roedel <[email protected]>
Add this option to enable the IOMMU on platforms like AMD Stoney, where the kernel usually disables it because it may cause problems in some scenarios.
Signed-off-by Joerg Roedel <[email protected]>
Quoted 67 lines
--- Documentation/admin-guide/kernel-parameters.txt | 3 +++ drivers/iommu/amd/init.c | 7 +++++++ 2 files changed, 10 insertions(+)Documentation/admin-guide/kernel-parameters.txt +0
-0@@ -303,6 +303,9 @@ allowed anymore to lift isolation requirements as needed. Thisoption
Documentation/admin-guide/kernel-parameters.txt +1
-0does not override iommu=pt + force_enable - Force enable the IOMMU onplatforms known
Documentation/admin-guide/kernel-parameters.txt +1
-0+ to be buggy with IOMMU enabled. Usethis
Documentation/admin-guide/kernel-parameters.txt +1
-0+ option with care. amd_iommu_dump= [HW,X86-64] Enable AMD IOMMU driver option to dump the ACPItable diff --git
a/drivers/iommu/amd/init.cb/drivers/iommu/amd/init.cindex321f5906e6ed..3e2295d3b3e2100644drivers/iommu/amd/init.c +1
-0@@ -155,6 +155,7 @@ static int amd_iommu_xt_mode =IRQ_REMAP_XAPIC_MODE ;static bool amd_iommu_detected;static bool __initdata amd_iommu_disabled; +static bool __initdata amd_iommu_force_enable;static int amd_iommu_target_ivhd_type;u16
amd_iommu_last_bdf; /* largest PCI device id we
havedrivers/iommu/amd/init.c +6
-0@@ -2882,6 +2883,9 @@ static bool detect_ivrs(void)acpi_put_table (ivrs_base); +if (amd_iommu_force_enable) + goto out; +/* Don't use IOMMU if there is Stoney Ridge graphics */ for (i =0 ; i <32 ; i++) {u32 pci_id;@@ -2893,6 +2897,7 @@ static bool detect_ivrs(void) } } +out:/* Make sure ACS will be enabled during PCI probe */ pci_request_acs ();@@ -3148,6 +3153,8 @@ static int __init parse_amd_iommu_options(char *str)for (; *str; ++str) {if (strncmp (str,"fullflush" ,9 ) ==0 ) amd_iommu_unmap_flush = true; +if (strncmp (str,"force_enable" ,12 ) ==0 ) + amd_iommu_force_enable = true;if (strncmp (str,"off" ,3 ) ==0 ) amd_iommu_disabled = true;if (
strncmp(str, "force_isolation", 15)== 0)
--
2.31.1