linux-stable/drivers/iommu
Kishon Vijay Abraham I dc299bd1d5 iommu/amd: Fix "Guest Virtual APIC Table Root Pointer" configuration in IRTE
commit ccc62b8277 upstream.

commit b9c6ff94e4 ("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: b9c6ff94e4 ("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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-11 23:00:18 +09:00
..
amd iommu/amd: Fix "Guest Virtual APIC Table Root Pointer" configuration in IRTE 2023-05-11 23:00:18 +09:00
arm iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity 2022-10-26 12:35:47 +02:00
intel iommu/vt-d: Allow zero SAGAW if second-stage not supported 2023-04-05 11:24:58 +02:00
apple-dart.c
dma-iommu.c
exynos-iommu.c
fsl_pamu.c iommu/fsl_pamu: Fix resource leak in fsl_pamu_probe() 2022-12-31 13:14:35 +01:00
fsl_pamu.h
fsl_pamu_domain.c
fsl_pamu_domain.h
hyperv-iommu.c
io-pgfault.c
io-pgtable-arm-v7s.c iommu/io-pgtable-arm-v7s: Add a quirk to allow pgtable PA up to 35bit 2022-08-25 11:40:41 +02:00
io-pgtable-arm.c
io-pgtable-arm.h
io-pgtable.c
ioasid.c
iommu-debugfs.c
iommu-sva-lib.c
iommu-sva-lib.h
iommu-sysfs.c
iommu-traces.c
iommu.c iommu: Fix error unwind in iommu_group_alloc() 2023-03-10 09:39:42 +01:00
iova.c iommu/iova: Fix alloc iova overflows issue 2023-01-18 11:48:52 +01:00
ipmmu-vmsa.c
irq_remapping.c
irq_remapping.h
Kconfig
Makefile
msm_iommu.c
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c
mtk_iommu.h
mtk_iommu_v1.c iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe() 2023-01-18 11:48:52 +01:00
of_iommu.c
omap-iommu-debug.c iommu/omap: Fix buffer overflow in debugfs 2022-10-26 12:35:25 +02:00
omap-iommu.c
omap-iommu.h
omap-iopgtable.h
rockchip-iommu.c iommu/rockchip: fix permission bits in page table entries v2 2022-12-31 13:14:33 +01:00
s390-iommu.c
sprd-iommu.c
sun50i-iommu.c iommu/sun50i: Remove IOMMU_DOMAIN_IDENTITY 2022-12-31 13:14:35 +01:00
tegra-gart.c
tegra-smmu.c
virtio-iommu.c