Skip to contentSkip to conversation

iommu/amd: Fix legacy interrupt remapping for x2APIC-enabled system

PATCH In review Suravee Suthikulpanit 2 participants 3 messages Apr 22, 2020 – May 1, 2020 IOMMU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/amd: Fix legacy interrupt remapping for x2APIC-enabled system

Currently, system fails to boot because the legacy interrupt remapping mode does not enable 128-bit IRTE (GA), which is required for x2APIC support.

Fix by using AMD_IOMMU_GUEST_IR_LEGACY_GA mode when booting with kernel option amd_iommu_intr=legacy instead. The initialization logic will check GASup and automatically fallback to using AMD_IOMMU_GUEST_IR_LEGACY if GA mode is not supported.

Fixes 3928aa3f5775 ("iommu/amd: Detect and enable guest vAPIC support")
---
 drivers/iommu/amd_iommu_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/amd_iommu_init.c +1 -1
index 6be3853..2b9a67e 100644
@@ -2936,7 +2936,7 @@ static int __init parse_amd_iommu_intr(char *str)
 {
 	for (; *str; ++str) {
 		if (strncmp(str, "legacy", 6) == 0) {
-			amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY;
+			amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY_GA;
 			break;
 		}
 		if (strncmp(str, "vapic", 5) == 0) {
Signature · 1 line
1.8.3.1
#1 lore raw

Ping.

Thanks,
Suravee

Quoted 29 lines · Suravee Suthikulpanit

Currently, system fails to boot because the legacy interrupt remapping mode does not enable 128-bit IRTE (GA), which is required for x2APIC support.

Fix by using AMD_IOMMU_GUEST_IR_LEGACY_GA mode when booting with kernel option amd_iommu_intr=legacy instead. The initialization logic will check GASup and automatically fallback to using AMD_IOMMU_GUEST_IR_LEGACY if GA mode is not supported.

Fixes 3928aa3f5775 ("iommu/amd: Detect and enable guest vAPIC support")
---
  drivers/iommu/amd_iommu_init.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/amd_iommu_init.c +1 -1
index 6be3853..2b9a67e 100644
@@ -2936,7 +2936,7 @@ static int __init parse_amd_iommu_intr(char *str)
  {
  	for (; *str; ++str) {
  		if (strncmp(str, "legacy", 6) == 0) {
-			amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY;
+			amd_iommu_guest_ir = AMD_IOMMU_GUEST_IR_LEGACY_GA;
  			break;
  		}
  		if (strncmp(str, "vapic", 5) == 0) {
maintainer
#2 lore raw
In reply to Suravee Suthikulpanit
Quoted 9 lines · Suravee Suthikulpanit

Currently, system fails to boot because the legacy interrupt remapping mode does not enable 128-bit IRTE (GA), which is required for x2APIC support.

Fix by using AMD_IOMMU_GUEST_IR_LEGACY_GA mode when booting with kernel option amd_iommu_intr=legacy instead. The initialization logic will check GASup and automatically fallback to using AMD_IOMMU_GUEST_IR_LEGACY if GA mode is not supported.

Quoted 5 lines
Fixes 3928aa3f5775 ("iommu/amd: Detect and enable guest vAPIC support")
---
 drivers/iommu/amd_iommu_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied for v5.7, thanks Suravee.