From: Akihiko Odaki <akihiko.odaki@daynix.com>
To: "Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Yanan Wang" <wangyanan55@huawei.com>,
"John Snow" <jsnow@redhat.com>,
"BALATON Zoltan" <balaton@eik.bme.hu>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Daniel Henrique Barboza" <danielhb413@gmail.com>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"Alexey Kardashevskiy" <aik@ozlabs.ru>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Peter Xu" <peterx@redhat.com>, "Fabiano Rosas" <farosas@suse.de>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [PATCH v2 04/15] hw/isa/vt82c686: Define a GPIO line between vt82c686 and i8259
Date: Sat, 29 Jun 2024 17:04:44 +0900 [thread overview]
Message-ID: <155767a3-58e8-4b64-be3d-c5f89db82606@daynix.com> (raw)
In-Reply-To: <9aaf73e3-3080-44c9-9e29-b0e4b4398c3d@daynix.com>
On 2024/06/29 16:38, Akihiko Odaki wrote:
> On 2024/06/28 16:27, Mark Cave-Ayland wrote:
>> On 27/06/2024 14:37, Akihiko Odaki wrote:
>>
>>> This fixes qemu_irq array leak.
>>>
>>> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
>>> ---
>>> hw/isa/vt82c686.c | 7 ++++---
>>> 1 file changed, 4 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
>>> index 8582ac0322eb..629d2d568137 100644
>>> --- a/hw/isa/vt82c686.c
>>> +++ b/hw/isa/vt82c686.c
>>> @@ -715,13 +715,14 @@ static void via_isa_realize(PCIDevice *d, Error
>>> **errp)
>>> ViaISAState *s = VIA_ISA(d);
>>> DeviceState *dev = DEVICE(d);
>>> PCIBus *pci_bus = pci_get_bus(d);
>>> - qemu_irq *isa_irq;
>>> + qemu_irq isa_irq;
>>> ISABus *isa_bus;
>>> int i;
>>> qdev_init_gpio_out(dev, &s->cpu_intr, 1);
>>> qdev_init_gpio_in_named(dev, via_isa_pirq, "pirq", PCI_NUM_PINS);
>>> - isa_irq = qemu_allocate_irqs(via_isa_request_i8259_irq, s, 1);
>>> + qdev_init_gpio_in_named(dev, via_isa_request_i8259_irq, "i8259",
>>> 1);
>>> + isa_irq = qdev_get_gpio_in_named(dev, "i8259", 0);
>>> isa_bus = isa_bus_new(dev, pci_address_space(d),
>>> pci_address_space_io(d),
>>> errp);
>>> @@ -729,7 +730,7 @@ static void via_isa_realize(PCIDevice *d, Error
>>> **errp)
>>> return;
>>> }
>>> - s->isa_irqs_in = i8259_init(isa_bus, *isa_irq);
>>> + s->isa_irqs_in = i8259_init(isa_bus, isa_irq);
>>> isa_bus_register_input_irqs(isa_bus, s->isa_irqs_in);
>>> i8254_pit_init(isa_bus, 0x40, 0, NULL);
>>> i8257_dma_init(OBJECT(d), isa_bus, 0);
>>
>> Have you confirmed that the machines using the VIA can still boot
>> correctly with this change? I have a vague memory that Phil tried
>> something like this, but due to legacy code poking around directly in
>> the ISA IRQ array after realize it caused some things to break.
>
> I tried to boot MorphOS on pegasos2 but it didn't boot even with QEMU
> 9.0.1. The command line I used is:
>
> qemu-system-ppc -M pegasos2 -rtc base=localtime -device
> ati-vga,guest_hwcursor=true,romfile= -cdrom morphos-3.18.iso -kernel
> boot.img -serial stdio
Apparently I failed to run it properly. I tried again now and it booted
with this change.
Regards,
Akihiko Odaki
>
> That said, I believe no such code remain now. The IRQ array is held in a
> variable local in this function and nobody else can refer to it.
next prev parent reply other threads:[~2024-06-29 8:05 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-27 13:37 [PATCH v2 00/15] Fix check-qtest-ppc64 sanitizer errors Akihiko Odaki
2024-06-27 13:37 ` [PATCH v2 01/15] cpu: Free cpu_ases Akihiko Odaki
2024-06-28 15:12 ` Peter Maydell
2024-06-27 13:37 ` [PATCH v2 02/15] hw/ide: Convert macio ide_irq into GPIO line Akihiko Odaki
2024-06-28 7:19 ` Mark Cave-Ayland
2024-06-27 13:37 ` [PATCH v2 03/15] hw/ide: Remove internal DMA qemu_irq Akihiko Odaki
2024-06-28 7:23 ` Mark Cave-Ayland
2024-06-27 13:37 ` [PATCH v2 04/15] hw/isa/vt82c686: Define a GPIO line between vt82c686 and i8259 Akihiko Odaki
2024-06-28 7:27 ` Mark Cave-Ayland
2024-06-29 7:38 ` Akihiko Odaki
2024-06-29 8:04 ` Akihiko Odaki [this message]
2024-06-29 13:08 ` BALATON Zoltan
2024-07-01 10:32 ` Akihiko Odaki
2024-06-27 13:37 ` [PATCH v2 05/15] spapr: Free stdout path Akihiko Odaki
2024-06-27 13:37 ` [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access Akihiko Odaki
2024-06-28 15:20 ` Peter Maydell
2024-06-29 3:16 ` David Gibson
2024-07-04 11:54 ` Nicholas Piggin
2024-07-04 12:15 ` Peter Maydell
2024-07-05 1:18 ` Nicholas Piggin
2024-07-05 1:41 ` David Gibson
2024-07-05 4:40 ` Nicholas Piggin
2024-07-05 5:12 ` David Gibson
2024-07-05 7:50 ` Nicholas Piggin
2024-07-06 9:07 ` Akihiko Odaki
2024-07-06 10:37 ` Peter Maydell
2024-07-06 23:46 ` David Gibson
2024-07-08 7:49 ` Nicholas Piggin
2024-07-08 15:59 ` Peter Maydell
2024-07-09 7:46 ` David Gibson
2024-07-09 7:41 ` David Gibson
2024-07-05 1:33 ` David Gibson
2024-06-27 13:37 ` [PATCH v2 07/15] hw/virtio: Free vqs after vhost_dev_cleanup() Akihiko Odaki
2024-06-27 13:37 ` [PATCH v2 08/15] migration: Free removed SaveStateEntry Akihiko Odaki
2024-08-02 12:47 ` (subset) " Fabiano Rosas
2024-06-27 13:37 ` [PATCH v2 09/15] memory: Do not create circular reference with subregion Akihiko Odaki
2024-07-02 17:44 ` Peter Xu
2024-07-06 11:59 ` Akihiko Odaki
2024-07-08 8:06 ` Philippe Mathieu-Daudé
2024-07-08 8:41 ` Akihiko Odaki
2024-07-08 16:40 ` Peter Xu
2024-07-11 8:38 ` Akihiko Odaki
2024-08-22 17:10 ` Peter Maydell
2024-08-22 21:01 ` Peter Xu
2024-08-23 6:17 ` Akihiko Odaki
2024-06-27 13:37 ` [PATCH v2 10/15] tests/qtest: Use qtest_add_data_func_full() Akihiko Odaki
2024-07-02 6:14 ` Thomas Huth
2024-06-27 13:37 ` [PATCH v2 11/15] tests/qtest: Free unused QMP response Akihiko Odaki
2024-06-27 13:37 ` [PATCH v2 12/15] tests/qtest: Free old machine variable name Akihiko Odaki
2024-06-28 15:21 ` Peter Maydell
2024-06-27 13:37 ` [PATCH v2 13/15] tests/qtest: Delete previous boot file Akihiko Odaki
2024-07-02 7:31 ` Thomas Huth
2024-07-04 11:41 ` Akihiko Odaki
2024-06-27 13:37 ` [PATCH v2 14/15] tests/qtest: Free paths Akihiko Odaki
2024-06-27 13:37 ` [PATCH v2 15/15] tests/qtest: Free GThread Akihiko Odaki
2024-06-28 15:24 ` Peter Maydell
2024-07-01 20:11 ` [PATCH v2 00/15] Fix check-qtest-ppc64 sanitizer errors Michael S. Tsirkin
2024-07-01 22:23 ` BALATON Zoltan
2024-07-02 6:23 ` Thomas Huth
2024-07-04 11:37 ` Nicholas Piggin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=155767a3-58e8-4b64-be3d-c5f89db82606@daynix.com \
--to=akihiko.odaki@daynix.com \
--cc=aik@ozlabs.ru \
--cc=alex.bennee@linaro.org \
--cc=balaton@eik.bme.hu \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=david@redhat.com \
--cc=eduardo@habkost.net \
--cc=farosas@suse.de \
--cc=harshpb@linux.ibm.com \
--cc=jiaxun.yang@flygoat.com \
--cc=jsnow@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mst@redhat.com \
--cc=npiggin@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.com \
--cc=wangyanan55@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).