> >In case guests detect hardware via generated device tree / generated
> >ACPI tables / pci bus scan (i.e. arm virt + microvm + pc + q35) it IMHO
> >makes sense to keep current behavior.
> 
> I remember similar discussions with Phil during PIIX consolidation
> where the motivation was to make the code simpler by removing options.
> That is, if a piece of silicon contains multiple functions, the QEMU
> model should always instantiate all (available) functions rather than
> providing options for cherry-picking.
> 
> Especially in highly integrated devices (such as south bridges) there
> might be interconnections between functions that are hard to handle
> when some are optional. For example, the ACPI function in the VIA
> south bridges detect activity from all other functions. In both PIIX
> and VIA, the USB function can be (de)activated by software from the
> ISA function (not implemented yet).
> 
> The latter would allow the current behavior of the pc machine(s) to be
> implemented while avoiding the cherry picking problem: The BIOS could
> switch the USB function on or off depending on fw_cfg (please correct
> me if I'm wrong). I think this would't even need compat machinery. Of
> course, support would need to be added in SeaBIOS and -- I guess --
> Tianocore. I'd like to look into that but, as usual, no guarantees
> when this will arrive.

Well, our chipsets are quite old.  piix has uhci, q35 has uhci+ehci.
Modern usb is xhci, which also is more virtualization friendly hardware
design.  Also qemu usb configuration is much simpler in case there is
only one usb bus (xhci) instead of two (xhci + chipset) because you
don't have to explicitly assign usb devices to a specific usb bus if
there is only one.  So I don't like the idea to have the chipset usb bus
present by default.

We have a similar problem in the LPC bridges.  They likewise have bits
in the pci config space to enable/disable ISA devices such as floppy,
serial port, parallel port.  These bits are implemented, but read-only.
So it is possible to read them to figure whenever a given device is
present, but it is not possible to set them to enable/disable devices.
Before we switched the ACPI DSDT to be 100% generated we actually had
some AML functions reading those bits to figure whenever these ISA
devices are present or not.

I'd suggest to follow that design pattern for the config bits in the
south bridge ACPI function.

take care,
  Gerd


Reply via email to