From: Jiqian Chen <Jiqian.Chen@amd.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
Anthony Perard <anthony.perard@citrix.com>,
Paul Durrant <paul@xen.org>, <qemu-devel@nongnu.org>
Cc: <xen-devel@lists.xenproject.org>,
Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
Alex Deucher <Alexander.Deucher@amd.com>,
Huang Rui <Ray.Huang@amd.com>,
Honglei Huang <Honglei1.Huang@amd.com>,
Julia Zhang <Julia.Zhang@amd.com>,
Jiqian Chen <Jiqian.Chen@amd.com>, Huang Rui <ray.huang@amd.com>
Subject: [RFC QEMU PATCH v3 1/1] xen: Use gsi instead of irq for mapping pirq
Date: Mon, 11 Dec 2023 00:52:40 +0800 [thread overview]
Message-ID: <20231210165240.1551450-2-Jiqian.Chen@amd.com> (raw)
In-Reply-To: <20231210165240.1551450-1-Jiqian.Chen@amd.com>
In PVH dom0, it uses the linux local interrupt mechanism,
when it allocs irq for a gsi, it is dynamic, and follow
the principle of applying first, distributing first. And
the irq number is alloced from small to large, but the
applying gsi number is not, may gsi 38 comes before gsi
28, that causes the irq number is not equal with the gsi
number. And when passthrough a device, qemu wants to use
gsi to map pirq, xen_pt_realize->xc_physdev_map_pirq, but
the gsi number is got from file
/sys/bus/pci/devices/<sbdf>/irq in current code, so it
will fail when mapping.
Use real gsi number read from gsi sysfs.
Co-developed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
---
hw/xen/xen-host-pci-device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/xen/xen-host-pci-device.c b/hw/xen/xen-host-pci-device.c
index 8c6e9a1716..e270ac2631 100644
--- a/hw/xen/xen-host-pci-device.c
+++ b/hw/xen/xen-host-pci-device.c
@@ -364,7 +364,7 @@ void xen_host_pci_device_get(XenHostPCIDevice *d, uint16_t domain,
}
d->device_id = v;
- xen_host_pci_get_dec_value(d, "irq", &v, errp);
+ xen_host_pci_get_dec_value(d, "gsi", &v, errp);
if (*errp) {
goto error;
}
--
2.34.1
next prev parent reply other threads:[~2023-12-10 16:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-10 16:52 [RFC QEMU PATCH v3 0/1] Support device passthrough when dom0 is PVH on Xen Jiqian Chen
2023-12-10 16:52 ` Jiqian Chen [this message]
2023-12-11 15:33 ` [RFC QEMU PATCH v3 1/1] xen: Use gsi instead of irq for mapping pirq Roger Pau Monné
2023-12-12 6:37 ` 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=20231210165240.1551450-2-Jiqian.Chen@amd.com \
--to=jiqian.chen@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Honglei1.Huang@amd.com \
--cc=Julia.Zhang@amd.com \
--cc=Ray.Huang@amd.com \
--cc=Stewart.Hildebrand@amd.com \
--cc=anthony.perard@citrix.com \
--cc=paul@xen.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=xenia.ragiadakou@amd.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).