From: Markus Armbruster <armbru@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: "Elena Ufimtseva" <elena.ufimtseva@oracle.com>,
"John G Johnson" <john.g.johnson@oracle.com>,
"Thomas Huth" <thuth@redhat.com>,
"Jagannathan Raman" <jag.raman@oracle.com>,
qemu-block@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
"John Snow" <jsnow@redhat.com>,
qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH] hw/ide: Fix crash when plugging a piix3-ide device into the x-remote machine
Date: Thu, 29 Apr 2021 08:08:21 +0200 [thread overview]
Message-ID: <87h7jpipwq.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <YImsxg/G2u659nkI@stefanha-x1.localdomain> (Stefan Hajnoczi's message of "Wed, 28 Apr 2021 19:43:18 +0100")
Stefan Hajnoczi <stefanha@redhat.com> writes:
> On Wed, Apr 28, 2021 at 04:18:17PM +0200, Markus Armbruster wrote:
>> Stefan Hajnoczi <stefanha@redhat.com> writes:
[...]
>> > The approach in this patch is okay but we should keep in mind it only
>> > solves piix3-ide. ISA provides a non-qdev backdoor API and there may be
>> > more instances of this type of bug.
>> >
>> > A qdev fix would address the root cause and make it possible to drop the
>> > backdoor API, but that's probably too much work for little benefit.
>>
>> What do you mean by backdoor API? Global @isabus?
>
> Yes. It's also strange that isa_get_irq(ISADevice *dev, unsigned isairq)
> accepts dev = NULL as a valid argument.
@isabus is static in hw/isa/isa-bus.c. Uses:
* Limit isa_bus_new() to one ISA bus. Arbitrary restriction; multiple
ISA buses could work with suitable memory mapping and IRQ wiring.
"Single ISA bus" assumptions could of course hide elsewhere in the
code.
* Implied argument to isa_get_irq(), isa_register_ioport(),
isa_register_portio_list(), isa_address_space(),
isa_address_space_io().
isa_get_irq() asserts that a non-null @dev is a child of @isabus.
This means we don't actually need @isabus, except when @dev is null.
I suspect two separate functions would be cleaner: one taking an
ISABus * argument, and a wrapper taking an ISADevice * argument.
isa_address_space() and isa_address_space_io() work the same, less the
assertion.
isa_register_ioport() and isa_register_portio_list() take a non-null
@dev argument. They don't actually need @isabus.
To eliminate global @isabus, we need to fix up the callers passing null
@dev. Clean solution: plumb the ISABus returned by isa_bus_new() to the
call sites. Where that's impractical, we can also get it from QOM, like
build_dsdt_microvm() does.
next prev parent reply other threads:[~2021-04-29 6:09 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-16 12:52 [PATCH] hw/ide: Fix crash when plugging a piix3-ide device into the x-remote machine Thomas Huth
2021-04-27 13:27 ` Philippe Mathieu-Daudé
2021-04-27 13:54 ` Stefan Hajnoczi
2021-04-27 17:16 ` John Snow
2021-04-27 17:54 ` Philippe Mathieu-Daudé
2021-04-27 18:02 ` John Snow
2021-04-28 9:22 ` Stefan Hajnoczi
2021-04-28 14:18 ` Markus Armbruster
2021-04-28 18:43 ` Stefan Hajnoczi
2021-04-29 6:08 ` Markus Armbruster [this message]
2021-05-03 17:53 ` Philippe Mathieu-Daudé
2021-04-28 9:15 ` Stefan Hajnoczi
2021-04-28 14:21 ` Markus Armbruster
2021-04-27 18:06 ` John Snow
2021-04-28 9:24 ` Stefan Hajnoczi
2021-04-28 9:32 ` Thomas Huth
2021-04-28 10:53 ` Philippe Mathieu-Daudé
2021-05-18 19:21 ` John Snow
2021-05-18 21:07 ` John Snow
2021-07-06 8:24 ` Thomas Huth
2021-07-06 8:37 ` Philippe Mathieu-Daudé
2021-07-07 9:30 ` Stefan Hajnoczi
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=87h7jpipwq.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=elena.ufimtseva@oracle.com \
--cc=jag.raman@oracle.com \
--cc=john.g.johnson@oracle.com \
--cc=jsnow@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.