OSDN Git Service

powerpc/64s: Remove MSR_RI optimisation in system_call_exit()
authorMichael Ellerman <mpe@ellerman.id.au>
Thu, 29 Nov 2018 06:42:24 +0000 (17:42 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 23 Feb 2019 11:31:39 +0000 (22:31 +1100)
commite7fda7e569e1776d4dccbcef52d34882b62b0654
tree06c73856748dd3aa8a2a82aca4df35c9c8c801f1
parentfb0b0a73b223fc113e961b1d921322844e9c30d9
powerpc/64s: Remove MSR_RI optimisation in system_call_exit()

Currently in system_call_exit() we have an optimisation where we
disable MSR_RI (recoverable interrupt) and MSR_EE (external interrupt
enable) in a single mtmsrd instruction.

Unfortunately this will no longer work with THREAD_INFO_IN_TASK,
because then the load of TI_FLAGS might fault and faulting with MSR_RI
clear is treated as an unrecoverable exception which leads to a
panic().

So change the code to only clear MSR_EE prior to loading TI_FLAGS,
leaving the clear of MSR_RI until later. We have some latitude in
where do the clear of MSR_RI. A bit of experimentation has shown that
this location gives the least slow down.

This still causes a noticeable slow down in our null_syscall
performance. On a Power9 DD2.2:

  Before        After         Delta     Delta %
  955 cycles    999 cycles    -44 -4.6%

On the plus side this does simplify the code somewhat, because we
don't have to reenable MSR_RI on the restore_math() or
syscall_exit_work() paths which was necessitated previously by the
optimisation.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/entry_64.S