]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/rtas: Leave MSR[RI] enabled over RTAS call
authorNicholas Piggin <npiggin@gmail.com>
Tue, 8 Mar 2022 13:50:42 +0000 (23:50 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 19 May 2022 13:11:27 +0000 (23:11 +1000)
PAPR specifies that RTAS may be called with MSR[RI] enabled if the
calling context is recoverable, and RTAS will manage RI as necessary.
Call the rtas entry point with RI enabled, and add a check to ensure
the caller has RI enabled.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220308135047.478297-10-npiggin@gmail.com
arch/powerpc/kernel/rtas_entry.S

index 3bd29ddba54685be05653678c6ed1ca02d2e38cf..9a434d42e660ac8ee8d13415b324a4da1bbf9142 100644 (file)
@@ -122,15 +122,8 @@ __enter_rtas:
 rtas_return_loc:
        FIXUP_ENDIAN
 
-       /*
-        * Clear RI and set SF before anything.
-        */
-       mfmsr   r6
-       li      r0,MSR_RI
-       andc    r6,r6,r0
-       sldi    r0,r0,(MSR_SF_LG - MSR_RI_LG)
-       or      r6,r6,r0
-       sync
+       /* Set SF before anything. */
+       LOAD_REG_IMMEDIATE(r6, MSR_KERNEL & ~(MSR_IR|MSR_DR))
        mtmsrd  r6
 
        /* relocation is off at this point */