vmm: Force enable IOMMU incase of SEV-SNP guest

In case of SEV-SNP guest devices use sw-iotlb to gain access guest
memory for DMA. For that F_IOMMU/F_ACCESS_PLATFORM must be exposed in
the feature set of virtio devices.

Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Jinank Jain 2024-02-13 08:06:07 +05:30 committed by Rob Bradford
parent c9f94be7ab
commit 9f8aeacd3d

View File

@ -511,7 +511,9 @@ impl Vm {
let sev_snp_enabled = config.lock().unwrap().is_sev_snp_enabled(); let sev_snp_enabled = config.lock().unwrap().is_sev_snp_enabled();
#[cfg(feature = "tdx")] #[cfg(feature = "tdx")]
let force_iommu = tdx_enabled; let force_iommu = tdx_enabled;
#[cfg(not(feature = "tdx"))] #[cfg(feature = "sev_snp")]
let force_iommu = sev_snp_enabled;
#[cfg(not(any(feature = "tdx", feature = "sev_snp")))]
let force_iommu = false; let force_iommu = false;
#[cfg(feature = "guest_debug")] #[cfg(feature = "guest_debug")]