Le 15/03/2021 à 23:04, Nicholas Piggin a écrit :
This extends the MSR[RI]=0 window a little further into the system
call in order to pair RI and EE enabling with a single mtmsrd.

Time ago, I proposed to delay that on PPC32 and Michael objected, see https://patchwork.ozlabs.org/project/linuxppc-dev/patch/9f9dd859d571e324c7412ed9db9da8cfba678257.1548956511.git.christophe.le...@c-s.fr/



Signed-off-by: Nicholas Piggin <npig...@gmail.com>
---
  arch/powerpc/kernel/exceptions-64s.S | 2 --
  arch/powerpc/kernel/interrupt_64.S   | 6 +++---
  2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kernel/exceptions-64s.S 
b/arch/powerpc/kernel/exceptions-64s.S
index bd0c82ac9de5..2f14ac3c377c 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1999,8 +1999,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE)
        mtctr   r10
        bctr
        .else
-       li      r10,MSR_RI
-       mtmsrd  r10,1                   /* Set RI (EE=0) */
  #ifdef CONFIG_RELOCATABLE
        __LOAD_HANDLER(r10, system_call_common)
        mtctr   r10
diff --git a/arch/powerpc/kernel/interrupt_64.S 
b/arch/powerpc/kernel/interrupt_64.S
index f28f41a1a85a..eef61800f734 100644
--- a/arch/powerpc/kernel/interrupt_64.S
+++ b/arch/powerpc/kernel/interrupt_64.S
@@ -311,10 +311,10 @@ END_BTB_FLUSH_SECTION
         * nothing pending. system_call_exception() will call
         * trace_hardirqs_off().
         */
-       li      r11,IRQS_ALL_DISABLED
-       li      r12,PACA_IRQ_HARD_DIS
+       li      r11,IRQS_DISABLED
+       li      r12,-1 /* Set MSR_EE and MSR_RI */
        stb     r11,PACAIRQSOFTMASK(r13)
-       stb     r12,PACAIRQHAPPENED(r13)
+       mtmsrd  r12,1
ENTER_KERNEL_SECURITY_FALLBACK

Reply via email to