powerpc/kernel: Drop HMT_MEDIUM_PPR_DISCARD
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 25 Nov 2015 03:25:16 +0000 (14:25 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 17 Dec 2015 11:40:57 +0000 (22:40 +1100)
commitd6265aeaf815801ad53a95f11cea8ea752862176
treeccfd814e423b21069d19e0c6f8bdc3c8b8843693
parentcd5cdeb6c8a42fb87644b0eb5d240f6ce6172402
powerpc/kernel: Drop HMT_MEDIUM_PPR_DISCARD

HMT_MEDIUM_PPR_DISCARD is a macro which is present at the start of most
of our first level exception handlers. It conditionally executes a
HMT_MEDIUM instruction, which sets the processor priority to medium.

On on modern systems, ie. Power7 and later, it is nop'ed out at boot.
All it does is make the exception vectors more cramped, and consume 4
bytes of icache.

On old systems it has the effect of boosting the processor priority at
the start of exception processing. If we were previously in the idle
loop for example, we may be at low or very low priority. This is
desirable as we want to process the exception as fast as possible.

However looking closely at the generated code, we see that in all cases
we execute another HMT_MEDIUM just four instructions later. With code
patching applied, the final code on an old (Power6) system will look
like, eg:

  c000000000000300 <data_access_pSeries>:
  c000000000000300: 7c 42 13 78 mr r2,r2 <-
  c000000000000304: 7d b2 43 a6 mtsprg 2,r13
  c000000000000308: 7d b1 42 a6 mfsprg r13,1
  c00000000000030c: f9 2d 00 80 std r9,128(r13)
  c000000000000310: 60 00 00 00 nop
  c000000000000314: 7c 42 13 78 mr r2,r2 <-

So I suggest that the added code complexity of HMT_MEDIUM_PPR_DISCARD is
not justified by the benefit of boosting the processor priority for the
duration of four instructions, and therefore we drop it.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/exception-64s.h
arch/powerpc/kernel/exceptions-64s.S
This page took 0.030106 seconds and 5 git commands to generate.