mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
pci: vfio: Preserve prefetchable BAR flag
If the BAR for the VFIO device is marked as prefetchable on the underlying device ensure that the BAR exposed through PciConfiguration is also marked as prefetchable. Fixes problem where NVIDIA devices are not usable with PCI VFIO passthrough. See related NVIDIA kernel driver bug: https://github.com/NVIDIA/open-gpu-kernel-modules/issues/344. Fixes: #4451 Signed-off-by: Steven Dake <sdake@lambdal.com> Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
62f1b6bc61
commit
868d1f6902
@@ -999,6 +999,12 @@ impl PciBarConfiguration {
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn set_prefetchable(mut self, prefetchable: PciBarPrefetchable) -> Self {
|
||||
self.prefetchable = prefetchable;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn idx(&self) -> usize {
|
||||
self.idx
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user