]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Use IVHD EFR for early initialization of IOMMU features
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Wed, 20 Jan 2021 13:50:02 +0000 (07:50 -0600)
committerJoerg Roedel <jroedel@suse.de>
Thu, 28 Jan 2021 10:57:08 +0000 (11:57 +0100)
commit17fd2273c1437e2634b6253e1a3a205c64234316
tree8b62aeb66ef956553aeb4667d5777b4787a228e0
parentbb30d010fcc33a6e59b2b501e4ba1a6982895115
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 9faf6cf96f7e ("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: 9faf6cf96f7e ("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>
drivers/iommu/amd/amd_iommu.h
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/init.c