[PATCH 0/2] genirq and Hyper-V: Clean up handling of add_interrupt_randomness()
From: Michael Kelley
Date: Thu Apr 02 2026 - 16:25:00 EST
From: Michael Kelley <mhklinux@xxxxxxxxxxx>
The Hyper-V ISRs are calling add_interrupt_randomness() as a
primary source of entropy in VMs, since the VMs don't have another
good source. The call is currently in the ISRs as a common place to
handle both x86/x64 and arm64. On x86/x64, hypervisor interrupts come
through a custom sysvec entry, and on arm64 they come through an
emulated GICv3. GICv3 uses the generic handler handle_percpu_devid_irq(),
which does not do add_interrupt_randomness(), unlike its counterpart
handle_percpu_irq().
Cleanup this somewhat confusing situation by doing the
add_interrupt_randomness() in handle_percpu_devid_irq(), and remove
it from the Hyper-V ISRs. Then only the Hyper-V custom sysvec path,
which plays the role of a generic interrupt handler, needs to do
add_interrupt_randomness(). As a result of this change, no
device drivers are calling add_interrupt_randomness(), which is
appropriate.
The change is broken into two patches since it spans generic
interrupt handling code and Hyper-V specific code. But the two
patches should be taken together through the same tree. It's
OK to have a bisect window where add_interrupt_randomness() is
done in both places, but taking the Hyper-V patch first could leave
a bisect window where add_interrupt_randomness() is not done in
either place.
Michael Kelley (2):
genirq/chip: Do add_interrupt_randomness() in
handle_percpu_devid_irq()
Drivers: hv: Move add_interrupt_randomness() to hypervisor callback
sysvec
arch/x86/kernel/cpu/mshyperv.c | 2 ++
drivers/hv/mshv_synic.c | 3 ---
drivers/hv/vmbus_drv.c | 3 ---
kernel/irq/chip.c | 3 +++
4 files changed, 5 insertions(+), 6 deletions(-)
--
2.25.1