On Mon, Oct 11, 2021 at 12:31:17PM +0200, BALATON Zoltan wrote: > On Mon, 11 Oct 2021, Gerd Hoffmann wrote: > > On Tue, Oct 05, 2021 at 03:12:05PM +0200, BALATON Zoltan wrote: > > > This device is part of a superio/ISA bridge chip and IRQs from it are > > > routed to an ISA interrupt set by the Interrupt Line PCI config > > > register. Change uhci_update_irq() to allow this and use it from > > > vt82c686-uhci-pci. > > > > Hmm, shouldn't this logic be part of the superio bridge emulation? > > But how? The ISA bridge does not know about PCI and PCI does not know about > ISA. UHCI is a PCIDevice and would raise PCI interrupts. Where and how could > I convert that to ISA interrupts? (Oh and ISA in QEMU is not Qdev'ified and > I don't want to do that as it's too much work and too much to break that I > can't even test so if an alternative solution involves that then get > somebody do that first.) This patch puts the irq mapping in the vt82xx > specific vt82c686-uhci-pci.c which in the real chip also contains the ISA > bridge so in a way it's part of the superio bridge emulation in that this > uhci variant is part of that chip model.
I'd suggest to first switch over uhci to use pci_allocate_irq() + qemu_set_irq() (see ehci for example). With that in place it should be possible to have vt82c686-uhci-pci.c create a different IRQ setup without changes elsewhere in uhci and without adding extra callbacks. HTH, Gerd