mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-02 11:35:46 +00:00
pci: Disable multiple functions
Every PCI device is exposed as a separate device, on a specific PCI slot, and we explicitely don't support to expose a device as a multi function device. For this reason, this patch makes sure the enumeration of the PCI bus will not find some multi function device. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
f86b9dd95e
commit
b6ae2ccda4
@ -125,7 +125,7 @@ impl PciConfigIo {
|
|||||||
return 0xffff_ffff;
|
return 0xffff_ffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
let (bus, device, _function, register) =
|
let (bus, device, function, register) =
|
||||||
parse_config_address(self.config_address & !0x8000_0000);
|
parse_config_address(self.config_address & !0x8000_0000);
|
||||||
|
|
||||||
// Only support one bus.
|
// Only support one bus.
|
||||||
@ -133,6 +133,11 @@ impl PciConfigIo {
|
|||||||
return 0xffff_ffff;
|
return 0xffff_ffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't support multi-function devices.
|
||||||
|
if function > 0 {
|
||||||
|
return 0xffff_ffff;
|
||||||
|
}
|
||||||
|
|
||||||
self.devices.get(device).map_or(0xffff_ffff, |d| {
|
self.devices.get(device).map_or(0xffff_ffff, |d| {
|
||||||
d.lock().unwrap().read_config_register(register)
|
d.lock().unwrap().read_config_register(register)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user