Patch "irqchip/gic-v3: Ensure pseudo-NMIs have an ISB between ack and handling" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

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

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     irqchip-gic-v3-ensure-pseudo-nmis-have-an-isb-betwee.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 245f33562bcf9122b04ca6dc7b81cbbda44aa525
Author: Mark Rutland <mark.rutland@xxxxxxx>
Date:   Fri May 13 14:30:36 2022 +0100

    irqchip/gic-v3: Ensure pseudo-NMIs have an ISB between ack and handling
    
    [ Upstream commit adf14453d2c037ab529040c1186ea32e277e783a ]
    
    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@xxxxxxx>
    Cc: Marc Zyngier <maz@xxxxxxxxxx>
    Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
    Cc: Will Deacon <will.deacon@xxxxxxx>
    Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220513133038.226182-2-mark.rutland@xxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index fd4fb1b35787..d8ea330454f4 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.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux