From: Anthony PERARD <anthony@xenproject.org>
To: Jiqian Chen <Jiqian.Chen@amd.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
Paul Durrant <paul@xen.org>,
"Edgar E . Iglesias" <edgar.iglesias@gmail.com>,
qemu-devel@nongnu.org, xen-devel@lists.xenproject.org,
Stewart Hildebrand <stewart.hildebrand@amd.com>,
Huang Rui <ray.huang@amd.com>
Subject: Re: [QEMU PATCH v10] xen/passthrough: use gsi to map pirq when dom0 is PVH
Date: Mon, 18 Nov 2024 17:05:18 +0100 [thread overview]
Message-ID: <Zztlvl0m-Oi2XGXq@l14> (raw)
In-Reply-To: <20241106061418.3655304-1-Jiqian.Chen@amd.com>
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.
> 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"
Thanks,
--
Anthony PERARD
next prev parent reply other threads:[~2024-11-18 16:06 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 [this message]
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
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=Zztlvl0m-Oi2XGXq@l14 \
--to=anthony@xenproject.org \
--cc=Jiqian.Chen@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=ray.huang@amd.com \
--cc=sstabellini@kernel.org \
--cc=stewart.hildebrand@amd.com \
--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.