qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/3] Resolve vt82c686 and piix4 qemu_irq memory leaks


From: BALATON Zoltan
Subject: Re: [PATCH 0/3] Resolve vt82c686 and piix4 qemu_irq memory leaks
Date: Sun, 21 Jul 2024 12:22:56 +0200 (CEST)

On Sat, 20 Jul 2024, Michael S. Tsirkin wrote:
On Thu, Jul 04, 2024 at 10:58:51PM +0200, Bernhard Beschow wrote:
This series first turns vt82c686's "INTR" pin into a named GPIO for better
comprehensibility. It then continues fixing qemu_irq memory leaks in vt82c686
and piix4 by connecting out IRQs of the south bridges before they get realized.
This approach is already used in the pc machines after it had been discussed at
KVM forum `23.

Observe that out IRQs are callbacks such as an INTR IRQ handler in a CPU which a
south bridge wants to trigger. If, as an implementation detail, the south bridge
wants to pass this callback to a child device, such as the PIC, then this
callback must be known to the south bridge before it gets realized. Otherwise
board code had to wire the PIC device itself, breaking encapsulation. This means
that qdev_connect_gpio_out*() has to be called before realize() which this
series implements. Another way to look at it is that callbacks apparently are
resouces such as memory regions which are also populated before realize().

Please check if above paragraph makes sense.

Best regards,
Bernhard


Bernhard, do you intend to resolve Zoltan's comments on this
patchset?

You can take this alternative for now:

https://patchew.org/QEMU/cover.1719690591.git.balaton@eik.bme.hu/

I think solving it the right way would need to QDev-ify i8259 and make it use gpio out and get rid of the legacy init function but as that's an old piece of code used by multiple machines, it's not easily done so maybe not for few days before the freeze.

For now I think either embedding the IRQ in the state struct (or alternatively adding an unrealize or finalize or whatever is the right method to free it) is better than changing all users of this device.

Regards,
BALATON Zoltan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]