linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Neeraj Upadhyay <neeraju@codeaurora.org>
Cc: julien.thierry.kdev@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: Query regarding pseudo nmi support on GIC V3 and request_nmi()
Date: Fri, 08 May 2020 11:45:11 +0100	[thread overview]
Message-ID: <87ftca1z9k.wl-maz@kernel.org> (raw)
In-Reply-To: <2a0d5719-b2c7-1287-e0b5-2dd8b1072e49@codeaurora.org>

On Thu, 07 May 2020 17:06:19 +0100,
Neeraj Upadhyay <neeraju@codeaurora.org> wrote:
> 
> Hi,
> 
> I have one query regarding pseudo NMI support on GIC v3; from what I
> could understand, GIC v3 supports pseudo NMI setup for SPIs and PPIs.
> However the request_nmi() in irq framework requires NMI to be per cpu
> interrupt source (it checks for IRQF_PERCPU). Can you please help
> understand this part, how SPIs can be configured as NMIs, if there is
> a per cpu interrupt source restriction?

Let me answer your question by another question: what is the semantic
of a NMI if you can't associate it with a particular CPU?

We use pseudo-NMI to be able to profile (or detect lockups) within
sections where normal interrupts cannot fire. If the interrupt can
end-up on a random CPU (with an unrelated PMU or one that hasn't
locked up), what have we achieved? Only confusion.

The whole point is that NMIs have to be tied to a given CPU. For
SGI/PPI, this is guaranteed by construction. For SPIs, this means that
the affinity cannot be changed from userspace. IRQF_PERCPU doesn't
mean much in this context as we don't "broadcast" interrupts, but is
an indication to the core kernel that the same interrupt cannot be
taken on another CPU.

The short of it is that NMIs are only for per-CPU sources. For SPIs,
that's for PMUs that use SPIs instead of PPIs. Don't use it for
anything else.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2020-05-08 10:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 16:06 Query regarding pseudo nmi support on GIC V3 and request_nmi() Neeraj Upadhyay
2020-05-08 10:45 ` Marc Zyngier [this message]
2020-05-08 11:06   ` Neeraj Upadhyay
2020-05-08 12:27     ` Marc Zyngier
2020-05-08 12:39       ` Neeraj Upadhyay
2020-05-08 12:53         ` Marc Zyngier
2020-05-08 13:34           ` Neeraj Upadhyay
2020-05-08 16:11             ` Marc Zyngier
2020-05-08 16:16               ` Neeraj Upadhyay

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=87ftca1z9k.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neeraju@codeaurora.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;
as well as URLs for NNTP newsgroup(s).