mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vfio: Don't map guest memory for VFIO devices attached to vIOMMU
In case a VFIO devices is being attached behind a virtual IOMMU, we should not automatically map the entire guest memory for the specific device. A VFIO device attached to the virtual IOMMU will be driven with IOVAs, hence we should simply wait for the requests coming from the virtual IOMMU. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
63c30a6e79
commit
3acf9dfcf3
@@ -999,9 +999,13 @@ impl DeviceManager {
|
||||
// global device ID.
|
||||
let device_id = pci.next_device_id() << 3;
|
||||
|
||||
let vfio_device =
|
||||
VfioDevice::new(&device_cfg.path, device_fd.clone(), vm_info.memory.clone())
|
||||
.map_err(DeviceManagerError::VfioCreate)?;
|
||||
let vfio_device = VfioDevice::new(
|
||||
&device_cfg.path,
|
||||
device_fd.clone(),
|
||||
vm_info.memory.clone(),
|
||||
device_cfg.iommu,
|
||||
)
|
||||
.map_err(DeviceManagerError::VfioCreate)?;
|
||||
|
||||
if device_cfg.iommu {
|
||||
if let Some(iommu) = iommu_device {
|
||||
|
||||
Reference in New Issue
Block a user