On 29/10/2023 00:56, BALATON Zoltan wrote:
This is going back to my otiginal proposal in
https://patchew.org/QEMU/cover.1677004414.git.bala...@eik.bme.hu/
implementing routing of interrupts from device functions and PCI
devices to ISA interrupts. On pegasos2 the firmware sets evertyhing to
share IRQ 9 so the current simpified version worked for taht but with
the amigaone machine its firmware makes use of this feature and
assigns different interrupts to functions and PCI devices so we need
to properly impelent this.
<quote>
Since any ISA interrupt can be controlled
by any interrupt source (different functions of the multifunction
device plus the 4 input pins from PCI devices) there are more than 4
possible sources so this can't be handled by just the 4 PCI interrupt
lines. We need to keep track of the state of each interrupt source to
be able to determine the level of the ISA interrupt and avoid one
device clearing it while other still has an interrupt.
</quote>
This here is the important bit, since what you're describing here is exactly how PCI
interrupts in QEMU work, and so is already handled by the existing PCI IRQ routing
code. It seems to me that what you're doing here is creating an incomplete
re-implementation of part of the PCI interrupt logic in isa_irq_state, which is a
strong hint that this is the wrong approach and that you should be making use of PCI
IRQ routing.
This fixes USB on amigaone and maybe other bugs not discovered yet.
Given that the AmigaOne machine is new, can you explain in a bit more detail what the
difference is between the Pegasos2 and AmigaOne machines, particularly with respect
to where the existing IRQ routing logic is getting this wrong?
ATB,
Mark.