Hide Forgot
Description of problem: If a PCI device has no driver install on a Windows guest, it will not be part of resource re-balancing algorithm if triggered. If the device has some BARs , the firmware already assigned to them a resource range. This is not seen by Windows and on resource re-balancing the same range can be assigned to other PCI device. Version-Release number of selected component (if applicable): How reproducible: 100% Steps to Reproduce: #cat > t << EOF pci_update_mappings_del pci_update_mappings_add EOF #./x86_64-softmmu/qemu-system-x86_64 -snapshot -enable-kvm -snapshot \ -monitor unix:/tmp/m,server,nowait -device pci-bridge,chassis_nr=1 \ -boot menu=on -m 4G -trace events=t ws2012r2x64dc.img \ -device ivshmem,id=foo,size=2M,shm,bus=pci.1,addr=01 wait till OS boots, note BARs programmed for ivshmem in my case it was 01:01.0 0,0xfe800000+0x100 then execute script and watch pci_update_mappings* trace events # for i in $(seq 3 18); do printf -- "device_add e1000,bus=pci.1,addr=%x\n" $i | nc -U /tmp/m; sleep 5; done; Actual results: hotplugging e1000,bus=pci.1,addr=12 triggers rebalancing where Windows unmaps all BARs of nics on bridge but doesn't touch ivshmem and then programs new BARs, where: pci_update_mappings_add d=0x7fa02ff0cf90 01:11.0 0,0xfe800000+0x20000 creates overlapping BAR with ivshmem Expected results: no overlapping BARs or the ivshmem BAR should be disabled.
Work plan: QEMU
Work plan: - QEMU: implement PNP CMOS flag - SeaBIOS: If OS supports PNP -> enable BARs only for bootable devices.