From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v1] test-runner: Enable interrupt remapping for PCIe passthrough
Date: Tue, 15 Sep 2026 17:37:23 -0400 [thread overview]
Message-ID: <20260915213723.1242672-1-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
A device passed through with -P fails to allocate its MSI-X vectors
(-ENOSPC) as the guest has no way to remap interrupts, so give it a
virtual IOMMU with interrupt remapping enabled, which in turn requires
the irqchip to be split.
Without this the guest is not presented with a DMAR table at all, so
enabling CONFIG_INTEL_IOMMU and CONFIG_IRQ_REMAP on the test kernel has
no effect, and both are now documented as required.
The machine type is moved out of the static argument list as it now
depends on whether -P is used, the resulting command line is otherwise
unchanged.
The model wrote the change and confirmed the guest is only presented
with a DMAR table once the virtual IOMMU is added; it was reviewed and
tested by the author.
Assisted-by: Claude:claude-opus-5
---
doc/test-runner.rst | 11 +++++++++++
tools/test-runner.c | 10 +++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/doc/test-runner.rst b/doc/test-runner.rst
index 6429e80fc75b..dc1e51305c51 100644
--- a/doc/test-runner.rst
+++ b/doc/test-runner.rst
@@ -355,6 +355,17 @@ In addition the above kernel config option the following is required:
CONFIG_ACPI=y
CONFIG_BT_HCIBTINTEL_PCIE=y
+IOMMU and interrupt remapping, without which vfio-pci fails to allocate
+MSI-X vectors (-ENOSPC):
+
+.. code-block::
+
+ CONFIG_INTEL_IOMMU=y
+ CONFIG_INTEL_IOMMU_DEFAULT_ON=y
+ CONFIG_INTEL_IOMMU_SVM=y
+ CONFIG_IRQ_REMAP=y
+ CONFIG_AMD_IOMMU=y
+
On the host, an IOMMU must be enabled in the firmware and on the host kernel
command line (``intel_iommu=on`` or ``amd_iommu=on``). The controller itself
does not need any manual preparation: test-runner unbinds it from its current
diff --git a/tools/test-runner.c b/tools/test-runner.c
index 2de05e26dcf3..338e5b9da544 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -293,7 +293,6 @@ static const char *const qemu_argv[] = {
"-no-user-config",
"-monitor", "none",
"-display", "none",
- "-machine", "type=q35,accel=kvm:tcg",
"-m", "256M",
"-net", "none",
"-no-reboot",
@@ -810,6 +809,13 @@ static int start_qemu(void)
strv_append(&argv, "%s", qemu_binary);
strv_concat(&argv, qemu_argv);
+ /* Interrupt remapping is required to pass through a device using
+ * MSI-X, which in turn needs the split irqchip.
+ */
+ strv_append(&argv, "-machine");
+ strv_append(&argv, "type=q35,accel=kvm:tcg%s",
+ pcie_dev ? ",kernel-irqchip=split" : "");
+
if (qemu_host_cpu) {
strv_append(&argv, "-cpu");
strv_append(&argv, "host");
@@ -835,6 +841,8 @@ static int start_qemu(void)
}
if (pcie_dev) {
+ strv_append(&argv, "-device");
+ strv_append(&argv, "intel-iommu,intremap=on");
strv_append(&argv, "-device");
strv_append(&argv, "%s", pcie_dev);
}
--
2.55.0
next reply other threads:[~2026-09-15 21:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 21:37 Luiz Augusto von Dentz [this message]
2026-09-15 22:58 ` [BlueZ,v1] test-runner: Enable interrupt remapping for PCIe passthrough bluez.test.bot
2026-09-16 18:30 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
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=20260915213723.1242672-1-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.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.