]> Git Repo - linux.git/commitdiff
iommu/amd: Fix "Guest Virtual APIC Table Root Pointer" configuration in IRTE
authorKishon Vijay Abraham I <[email protected]>
Wed, 5 Apr 2023 13:03:17 +0000 (13:03 +0000)
committerJoerg Roedel <[email protected]>
Thu, 13 Apr 2023 09:57:30 +0000 (11:57 +0200)
commit b9c6ff94e43a ("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: b9c6ff94e43a ("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]>
drivers/iommu/amd/amd_iommu_types.h

index 3d684190b4d537d15f5251277d5637aea65acd7f..f7cb1ce0f9bbcf203eafb552e49aee948abd226f 100644 (file)
@@ -1001,8 +1001,8 @@ struct amd_ir_data {
         */
        struct irq_cfg *cfg;
        int ga_vector;
-       int ga_root_ptr;
-       int ga_tag;
+       u64 ga_root_ptr;
+       u32 ga_tag;
 };
 
 struct amd_irte_ops {
This page took 0.05946 seconds and 4 git commands to generate.