mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-05 21:15:45 +00:00
vfio: Disable the ROM expansion BAR
Until the codebase can properly expose the ROM BAR into the guest, it is better to disable it for now, returning always 0 when the register is being read. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
e18052120a
commit
2f802880c0
@ -706,6 +706,8 @@ const PCI_CONFIG_MEMORY_BAR_64BIT: u32 = 0x4;
|
|||||||
const PCI_CONFIG_REGISTER_SIZE: usize = 4;
|
const PCI_CONFIG_REGISTER_SIZE: usize = 4;
|
||||||
// Number of BARs for a PCI device
|
// Number of BARs for a PCI device
|
||||||
const BAR_NUMS: usize = 6;
|
const BAR_NUMS: usize = 6;
|
||||||
|
// PCI ROM expansion BAR register index
|
||||||
|
const PCI_ROM_EXP_BAR_INDEX: usize = 12;
|
||||||
|
|
||||||
impl PciDevice for VfioPciDevice {
|
impl PciDevice for VfioPciDevice {
|
||||||
fn allocate_bars(
|
fn allocate_bars(
|
||||||
@ -896,6 +898,12 @@ impl PciDevice for VfioPciDevice {
|
|||||||
return self.configuration.read_reg(reg_idx);
|
return self.configuration.read_reg(reg_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Since the ROM expansion BAR is not yet handled by the code, it is
|
||||||
|
// more proper to expose it to the guest as being disabled.
|
||||||
|
if reg_idx == PCI_ROM_EXP_BAR_INDEX {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// The config register read comes from the VFIO device itself.
|
// The config register read comes from the VFIO device itself.
|
||||||
self.vfio_pci_configuration
|
self.vfio_pci_configuration
|
||||||
.read_config_dword((reg_idx * 4) as u32)
|
.read_config_dword((reg_idx * 4) as u32)
|
||||||
|
Loading…
Reference in New Issue
Block a user