From: Marc Zyngier <maz@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com,
will@kernel.org, yuzenghui@huawei.com
Subject: Re: [PATCH] arm64: entry: always set GIC_PRIO_PSR_I_SET during entry
Date: Wed, 05 May 2021 15:41:43 +0100 [thread overview]
Message-ID: <877dkdnsyg.wl-maz@kernel.org> (raw)
In-Reply-To: <20210428152939.GB1343@C02TD0UTHF1T.local>
On Wed, 28 Apr 2021 16:29:39 +0100,
Mark Rutland <mark.rutland@arm.com> wrote:
>
> On Wed, Apr 28, 2021 at 04:19:11PM +0100, Mark Rutland wrote:
> > On Wed, Apr 28, 2021 at 03:41:17PM +0100, Marc Zyngier wrote:
> > > Hi Mark,
[...]
> > > I'm a bit worried about forcing PMR to IRQON at this stage. We could
> > > have been in IRQOFF state and entering the kernel because of a
> > > NMI. Don't we risk losing track of how we made it here?
> >
> > I also worried about this, but after digging for a while I convinced
> > myself there wasn't a problem, as:
> >
> > * This is what local_daif_mask() does today. It sets the PMR to
> > GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET regardless of its original state.
> >
> > * For checking how we got here, we use either:
> > - regs::pmr_save, which is sampled (immediately) before we alter HW PMR
> > in the asm above.
> > - DAIF, which is unaffected by this.
> >
> > * This is transparent to local_irq_save() .. local_irq_restore(), as
> > that blindly saves/restores the PMR.
> >
>
> ... oh, and within the GIC driver:
>
> * for a pNMI, we'll leave both PMR and DAIF as-is
>
> * for an IRQ, we'll set the PMU to GIC_PRIO_IRQOFF (regardless of the
> original value), then unmask DAIF.
>
> ... so that'll do the right thing even if we enter with PMR set to
> (GIC_PRIO_IRQON | CIG_PRIO_PSR_I_SET).
Fair enough. FWIW:
Acked-by: Marc Zyngier <maz@kernel.org>
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-05-05 14:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-28 11:15 [PATCH] arm64: entry: always set GIC_PRIO_PSR_I_SET during entry Mark Rutland
2021-04-28 14:41 ` Marc Zyngier
2021-04-28 15:19 ` Mark Rutland
2021-04-28 15:29 ` Mark Rutland
2021-05-05 14:41 ` Marc Zyngier [this message]
2021-05-05 17:42 ` Catalin Marinas
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=877dkdnsyg.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/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).