public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Thomas Gleixner <tglx@kernel.org>
Cc: Michael Kelley <mhklinux@outlook.com>,
	Marc Zyngier <maz@kernel.org>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: Question: interrupt randomness and handle_percpu_devid_irq()
Date: Wed, 1 Apr 2026 16:14:17 +0200	[thread overview]
Message-ID: <20260401141417.6uJk69i9@linutronix.de> (raw)
In-Reply-To: <87bjgik042.ffs@tglx>

On 2026-03-20 16:10:37 [+0100], Thomas Gleixner wrote:
> 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.

So we could wire up the generic/ arch code here and feed the
"randomness" from there and it from the driver bits.

> Thanks,
> 
>         tglx

Sebastian


  reply	other threads:[~2026-04-01 14:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19 19:34 Question: interrupt randomness and handle_percpu_devid_irq() Michael Kelley
2026-03-20 15:10 ` Thomas Gleixner
2026-04-01 14:14   ` Sebastian Andrzej Siewior [this message]
2026-04-01 14:33     ` Michael Kelley
2026-04-01 14:34       ` Sebastian Andrzej Siewior

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=20260401141417.6uJk69i9@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=jan.kiszka@siemens.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=maz@kernel.org \
    --cc=mhklinux@outlook.com \
    --cc=tglx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox