fix(x86): use IOMMU only when needed for passthrough

This commit is contained in:
Alex Zenla
2024-06-20 17:46:16 -07:00
parent 02b97cff6d
commit a71375e4ad
4 changed files with 9 additions and 5 deletions

View File

@ -434,9 +434,13 @@ impl X86PvPlatform {
#[async_trait::async_trait]
impl BootSetupPlatform for X86PvPlatform {
fn create_domain(&self) -> CreateDomain {
fn create_domain(&self, needs_passthrough: bool) -> CreateDomain {
CreateDomain {
flags: XEN_DOMCTL_CDF_IOMMU,
flags: if needs_passthrough {
XEN_DOMCTL_CDF_IOMMU
} else {
0
},
..Default::default()
}
}