summaryrefslogtreecommitdiffstats
path: root/include/linux/timerqueue.h
diff options
context:
space:
mode:
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>2022-07-13 17:13:52 -0500
committerSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>2022-07-13 17:27:23 -0500
commitc4f2946dd84cdea57c23ef867d7a04ece81c1159 (patch)
tree368a9aa0161ec5c7aeb666b09db656c1c9377cd3 /include/linux/timerqueue.h
parent449472040fd2804b317ba101ee25931e311003ed (diff)
downloadcachepc-linux-c4f2946dd84cdea57c23ef867d7a04ece81c1159.tar.gz
cachepc-linux-c4f2946dd84cdea57c23ef867d7a04ece81c1159.zip
(cover) iommu/amd: Enforce IOMMU restrictions for SNP-enabled system
To support the new AMD Secure Nested Paging (SNP) feature, AMD IOMMU driver needs to be modified to comply with new restrictions enforced by the SNP feature. The SNP feature detection needs to happen early in the IOMMU driver initialization, and the feature must be supported across all IOMMUs. To simplify the detection process, this series introduces global variables for tracking IOMMU Extended Feature Registers (EFR and EFR2), which store common feature bits across all IOMMUs. These global variables are available as soon as the IVRS table is parsed, which happens at the beginning of the driver initialization. Therefore, they can be used for early detection of SNP feature. (See patch 2 - 5) Once the feature is detected, IOMMU driver needs to be informed when the feature system-wide. Therefor, the function amd_iommu_snp_enable() is introduced in patch 6, and will be called by SEV-SNP driver. When IOMMU driver initializing the device table entries (DTEs), care must be taken when setting up the DTE[TV] bit on SNP-enabled system. (See patch 7) Lastly, an SNP-enabled system requires IOMMU v1 page table to be configured with non-zero DTE[Mode] for DMA-capable devices. This affects a number of use cases such as IOMMU pass-through mode and AMD IOMMUv2 APIs for binding/ unbinding pasid cannot be supported with SNP. These are handled in patch 8 and 9. Testing: - Tested booting and verify dmesg. - Tested booting with iommu=pt - Tested changing the iommu domain to identity at runtime - Tested loading amd_iommu_v2 driver - Tested booting SEV/SNP-enabled guest - Tested when CONFIG_AMD_MEM_ENCRYPT is not set Chanages from v3: (https://www.spinics.net/lists/kernel/msg4409539.html) - Patch 1, 2, and 5 are new. - Patch 3: Modify to use global common EFR/EFR2 vaiable when tracking supported features. Best Regards, Suravee
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions