Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Commit 59aba9d

Browse files
kishonvijayabrahamgregkh
authored andcommitted
iommu/amd: Fix "Guest Virtual APIC Table Root Pointer" configuration in IRTE
[ Upstream commit ccc62b827775915a9b82db42a29813d04f92df7a ] 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: stable@vger.kernel.org # v5.4+ Reported-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com> Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Signed-off-by: Kishon Vijay Abraham I <kvijayab@amd.com> Link: https://lore.kernel.org/r/20230405130317.9351-1-kvijayab@amd.com Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 8f30237 commit 59aba9d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/iommu/amd_iommu_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,8 +886,8 @@ struct amd_ir_data {
886886
*/
887887
struct irq_cfg *cfg;
888888
int ga_vector;
889-
int ga_root_ptr;
890-
int ga_tag;
889+
u64 ga_root_ptr;
890+
u32 ga_tag;
891891
};
892892

893893
struct amd_irte_ops {

0 commit comments

Comments
 (0)