From: Jason Andryuk <jason.andryuk@amd.com>
To: <xen-devel@lists.xenproject.org>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>,
"Jason Andryuk" <jason.andryuk@amd.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Juergen Gross" <jgross@suse.com>
Subject: [PATCH v2 2/2] tools/libxl: Skip missing PCI GSIs
Date: Fri, 7 Mar 2025 19:17:11 -0500 [thread overview]
Message-ID: <20250308001711.18746-3-jason.andryuk@amd.com> (raw)
In-Reply-To: <20250308001711.18746-1-jason.andryuk@amd.com>
A PCI device may not have a legacy IRQ. In that case, we don't need to
do anything, so don't fail in libxl__arch_hvm_map_gsi() and
libxl__arch_hvm_unmap_gsi().
Requires an updated pciback to return -ENOENT.
Fixes: f97f885c7198 ("tools: Add new function to do PIRQ (un)map on PVH dom0")
Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
---
v2:
Use gsi < 0 - Jan
---
tools/libs/light/libxl_x86.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c
index a3164a3077..0a7f64ad46 100644
--- a/tools/libs/light/libxl_x86.c
+++ b/tools/libs/light/libxl_x86.c
@@ -901,7 +901,10 @@ int libxl__arch_hvm_map_gsi(libxl__gc *gc, uint32_t sbdf, uint32_t domid)
int pirq = -1, gsi, r;
gsi = xc_pcidev_get_gsi(CTX->xch, sbdf);
- if (gsi < 0) {
+ if (gsi < 0 && errno == ENOENT) {
+ LOGD(DEBUG, domid, "xc_pcidev_get_gsi no gsi");
+ return 0;
+ } else if (gsi < 0) {
return ERROR_FAIL;
}
@@ -925,7 +928,10 @@ int libxl__arch_hvm_unmap_gsi(libxl__gc *gc, uint32_t sbdf, uint32_t domid)
int pirq = -1, gsi, r;
gsi = xc_pcidev_get_gsi(CTX->xch, sbdf);
- if (gsi < 0) {
+ if (gsi < 0 && errno == ENOENT) {
+ LOGD(DEBUG, domid, "xc_pcidev_get_gsi no gsi");
+ return 0;
+ } else if (gsi < 0) {
return ERROR_FAIL;
}
--
2.34.1
next prev parent reply other threads:[~2025-03-08 0:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-08 0:17 [PATCH v2 0/2] tools: Fix PVH dom0 passthrough with legacy irq Jason Andryuk
2025-03-08 0:17 ` [PATCH v2 1/2] tools/ctrl: Silence missing GSI in xc_pcidev_get_gsi() Jason Andryuk
2025-03-12 15:54 ` Anthony PERARD
2025-03-12 15:56 ` Andrew Cooper
2025-03-12 17:09 ` Jason Andryuk
2025-03-08 0:17 ` Jason Andryuk [this message]
2025-03-12 15:57 ` [PATCH v2 2/2] tools/libxl: Skip missing PCI GSIs Anthony PERARD
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=20250308001711.18746-3-jason.andryuk@amd.com \
--to=jason.andryuk@amd.com \
--cc=anthony.perard@vates.tech \
--cc=jgross@suse.com \
--cc=roger.pau@citrix.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.