diff --git a/pci/src/bus.rs b/pci/src/bus.rs index 2ec374e6b..bc0c446fc 100644 --- a/pci/src/bus.rs +++ b/pci/src/bus.rs @@ -125,7 +125,7 @@ impl PciConfigIo { return 0xffff_ffff; } - let (bus, device, _function, register) = + let (bus, device, function, register) = parse_config_address(self.config_address & !0x8000_0000); // Only support one bus. @@ -133,6 +133,11 @@ impl PciConfigIo { return 0xffff_ffff; } + // Don't support multi-function devices. + if function > 0 { + return 0xffff_ffff; + } + self.devices.get(device).map_or(0xffff_ffff, |d| { d.lock().unwrap().read_config_register(register) })