Skip to contentSkip to conversation

iommu/amd: Fix a stale comment about which legacy mode is user visible

PATCH Applied Sean Christopherson 4 participants 6 messages Mar 15, 2025 – May 11

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/amd: Fix a stale comment about which legacy mode is user visible

Update a stale comment about which of the legacy modes is visible to the user, i.e. can be forced via amd_iommu_intr=legacy.

Fixes b74aa02d7a30 ("iommu/amd: Fix legacy interrupt remapping for x2APIC-enabled system")
---
 drivers/iommu/amd/amd_iommu_types.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/iommu/amd/amd_iommu_types.h +6 -5
index 23caea22f8dc..f7877abd0091 100644
@@ -968,12 +968,13 @@ static inline int get_hpet_devid(int id)
 }
 
 enum amd_iommu_intr_mode_type {
+	/*
+	 * The legacy format mode is not visible to users to prevent the user
+	 * from crashing x2APIC systems, which for all intents and purposes
+	 * require 128-bit IRTEs.   The legacy format will be forced as needed
+	 * when hardware doesn't support 128-bit IRTEs.
+	 */
 	AMD_IOMMU_GUEST_IR_LEGACY,
-
-	/* This mode is not visible to users. It is used when
-	 * we cannot fully enable vAPIC and fallback to only support
-	 * legacy interrupt remapping via 128-bit IRTE.
-	 */
 	AMD_IOMMU_GUEST_IR_LEGACY_GA,
 	AMD_IOMMU_GUEST_IR_VAPIC,
 };

base-commit: ea9bd29a9c0d757b3384ae3e633e6bbaddf00725

Signature · 1 line
2.49.0.rc1.451.g8f38331e32-goog
#1 lore raw
Quoted 33 lines · Sean Christopherson

Update a stale comment about which of the legacy modes is visible to the user, i.e. can be forced via amd_iommu_intr=legacy.

Fixes b74aa02d7a30 ("iommu/amd: Fix legacy interrupt remapping for x2APIC-enabled system")
---
 drivers/iommu/amd/amd_iommu_types.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/iommu/amd/amd_iommu_types.h +6 -5
index 23caea22f8dc..f7877abd0091 100644
@@ -968,12 +968,13 @@ static inline int get_hpet_devid(int id)
 }
 
 enum amd_iommu_intr_mode_type {
+	/*
+	 * The legacy format mode is not visible to users to prevent the user
+	 * from crashing x2APIC systems, which for all intents and purposes
+	 * require 128-bit IRTEs.   The legacy format will be forced as needed
+	 * when hardware doesn't support 128-bit IRTEs.
+	 */
 	AMD_IOMMU_GUEST_IR_LEGACY,
-
-	/* This mode is not visible to users. It is used when
-	 * we cannot fully enable vAPIC and fallback to only support
-	 * legacy interrupt remapping via 128-bit IRTE.
-	 */
 	AMD_IOMMU_GUEST_IR_LEGACY_GA,
 	AMD_IOMMU_GUEST_IR_VAPIC,
 };
Quoted 2 lines

base-commit: ea9bd29a9c0d757b3384ae3e633e6bbaddf00725

High latency ping! A year later, and this still applies cleanly :-)

Reviewed-by
#2 lore raw
Quoted 17 lines · Sean Christopherson
Quoted 16 lines · Sean Christopherson

Update a stale comment about which of the legacy modes is visible to the user, i.e. can be forced via amd_iommu_intr=legacy.

Fixes b74aa02d7a30 ("iommu/amd: Fix legacy interrupt remapping for x2APIC-enabled system")
---
  drivers/iommu/amd/amd_iommu_types.h | 11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)
drivers/iommu/amd/amd_iommu_types.h +0 -0
index 23caea22f8dc..f7877abd0091 100644
@@ -968,12 +968,13 @@ static inline int get_hpet_devid(int id)
  }
 
Quoted 5 lines

drivers/iommu/amd/amd_iommu_types.h static inline int get_hpet_devid(int id) · line 974

Quoted 5 lines
drivers/iommu/amd/amd_iommu_types.h +4 -0
  enum amd_iommu_intr_mode_type {
+	/*
+	 * The legacy format mode is not visible to users to prevent the user
+	 * from crashing x2APIC systems, which for all intents and purposes
+	 * require 128-bit IRTEs.   The legacy format will be forced as needed

Nit: Triple space before "The"

Quoted 12 lines
Quoted 12 lines
drivers/iommu/amd/amd_iommu_types.h +2 -5
+	 * when hardware doesn't support 128-bit IRTEs.
+	 */
  	AMD_IOMMU_GUEST_IR_LEGACY,
-
-	/* This mode is not visible to users. It is used when
-	 * we cannot fully enable vAPIC and fallback to only support
-	 * legacy interrupt remapping via 128-bit IRTE.
-	 */
  	AMD_IOMMU_GUEST_IR_LEGACY_GA,
  	AMD_IOMMU_GUEST_IR_VAPIC,
  };
Quoted 5 lines
Quoted 2 lines

base-commit: ea9bd29a9c0d757b3384ae3e633e6bbaddf00725

High latency ping! A year later, and this still applies cleanly :-)

The change looks good to me:

I think it's nicer to improve the kernel-parameters.txt as well:

Documentation/admin-guide/kernel-parameters.txt +3 -1
index 03a550630644..68f7cdb606aa 100644
@@ -459,7 +459,9 @@ Kernel parameters
        amd_iommu_intr= [HW,X86-64]
                        Specifies one of the following AMD IOMMU interrupt
                        remapping modes:
-                       legacy     - Use legacy interrupt remapping mode.
+                       legacy     - Use legacy (hypervisor-intercepted) interrupt
+                                    remapping mode. On modern systems, this safely
+                                    uses 128-bit IRTEs to support x2APIC.
                        vapic      - Use virtual APIC mode, which allows IOMMU
                                     to inject interrupts directly into guest.
                                     This mode requires kvm-amd.avic=1.
maintainer
#3 lore raw
In reply to Sean Christopherson

Vasant, could you please have a look? I'd prefer a review from you or Suravee before applying.

Thanks,

Joerg

Quoted 38 lines · Sean Christopherson
Quoted 33 lines · Sean Christopherson

Update a stale comment about which of the legacy modes is visible to the user, i.e. can be forced via amd_iommu_intr=legacy.

Fixes b74aa02d7a30 ("iommu/amd: Fix legacy interrupt remapping for x2APIC-enabled system")
---
 drivers/iommu/amd/amd_iommu_types.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/iommu/amd/amd_iommu_types.h +6 -5
index 23caea22f8dc..f7877abd0091 100644
@@ -968,12 +968,13 @@ static inline int get_hpet_devid(int id)
 }
 
 enum amd_iommu_intr_mode_type {
+	/*
+	 * The legacy format mode is not visible to users to prevent the user
+	 * from crashing x2APIC systems, which for all intents and purposes
+	 * require 128-bit IRTEs.   The legacy format will be forced as needed
+	 * when hardware doesn't support 128-bit IRTEs.
+	 */
 	AMD_IOMMU_GUEST_IR_LEGACY,
-
-	/* This mode is not visible to users. It is used when
-	 * we cannot fully enable vAPIC and fallback to only support
-	 * legacy interrupt remapping via 128-bit IRTE.
-	 */
 	AMD_IOMMU_GUEST_IR_LEGACY_GA,
 	AMD_IOMMU_GUEST_IR_VAPIC,
 };
Quoted 2 lines

base-commit: ea9bd29a9c0d757b3384ae3e633e6bbaddf00725

High latency ping! A year later, and this still applies cleanly :-)

maintainer Applied
#5 lore raw
In reply to Sean Christopherson
Quoted 8 lines · Sean Christopherson

Update a stale comment about which of the legacy modes is visible to the user, i.e. can be forced via amd_iommu_intr=legacy.

Fixes b74aa02d7a30 ("iommu/amd: Fix legacy interrupt remapping for x2APIC-enabled system")
---
 drivers/iommu/amd/amd_iommu_types.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Applied, thanks.