public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Question: interrupt randomness and handle_percpu_devid_irq()
@ 2026-03-19 19:34 Michael Kelley
  2026-03-20 15:10 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Kelley @ 2026-03-19 19:34 UTC (permalink / raw)
  To: Marc Zyngier, Thomas Gleixner, Lorenzo Pieralisi,
	linux-arm-kernel@lists.infradead.org, LKML
  Cc: Sebastian Andrzej Siewior, Jan Kiszka

The function header comment for handle_percpu_devid_irq() says that it is the
same as handle_percpu_irq(), but with the addition of a pointer to a percpu
variable with the real device id. That makes sense. But there's another difference:
handle_percpu_irq() calls add_interrupt_randomness() [via handle_irq_event_percpu()],
while handle_percpu_devid_irq() does not.

Question: Is there a reason for this difference in handling interrupt randomness?
Or is it just an oversight? handle_percpu_devid_irq() is used, for example, for the
SGIs and PPIs on the GICv3 chip, so I wondered if IPIs (as built on SGIs) & PPIs
specifically did not want the overhead of add_interrupt_randomness(). But then
GICv5 is doing IPIs using LPIs, which use handle_percpu_irq() and hence *do*
add interrupt randomness. That seemed inconsistent, which didn't help provide
an answer.

The question arises in the context of Linux guests running on Hyper-V. Hyper-V
VMBus interrupts to the guest are per-CPU interrupts in Linux, using a PPI on
arm64. So these interrupts do not call add_interrupt_randomness(), which is a
problem because these guests don't have much other way to get entropy. To
fix this, the VMBus ISR has always had an explicit call to
add_interrupt_randomness(). But maybe that's not the best approach, and
handle_percpu_devid_irq() should be fixed to call add_interrupt_randomness().

Thoughts?

Michael

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question: interrupt randomness and handle_percpu_devid_irq()
  2026-03-19 19:34 Question: interrupt randomness and handle_percpu_devid_irq() Michael Kelley
@ 2026-03-20 15:10 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2026-03-20 15:10 UTC (permalink / raw)
  To: Michael Kelley, Marc Zyngier, Lorenzo Pieralisi,
	linux-arm-kernel@lists.infradead.org, LKML
  Cc: Sebastian Andrzej Siewior, Jan Kiszka

On Thu, Mar 19 2026 at 19:34, Michael Kelley wrote:
> The function header comment for handle_percpu_devid_irq() says that it is the
> same as handle_percpu_irq(), but with the addition of a pointer to a percpu
> variable with the real device id. That makes sense. But there's another difference:
> handle_percpu_irq() calls add_interrupt_randomness() [via handle_irq_event_percpu()],
> while handle_percpu_devid_irq() does not.
>
> Question: Is there a reason for this difference in handling interrupt randomness?
> Or is it just an oversight? handle_percpu_devid_irq() is used, for example, for the
> SGIs and PPIs on the GICv3 chip, so I wondered if IPIs (as built on SGIs) & PPIs
> specifically did not want the overhead of add_interrupt_randomness(). But then
> GICv5 is doing IPIs using LPIs, which use handle_percpu_irq() and hence *do*
> add interrupt randomness. That seemed inconsistent, which didn't help provide
> an answer.
>
> The question arises in the context of Linux guests running on Hyper-V. Hyper-V
> VMBus interrupts to the guest are per-CPU interrupts in Linux, using a PPI on
> arm64. So these interrupts do not call add_interrupt_randomness(), which is a
> problem because these guests don't have much other way to get entropy. To
> fix this, the VMBus ISR has always had an explicit call to
> add_interrupt_randomness(). But maybe that's not the best approach, and
> handle_percpu_devid_irq() should be fixed to call add_interrupt_randomness().

I don't think there is a real good reason unless any of those interrupts
is NMI like.

Thanks,

        tglx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-20 15:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19 19:34 Question: interrupt randomness and handle_percpu_devid_irq() Michael Kelley
2026-03-20 15:10 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox