<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/tools/testing/selftests/kvm/irq_test.c, branch master</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>KVM: selftests: Add KVM syscall wrappers for pthread_{cancel,join}()</title>
<updated>2026-07-31T20:54:47+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2026-07-31T19:56:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=bc9143135bf328a61456c7eb60e97b5ffb15e96e'/>
<id>bc9143135bf328a61456c7eb60e97b5ffb15e96e</id>
<content type='text'>
Add and use KVM wrappers for pthread_{cancel,join}() so that selftests
don't need to manually assert that the syscalls succeeded.

Note, the vast majority tests don't actually assert success, but they all
obviously rely on the syscall to succeed.

Other than explicitly failing if a syscall fails, no functional change
intended.

Link: https://patch.msgid.link/20260731195612.2697986-10-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add and use KVM wrappers for pthread_{cancel,join}() so that selftests
don't need to manually assert that the syscalls succeeded.

Note, the vast majority tests don't actually assert success, but they all
obviously rely on the syscall to succeed.

Other than explicitly failing if a syscall fails, no functional change
intended.

Link: https://patch.msgid.link/20260731195612.2697986-10-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KVM: selftests: Add KVM syscall wrapper for pthread_create()</title>
<updated>2026-07-31T20:54:47+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2026-07-31T19:56:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5171573ce7cbaaaa3a02879a369f5884e3906710'/>
<id>5171573ce7cbaaaa3a02879a369f5884e3906710</id>
<content type='text'>
Add and use a KVM wrapper for pthread_create() syscall so that selftests
don't need to manually assert that the syscall succeeded.

Note, most tests don't actually assert success, but they all obviously
rely on the syscall to succeed.

Other than explicitly failing if pthread_create() fails, no functional
change intended.

Link: https://patch.msgid.link/20260731195612.2697986-9-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add and use a KVM wrapper for pthread_create() syscall so that selftests
don't need to manually assert that the syscall succeeded.

Note, most tests don't actually assert success, but they all obviously
rely on the syscall to succeed.

Other than explicitly failing if pthread_create() fails, no functional
change intended.

Link: https://patch.msgid.link/20260731195612.2697986-9-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KVM: selftests: Add xAPIC support in eventfd IRQ test</title>
<updated>2026-07-07T18:24:45+00:00</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2026-06-26T21:35:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2708ecca4dbdb51e40e0f6ada9154d7162b09623'/>
<id>2708ecca4dbdb51e40e0f6ada9154d7162b09623</id>
<content type='text'>
Extend the eventfd IRQ test with a '-x' flag to let the user run the test
in xAPIC mode instead of the default x2APIC mode.  When using xAPIC mode,
sanity check user input to ensure the test is being run with at most 255
vCPUs, as xAPIC can only address IDs 0-254 (255, i.e. 0xff, broadcasts to
all CPUs).

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
[sean: add sanity check on number of vCPUs]
Link: https://patch.msgid.link/20260626213534.3866178-21-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extend the eventfd IRQ test with a '-x' flag to let the user run the test
in xAPIC mode instead of the default x2APIC mode.  When using xAPIC mode,
sanity check user input to ensure the test is being run with at most 255
vCPUs, as xAPIC can only address IDs 0-254 (255, i.e. 0xff, broadcasts to
all CPUs).

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
[sean: add sanity check on number of vCPUs]
Link: https://patch.msgid.link/20260626213534.3866178-21-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KVM: selftests: Make number of vCPUs configurable in IRQ test</title>
<updated>2026-07-07T18:24:44+00:00</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2026-06-26T21:35:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0315713a19388010b6c9f904cd6544ef6ef3a802'/>
<id>0315713a19388010b6c9f904cd6544ef6ef3a802</id>
<content type='text'>
Extend the eventfd IRQ test with a '-v' flag to allow the user to
configure the number of vCPUs to create and run (versus only ever using a
single vCPU).

Update the routing logic to play nice with 32 bit IDs, enable x2APIC format
in KVM (to enable 32-bit ID routing), and disable KVM's x2APIC broadcast
quirk so that targeting vCPU 255 doesn't blast the interrupt to all vCPUs
when in x2APIC mode.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
Co-developed-by: Sean Christopherson &lt;seanjc@google.com&gt;
Link: https://patch.msgid.link/20260626213534.3866178-20-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extend the eventfd IRQ test with a '-v' flag to allow the user to
configure the number of vCPUs to create and run (versus only ever using a
single vCPU).

Update the routing logic to play nice with 32 bit IDs, enable x2APIC format
in KVM (to enable 32-bit ID routing), and disable KVM's x2APIC broadcast
quirk so that targeting vCPU 255 doesn't blast the interrupt to all vCPUs
when in x2APIC mode.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
Co-developed-by: Sean Christopherson &lt;seanjc@google.com&gt;
Link: https://patch.msgid.link/20260626213534.3866178-20-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KVM: selftests: Verify vCPU migration during IRQ delivery in IRQ test</title>
<updated>2026-07-07T18:24:44+00:00</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2026-06-26T21:35:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6b9470baea6c4c61e501cdf00a3b2b2113d554f8'/>
<id>6b9470baea6c4c61e501cdf00a3b2b2113d554f8</id>
<content type='text'>
Extend the eventfd IRQ test with a '-m' flag to have the test migrate the
target vCPU to a random physical CPU before triggering its interrupt, e.g.
to validate KVM's ability to update device posted IRQ routing.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
[sean: pin one vCPU at a time to simplify things, use main()'s affinity]
Link: https://patch.msgid.link/20260626213534.3866178-19-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extend the eventfd IRQ test with a '-m' flag to have the test migrate the
target vCPU to a random physical CPU before triggering its interrupt, e.g.
to validate KVM's ability to update device posted IRQ routing.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
[sean: pin one vCPU at a time to simplify things, use main()'s affinity]
Link: https://patch.msgid.link/20260626213534.3866178-19-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KVM: selftests: Verify non-postable IRQ remapping in IRQ test</title>
<updated>2026-07-07T18:24:44+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2026-06-26T21:35:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=25e268b76e771525fa2fca3205ad0a708d55792a'/>
<id>25e268b76e771525fa2fca3205ad0a708d55792a</id>
<content type='text'>
Extend the eventfd IRQ test with an '-n' flag to route a subset of device
interrupts as NMIs (Non-Maskable Interrupts) into the guest using an
alternating pattern of 4 NMIs followed by 4 regular interrupts.

While this adds coverage for NMI injection, the primary goal is to
validate KVM's handling of non-postable interrupt delivery (AMD and Intel
IOMMUs only support posting fixed IRQs targeting a single vCPU).  KVM
has historically bungled handling transitions between posted and remapped
modes.  Use NMIs to stress the transitions, because they are a reliable,
architectural way to force these code paths.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
[sean: add GUEST_RECEIVED_INTERRUPT(), massage changelog]
Link: https://patch.msgid.link/20260626213534.3866178-15-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extend the eventfd IRQ test with an '-n' flag to route a subset of device
interrupts as NMIs (Non-Maskable Interrupts) into the guest using an
alternating pattern of 4 NMIs followed by 4 regular interrupts.

While this adds coverage for NMI injection, the primary goal is to
validate KVM's handling of non-postable interrupt delivery (AMD and Intel
IOMMUs only support posting fixed IRQs targeting a single vCPU).  KVM
has historically bungled handling transitions between posted and remapped
modes.  Use NMIs to stress the transitions, because they are a reliable,
architectural way to force these code paths.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
[sean: add GUEST_RECEIVED_INTERRUPT(), massage changelog]
Link: https://patch.msgid.link/20260626213534.3866178-15-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KVM: selftests: Make number of IRQs configurable in IRQ test</title>
<updated>2026-07-07T18:24:44+00:00</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2026-06-26T21:35:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=38950af64a1ca9dc6a0279b6d0881e54ed3a5921'/>
<id>38950af64a1ca9dc6a0279b6d0881e54ed3a5921</id>
<content type='text'>
Extend the eventfd IRQ test with a '-i' flag to let the user specify the
the number of IRQs to generate (instead of hardcoding the test to always
generate 1000 interrupts).

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
[sean: massage changelog]
Link: https://patch.msgid.link/20260626213534.3866178-14-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extend the eventfd IRQ test with a '-i' flag to let the user specify the
the number of IRQs to generate (instead of hardcoding the test to always
generate 1000 interrupts).

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
[sean: massage changelog]
Link: https://patch.msgid.link/20260626213534.3866178-14-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KVM: selftests: Add option to set empty routing between IRQs in eventfd IRQ test</title>
<updated>2026-07-07T18:24:44+00:00</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2026-06-26T21:35:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ec333e3ace258dde8eddbdded2a8be81b3501cf2'/>
<id>ec333e3ace258dde8eddbdded2a8be81b3501cf2</id>
<content type='text'>
Extend the eventfd IRQ test with an '-e' flag to set empty GSI routing
between interrupts.  Clobbering the GSI routing table verifies that KVM
correctly handles CPUx =&gt; NULL =&gt; CPUy transitions, not just CPUx =&gt; CPUy
transitions, and verifies that KVM can "rebuild" an entire routing setup.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
[sean: '-e' for "empty" instead of '-c' for "clear", massage changelog]
Link: https://patch.msgid.link/20260626213534.3866178-13-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extend the eventfd IRQ test with an '-e' flag to set empty GSI routing
between interrupts.  Clobbering the GSI routing table verifies that KVM
correctly handles CPUx =&gt; NULL =&gt; CPUy transitions, not just CPUx =&gt; CPUy
transitions, and verifies that KVM can "rebuild" an entire routing setup.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
[sean: '-e' for "empty" instead of '-c' for "clear", massage changelog]
Link: https://patch.msgid.link/20260626213534.3866178-13-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KVM: selftests: Verify interrupts are received when IRQ affinity changes in IRQ test</title>
<updated>2026-07-07T18:24:44+00:00</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2026-06-26T21:35:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=197b0cd9ac66bf28f575f2723499f6516bb56f3e'/>
<id>197b0cd9ac66bf28f575f2723499f6516bb56f3e</id>
<content type='text'>
Extent the eventfd IRQ test with a '-a' flag to randomly affinitize the
device's host IRQ to different physical CPUs throughout the test.  This
stresses the kernel's ability to maintain correct interrupt routing and
delivery even as the underlying hardware IRQ affinity is changed
dynamically via /proc/&lt;irq&gt;/smp_affinity{,_list}.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
[sean: massage changelog]
Link: https://patch.msgid.link/20260626213534.3866178-12-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extent the eventfd IRQ test with a '-a' flag to randomly affinitize the
device's host IRQ to different physical CPUs throughout the test.  This
stresses the kernel's ability to maintain correct interrupt routing and
delivery even as the underlying hardware IRQ affinity is changed
dynamically via /proc/&lt;irq&gt;/smp_affinity{,_list}.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
[sean: massage changelog]
Link: https://patch.msgid.link/20260626213534.3866178-12-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KVM: selftests: Add VFIO device support to eventfd IRQ test</title>
<updated>2026-07-07T18:24:44+00:00</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2026-06-26T21:35:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3902e8b02dce7878b65f10ada5d62def3e2d3a65'/>
<id>3902e8b02dce7878b65f10ada5d62def3e2d3a65</id>
<content type='text'>
Extend the eventfd IRQ test with a '-d' argument that takes a BDF (in the
format segment:bus:device.function) of an interrupt-capable PCI(e) device
bound to VFIO, and use said device to trigger interrupts instead of always
synthesizing interrupts via direct writes to the eventfd.

