All of lore.kernel.org
 help / color / mirror / Atom feed
From: "irqchip-bot for Mark Rutland" <tip-bot2@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: Mark Rutland <mark.rutland@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Will Deacon <will.deacon@arm.com>
Subject: [irqchip: irq/irqchip-next] irqchip/gic-v3: Ensure pseudo-NMIs have an ISB between ack and handling
Date: Sun, 15 May 2022 15:57:21 -0000	[thread overview]
Message-ID: <165263024134.4207.16216291350190659715.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20220513133038.226182-2-mark.rutland@arm.com>

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     adf14453d2c037ab529040c1186ea32e277e783a
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/adf14453d2c037ab529040c1186ea32e277e783a
Author:        Mark Rutland <mark.rutland@arm.com>
AuthorDate:    Fri, 13 May 2022 14:30:36 +01:00
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Sun, 15 May 2022 16:38:18 +01:00

irqchip/gic-v3: Ensure pseudo-NMIs have an ISB between ack and handling

There are cases where a context synchronization event is necessary
between an IRQ being raised and being handled, and there are races such
that we cannot rely upon the exception entry being subsequent to the
interrupt being raised.

We identified and fixes this for regular IRQs in commit:

  39a06b67c2c1256b ("irqchip/gic: Ensure we have an ISB between ack and ->handle_irq")

Unfortunately, we forgot to do the same for psuedo-NMIs when support for
those was added in commit:

  f32c926651dcd168 ("irqchip/gic-v3: Handle pseudo-NMIs")

Which means that when pseudo-NMIs are used for PMU support, we'll hit
the same problem.

Apply the same fix as for regular IRQs. Note that when EOI mode 1 is in
use, the call to gic_write_eoir() will provide an ISB.

Fixes: f32c926651dcd168 ("irqchip/gic-v3: Handle pseudo-NMIs")
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220513133038.226182-2-mark.rutland@arm.com
---
 drivers/irqchip/irq-gic-v3.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index b252d55..7305d84 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -654,6 +654,9 @@ static inline void gic_handle_nmi(u32 irqnr, struct pt_regs *regs)
 
 	if (static_branch_likely(&supports_deactivate_key))
 		gic_write_eoir(irqnr);
+	else
+		isb()
+
 	/*
 	 * Leave the PSR.I bit set to prevent other NMIs to be
 	 * received while handling this one.

  reply	other threads:[~2022-05-15 15:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13 13:30 [PATCH 0/3] irqchip/gic-v3: pseudo-NMI fixes Mark Rutland
2022-05-13 13:30 ` [PATCH 1/3] irqchip/gic-v3: ensure pseudo-NMIs have an ISB between ack and handling Mark Rutland
2022-05-15 15:57   ` irqchip-bot for Mark Rutland [this message]
2022-05-13 13:30 ` [PATCH 2/3] irqchip/gic-v3: refactor ISB + EOIR at ack time Mark Rutland
2022-05-15 15:57   ` [irqchip: irq/irqchip-next] irqchip/gic-v3: Refactor " irqchip-bot for Mark Rutland
2022-05-13 13:30 ` [PATCH 3/3] irqchip/gic-v3: fix priority mask handling Mark Rutland
2022-05-13 13:45   ` Joey Gouly
2022-05-13 14:08     ` Mark Rutland
2022-05-15 15:57   ` [irqchip: irq/irqchip-next] irqchip/gic-v3: Fix " irqchip-bot for Mark Rutland

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=165263024134.4207.16216291350190659715.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.