diff options
author | Ashish Kalra <ashish.kalra@amd.com> | 2024-01-26 05:11:19 +0100 |
---|---|---|
committer | Borislav Petkov (AMD) <bp@alien8.de> | 2024-01-29 20:34:18 +0100 |
commit | f366a8dac1b8fef28a470d4e67b9843ebb8e2a1f (patch) | |
tree | aa462024ab41a438123bd2be9090c497ead9783c /include | |
parent | crypto: ccp: Handle legacy SEV commands when SNP is enabled (diff) | |
download | linux-f366a8dac1b8fef28a470d4e67b9843ebb8e2a1f.tar.xz linux-f366a8dac1b8fef28a470d4e67b9843ebb8e2a1f.zip |
iommu/amd: Clean up RMP entries for IOMMU pages during SNP shutdown
Add a new IOMMU API interface amd_iommu_snp_disable() to transition
IOMMU pages to Hypervisor state from Reclaim state after SNP_SHUTDOWN_EX
command. Invoke this API from the CCP driver after SNP_SHUTDOWN_EX
command.
Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20240126041126.1927228-20-michael.roth@amd.com
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/amd-iommu.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/amd-iommu.h b/include/linux/amd-iommu.h index 7365be00a795..2b90c48a6a87 100644 --- a/include/linux/amd-iommu.h +++ b/include/linux/amd-iommu.h @@ -85,4 +85,10 @@ int amd_iommu_pc_get_reg(struct amd_iommu *iommu, u8 bank, u8 cntr, u8 fxn, u64 *value); struct amd_iommu *get_amd_iommu(unsigned int idx); +#ifdef CONFIG_KVM_AMD_SEV +int amd_iommu_snp_disable(void); +#else +static inline int amd_iommu_snp_disable(void) { return 0; } +#endif + #endif /* _ASM_X86_AMD_IOMMU_H */ |