Skip to content

Commit ccc62b8

Browse files
kishonvijayabrahamjoergroedel
authored andcommitted
iommu/amd: Fix "Guest Virtual APIC Table Root Pointer" configuration in IRTE
commit b9c6ff9 ("iommu/amd: Re-factor guest virtual APIC (de-)activation code") while refactoring guest virtual APIC activation/de-activation code, stored information for activate/de-activate in "struct amd_ir_data". It used 32-bit integer data type for storing the "Guest Virtual APIC Table Root Pointer" (ga_root_ptr), though the "ga_root_ptr" is actually a 40-bit field in IRTE (Interrupt Remapping Table Entry). This causes interrupts from PCIe devices to not reach the guest in the case of PCIe passthrough with SME (Secure Memory Encryption) enabled as _SME_ bit in the "ga_root_ptr" is lost before writing it to the IRTE. Fix it by using 64-bit data type for storing the "ga_root_ptr". While at that also change the data type of "ga_tag" to u32 in order to match the IOMMU spec. Fixes: b9c6ff9 ("iommu/amd: Re-factor guest virtual APIC (de-)activation code") Cc: [email protected] # v5.4+ Reported-by: Alejandro Jimenez <[email protected]> Reviewed-by: Suravee Suthikulpanit <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 8f880d1 commit ccc62b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iommu/amd/amd_iommu_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,8 +1001,8 @@ struct amd_ir_data {
10011001
*/
10021002
struct irq_cfg *cfg;
10031003
int ga_vector;
1004-
int ga_root_ptr;
1005-
int ga_tag;
1004+
u64 ga_root_ptr;
1005+
u32 ga_tag;
10061006
};
10071007

10081008
struct amd_irte_ops {

0 commit comments

Comments
 (0)