Patch "powerpc/interrupt: Don't read MSR from interrupt_exit_kernel_prepare()" 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

    powerpc/interrupt: Don't read MSR from interrupt_exit_kernel_prepare()

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:
     powerpc-interrupt-don-t-read-msr-from-interrupt_exit.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 ae3cf776120039aafd4384d5bb873d11345e77bb
Author: Christophe Leroy <christophe.leroy@xxxxxxxxxx>
Date:   Mon Jun 5 10:55:26 2023 +0200

    powerpc/interrupt: Don't read MSR from interrupt_exit_kernel_prepare()
    
    [ Upstream commit 0eb089a72fda3f7969e6277804bde75dc1474a14 ]
    
    A disassembly of interrupt_exit_kernel_prepare() shows a useless read
    of MSR register. This is shown by r9 being re-used immediately without
    doing anything with the value read.
    
      c000e0e0:       60 00 00 00     nop
      c000e0e4:       7d 3a c2 a6     mfmd_ap r9
      c000e0e8:       7d 20 00 a6     mfmsr   r9
      c000e0ec:       7c 51 13 a6     mtspr   81,r2
      c000e0f0:       81 3f 00 84     lwz     r9,132(r31)
      c000e0f4:       71 29 80 00     andi.   r9,r9,32768
    
    This is due to the use of local_irq_save(). The flags read by
    local_irq_save() are never used, use local_irq_disable() instead.
    
    Fixes: 13799748b957 ("powerpc/64: use interrupt restart table to speed up return from interrupt")
    Signed-off-by: Christophe Leroy <christophe.leroy@xxxxxxxxxx>
    Reviewed-by: Nicholas Piggin <npiggin@xxxxxxxxx>
    Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
    Link: https://msgid.link/df36c6205ab64326fb1b991993c82057e92ace2f.1685955214.git.christophe.leroy@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
index 8703df709cce8..e93f67c3af76b 100644
--- a/arch/powerpc/kernel/interrupt.c
+++ b/arch/powerpc/kernel/interrupt.c
@@ -531,7 +531,6 @@ void preempt_schedule_irq(void);
 
 notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs)
 {
-	unsigned long flags;
 	unsigned long ret = 0;
 	unsigned long kuap;
 	bool stack_store = current_thread_info()->flags &
@@ -548,7 +547,7 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs)
 
 	kuap = kuap_get_and_assert_locked();
 
-	local_irq_save(flags);
+	local_irq_disable();
 
 	if (!arch_irq_disabled_regs(regs)) {
 		/* Returning to a kernel context with local irqs enabled. */



[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