Using a VFIO device to trigger interrupts validates the end-to-end delivery
of IRQs for "real" devices, and when supported by hardware (and KVM), also
validates interrupt delivery via IRQ bypass, i.e. via device posted IRQs.

Now that IOMMUFD is a thing, auto-probe IOMMUFD vs. "legacy" VFIO by
temporarily opening /dev/iommufd, and skip the test if neither IOMMUFD nor
legacy VFIO is available.  Add a '-t' option to the user override the probe
logic, e.g. in case IOMMUFD is available but the system is configured for
legacy usage.

Note, the device must have a VFIO selftest driver in order to work with
the test.  A helper script to list supported devices will hopefully be
available in the near future at
tools/testing/selftests/vfio/scripts/list_supported_devices.sh[1].

Example:
$ ./tools/testing/selftests/kvm/irq_test -d 0000:06:0a.1

Link: https://lore.kernel.org/all/20260602222941.3133236-1-jrhilke%40google.com [1]
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
Co-developed-by: Sean Christopherson &lt;seanjc@google.com&gt;
Link: https://patch.msgid.link/20260626213534.3866178-10-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extend the eventfd IRQ test with a '-d' argument that takes a BDF (in the
format segment:bus:device.function) of an interrupt-capable PCI(e) device
bound to VFIO, and use said device to trigger interrupts instead of always
synthesizing interrupts via direct writes to the eventfd.

Using a VFIO device to trigger interrupts validates the end-to-end delivery
of IRQs for "real" devices, and when supported by hardware (and KVM), also
validates interrupt delivery via IRQ bypass, i.e. via device posted IRQs.

Now that IOMMUFD is a thing, auto-probe IOMMUFD vs. "legacy" VFIO by
temporarily opening /dev/iommufd, and skip the test if neither IOMMUFD nor
legacy VFIO is available.  Add a '-t' option to the user override the probe
logic, e.g. in case IOMMUFD is available but the system is configured for
legacy usage.

Note, the device must have a VFIO selftest driver in order to work with
the test.  A helper script to list supported devices will hopefully be
available in the near future at
tools/testing/selftests/vfio/scripts/list_supported_devices.sh[1].

Example:
$ ./tools/testing/selftests/kvm/irq_test -d 0000:06:0a.1

Link: https://lore.kernel.org/all/20260602222941.3133236-1-jrhilke%40google.com [1]
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Co-developed-by: Josh Hilke &lt;jrhilke@google.com&gt;
Signed-off-by: Josh Hilke &lt;jrhilke@google.com&gt;
Co-developed-by: Sean Christopherson &lt;seanjc@google.com&gt;
Link: https://patch.msgid.link/20260626213534.3866178-10-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
