From: Anthony PERARD <anthony@xenproject.org>
To: "Chen, Jiqian" <Jiqian.Chen@amd.com>
Cc: "Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Paul Durrant <paul@xen.org>,
"Edgar E . Iglesias" <edgar.iglesias@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
"Huang, Ray" <Ray.Huang@amd.com>
Subject: Re: [QEMU PATCH v10] xen/passthrough: use gsi to map pirq when dom0 is PVH
Date: Thu, 12 Dec 2024 16:38:05 +0100 [thread overview]
Message-ID: <Z1sDXYATWad0Rbyf@l14> (raw)
In-Reply-To: <BL1PR12MB58491C9D1CCC1880C442AF73E73D2@BL1PR12MB5849.namprd12.prod.outlook.com>
On Tue, Dec 10, 2024 at 07:17:30AM +0000, Chen, Jiqian wrote:
> On 2024/11/19 00:05, Anthony PERARD wrote:
> > On Wed, Nov 06, 2024 at 02:14:18PM +0800, Jiqian Chen wrote:
> >> In PVH dom0, when passthrough a device to domU, QEMU code
> >> xen_pt_realize->xc_physdev_map_pirq wants to use gsi, but in current codes
> >> the gsi number is got from file /sys/bus/pci/devices/<sbdf>/irq, that is
> >> wrong, because irq is not equal with gsi, they are in different spaces, so
> >> pirq mapping fails.
> >>
> >> To solve above problem, use new interface of Xen, xc_pcidev_get_gsi to get
> >> gsi and use xc_physdev_map_pirq_gsi to map pirq when dom0 is PVH.
> >>
> >> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
> >> Signed-off-by: Huang Rui <ray.huang@amd.com>
> >> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
> >
> > Acked-by: Anthony PERARD <anthony@xenproject.org>
> >
> > But, this following change probably needs an ack from PCI maintaners,
> > CCed.
> As PCI maintainers didn't response for weeks,
> can I just move the definition of the macro back to xen_pt.c file ?
No, that's fine. I should be able to send a pull-request with this
change without too much trouble.
Cheers,
> >> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
> >> index eb26cac81098..07805aa8a5f3 100644
> >> --- a/include/hw/pci/pci.h
> >> +++ b/include/hw/pci/pci.h
> >> @@ -23,6 +23,10 @@ extern bool pci_available;
> >> #define PCI_SLOT_MAX 32
> >> #define PCI_FUNC_MAX 8
> >>
> >> +#define PCI_SBDF(seg, bus, dev, func) \
> >> + ((((uint32_t)(seg)) << 16) | \
> >> + (PCI_BUILD_BDF(bus, PCI_DEVFN(dev, func))))
> >> +
> >> /* Class, Vendor and Device IDs from Linux's pci_ids.h */
> >> #include "hw/pci/pci_ids.h"
--
Anthony PERARD
next prev parent reply other threads:[~2024-12-12 15:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 6:14 [QEMU PATCH v10] xen/passthrough: use gsi to map pirq when dom0 is PVH Jiqian Chen
2024-11-11 18:53 ` Stewart Hildebrand
2024-11-18 16:05 ` Anthony PERARD
2024-11-19 5:58 ` Chen, Jiqian
2024-11-29 9:11 ` Chen, Jiqian
2024-12-10 7:17 ` Chen, Jiqian
2024-12-12 15:38 ` Anthony PERARD [this message]
2024-12-13 2:56 ` Chen, Jiqian
2025-02-24 9:57 ` Chen, Jiqian
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=Z1sDXYATWad0Rbyf@l14 \
--to=anthony@xenproject.org \
--cc=Jiqian.Chen@amd.com \
--cc=Ray.Huang@amd.com \
--cc=Stewart.Hildebrand@amd.com \
--cc=edgar.iglesias@gmail.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=paul@xen.org \
--cc=qemu-devel@nongnu.org \
--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 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.