From: "Michael S. Tsirkin" <mst@redhat.com>
To: Bernhard Beschow <shentey@gmail.com>
Cc: qemu-devel@nongnu.org, Chuck Zmudzinski <brchuckz@aol.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Stefano Stabellini <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org,
David Woodhouse <dwmw2@infradead.org>,
Eduardo Habkost <eduardo@habkost.net>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
Paul Durrant <paul@xen.org>,
Richard Henderson <richard.henderson@linaro.org>,
Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: [PATCH] hw/i386/pc_piix: Make piix_intx_routing_notifier_xen() more device independent
Date: Sun, 14 Jan 2024 07:25:40 -0500 [thread overview]
Message-ID: <20240114072529-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <B404ABCE-E6B5-4716-BA60-3CEE74B72701@gmail.com>
On Sun, Jan 14, 2024 at 12:21:59PM +0000, Bernhard Beschow wrote:
>
>
> Am 7. Januar 2024 23:16:23 UTC schrieb Bernhard Beschow <shentey@gmail.com>:
> >This is a follow-up on commit 89965db43cce "hw/isa/piix3: Avoid Xen-specific
> >variant of piix3_write_config()" which introduced
> >piix_intx_routing_notifier_xen(). This function is implemented in board code but
> >accesses the PCI configuration space of the PIIX ISA function to determine the
> >PCI interrupt routes. Avoid this by reusing pci_device_route_intx_to_irq() which
> >makes piix_intx_routing_notifier_xen() more device-agnostic.
> >
> >One remaining improvement would be making piix_intx_routing_notifier_xen()
> >agnostic towards the number of PCI interrupt routes and move it to xen-hvm.
> >This might be useful for possible Q35 Xen efforts but remains a future exercise
> >for now.
> >
> >Signed-off-by: Bernhard Beschow <shentey@gmail.com>
>
> Hi Michael,
>
> could you tag this, too? Or do we need another R-b?
>
> Best regards,
> Bernhard
tagged, too.
> >---
> > hw/i386/pc_piix.c | 9 +++------
> > 1 file changed, 3 insertions(+), 6 deletions(-)
> >
> >diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> >index 042c13cdbc..abfcfe4d2b 100644
> >--- a/hw/i386/pc_piix.c
> >+++ b/hw/i386/pc_piix.c
> >@@ -92,13 +92,10 @@ static void piix_intx_routing_notifier_xen(PCIDevice *dev)
> > {
> > int i;
> >
> >- /* Scan for updates to PCI link routes (0x60-0x63). */
> >+ /* Scan for updates to PCI link routes. */
> > for (i = 0; i < PIIX_NUM_PIRQS; i++) {
> >- uint8_t v = dev->config_read(dev, PIIX_PIRQCA + i, 1);
> >- if (v & 0x80) {
> >- v = 0;
> >- }
> >- v &= 0xf;
> >+ const PCIINTxRoute route = pci_device_route_intx_to_irq(dev, i);
> >+ const uint8_t v = route.mode == PCI_INTX_ENABLED ? route.irq : 0;
> > xen_set_pci_link_route(i, v);
> > }
> > }
next prev parent reply other threads:[~2024-01-14 12:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-07 23:16 [PATCH] hw/i386/pc_piix: Make piix_intx_routing_notifier_xen() more device independent Bernhard Beschow
2024-01-08 12:14 ` Philippe Mathieu-Daudé
2024-01-09 8:51 ` David Woodhouse
2024-01-09 22:29 ` Bernhard Beschow
2024-01-14 12:21 ` Bernhard Beschow
2024-01-14 12:25 ` Michael S. Tsirkin [this message]
2024-01-24 13:08 ` Philippe Mathieu-Daudé
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=20240114072529-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=anthony.perard@citrix.com \
--cc=brchuckz@aol.com \
--cc=dwmw2@infradead.org \
--cc=eduardo@habkost.net \
--cc=marcel.apfelbaum@gmail.com \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=shentey@gmail.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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).