Skip to content

Commit

Permalink
powerpc/rtas: Leave MSR[RI] enabled over RTAS call
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Nicholas Piggin authored and Michael Ellerman committed May 19, 2022
1 parent 5c86bd0 commit 014b2e8
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions arch/powerpc/kernel/rtas_entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 014b2e8

Please sign in to comment.