WSL2-Linux-Kernel/drivers/iommu/amd
Suravee Suthikulpanit a44092e326 iommu/amd: Use IVHD EFR for early initialization of IOMMU features
IOMMU Extended Feature Register (EFR) is used to communicate
the supported features for each IOMMU to the IOMMU driver.
This is normally read from the PCI MMIO register offset 0x30,
and used by the iommu_feature() helper function.

However, there are certain scenarios where the information is needed
prior to PCI initialization, and the iommu_feature() function is used
prematurely w/o warning. This has caused incorrect initialization of IOMMU.
This is the case for the commit 6d39bdee23 ("iommu/amd: Enforce 4k
mapping for certain IOMMU data structures")

Since, the EFR is also available in the IVHD header, and is available to
the driver prior to PCI initialization. Therefore, default to using
the IVHD EFR instead.

Fixes: 6d39bdee23 ("iommu/amd: Enforce 4k mapping for certain IOMMU data structures")
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Robert Richter <rrichter@amd.com>
Link: https://lore.kernel.org/r/20210120135002.2682-1-suravee.suthikulpanit@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2021-01-28 11:57:08 +01:00
..
Kconfig iommu/amd: Use cmpxchg_double() when updating 128-bit IRTE 2020-09-04 11:53:18 +02:00
Makefile iommu/amd: Move Kconfig and Makefile bits down into amd directory 2020-07-29 14:15:36 +02:00
amd_iommu.h iommu/amd: Use IVHD EFR for early initialization of IOMMU features 2021-01-28 11:57:08 +01:00
amd_iommu_types.h iommu/amd: Use IVHD EFR for early initialization of IOMMU features 2021-01-28 11:57:08 +01:00
debugfs.c iommu/amd: Move AMD IOMMU driver into subdirectory 2020-06-10 17:46:42 +02:00
init.c iommu/amd: Use IVHD EFR for early initialization of IOMMU features 2021-01-28 11:57:08 +01:00
iommu.c iommu/amd: Stop irq_remapping_select() matching when remapping is disabled 2021-01-05 19:24:12 +00:00
iommu_v2.c drm, iommu: Change type of pasid to u32 2020-09-17 19:21:16 +02:00
quirks.c iommu/amd: Move AMD IOMMU driver into subdirectory 2020-06-10 17:46:42 +02:00