Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions 0655-libxl-Skip-missing-legacy-IRQ.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 3eb2c24f633d41c4a4ec7b94feab23d235c235dc Mon Sep 17 00:00:00 2001
From: Jason Andryuk <jason.andryuk@amd.com>
Date: Mon, 31 Mar 2025 19:08:07 +0200
Subject: [PATCH] libxl: Skip missing legacy IRQ

A PCI device's irq field is an 8-bit number. A value of 0xff indicates
that the device is not connected. Additionally, the Linux ACPI code can
convert these 0xff values to IRQ_NOTCONNECTED(0x80000000) because
"0x80000000 is guaranteed to be outside the available range of
interrupts and easy to distinguish from other possible incorrect
values." When the hypercall to assign that IRQ fails, device
passthrough as a whole fails.

---
tools/libs/light/libxl_pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 68d4d50cad9e..a3bb946c2de8 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -1486,7 +1486,7 @@ static void pci_add_dm_done(libxl__egc *egc,
LOGED(ERROR, domainid, "Couldn't open %s", sysfs_path);
goto out_no_irq;
}
- if ((fscanf(f, "%u", &irq) == 1) && irq) {
+ if ((fscanf(f, "%u", &irq) == 1) && irq > 0 && irq < 0xff) {
r = xc_physdev_map_pirq(ctx->xch, domid, irq, &irq);
if (r < 0) {
LOGED(ERROR, domainid, "xc_physdev_map_pirq irq=%d (error=%d)",
--
2.48.1

35 changes: 35 additions & 0 deletions 0656-libxl-do-not-consider-IGD-VF-a-VGA-passthru.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 6eac9adf45857e6c9787ad843061136f41883ecb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<marmarek@invisiblethingslab.com>
Date: Sun, 6 Apr 2025 12:30:51 +0200
Subject: [PATCH] libxl: do not consider IGD VF a VGA passthru
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The special QEMU treatment is needed only for non-SR-IOV passthrough. Do
not set the passthru option automatically for VF. If one really wants,
the option can still be set manually.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
tools/libs/light/libxl_pci.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 35e3e1360423..cd9acb21efa6 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -633,6 +633,9 @@ bool libxl__is_igd_vga_passthru(libxl__gc *gc,
pt_vendor != 0x8086)
continue;

+ /* Skip VF, those don't need QEMU hack */
+ if (pci->func)
+ continue;
if (sysfs_dev_get_class(gc, pci, &class))
continue;
if (class == 0x030000 || class == 0x038000)
--
2.48.1

2 changes: 2 additions & 0 deletions xen.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ Patch0630: 0630-tools-xg-increase-LZMA_BLOCK_SIZE-for-uncompressing-.patch

Patch0653: 0653-python-avoid-conflicting-_FORTIFY_SOURCE-values.patch
Patch0654: 0654-libxl-extend-IGD-check.patch
Patch0655: 0655-libxl-Skip-missing-legacy-IRQ.patch
Patch0656: 0656-libxl-do-not-consider-IGD-VF-a-VGA-passthru.patch

# Qubes specific patches
Patch1000: 1000-Do-not-access-network-during-the-build.patch
Expand Down