I had to see what IBMVIO was, it looks like the IBM Virtual I/O Server. Although you actually fixed the bug, the other bug might be that IBMVIO is defined when it's "The VIOS is part of the PowerVM® Editions hardware feature"
Were you on an IBM power box?
https://www.ibm.com/docs/en/power8?topic=server-virtual-io-o...
I'm just curious, because the IFDEFs assume one-or-the-other as written. Is having both busses a valid configuration?
Thanks!
I feel like I missed a bit of context for what launched this whole adventure. The adventure itself was interesting, though!
So, yeah, that's quite the confluence of things... Do PowerPC folks usually run their VMs with VGA emulation for example?
EDIT: Actually never mind, I think that just having PCI bus support and VGA arbitration support compiled in may be sufficient, instead of actually having a VGA card (real or not)?
In any case, QEMU will give you a VGA device when run with default options, so it's not that rare for developers to run VMs with a VGA card.
This particular bug was found by one of our excellent test engineers, I'm not sure what specifically he was doing that led him to hit this bug, beyond testing stuff with KASAN enabled on a real machine using the IBM PowerVM hypervisor.
I guess maybe that would make un-registration less ergonomic (assuming you have to handle duplicate entries in the list). But the peril of the bug described here seems worse.
- It shows that declaring statics is unsafe.
- It shows that taking a reference to a static is inherently unsafe.
- It shows that it actually helps if we distinguish passing something as mutable or non-mutable, and keep said mutability exclusive.
I find this code VERY opaque to read in terms of what it is that we are actually passing.
I'm also confused why the creation of the structs wasn't and still isn't wrapped in an `ifdef`. Now if I only have a VIO device there is still a lingering `fail_iommu_pci_bus_notifier` in the code at top level. I'm not familiar enough with how this is compiled, but it looks like it's part of the public interface, and as such would not be able to be compiled away?