summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorNicholas Piggin2017-06-13 15:05:49 +0200
committerMichael Ellerman2017-06-19 11:46:28 +0200
commitb48bbb82e2b83537c500417d60218ad44446e572 (patch)
tree11d3df0baa7c3941c188448046b3e51c7db7f578 /arch/powerpc/kernel
parentpowerpc/64s: msgclr when handling doorbell exceptions from system reset (diff)
downloadkernel-qcow2-linux-b48bbb82e2b83537c500417d60218ad44446e572.tar.gz
kernel-qcow2-linux-b48bbb82e2b83537c500417d60218ad44446e572.tar.xz
kernel-qcow2-linux-b48bbb82e2b83537c500417d60218ad44446e572.zip
powerpc/64s: Don't unbalance the return branch predictor in __replay_interrupt()
The __replay_interrupt() code is branched to with bl, but the caller is returned to directly with rfid from the interrupt. Instead, rfid to a stub that returns to the caller with blr, which should keep the return branch predictor balanced. Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 1752beefee69..cad3b4b82813 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1639,6 +1639,10 @@ doorbell_super_common_msgclr:
* Note: While MSR:EE is off, we need to make sure that _MSR
* in the generated frame has EE set to 1 or the exception
* handler will not properly re-enable them.
+ *
+ * Note that we don't specify LR as the NIP (return address) for
+ * the interrupt because that would unbalance the return branch
+ * predictor.
*/
_GLOBAL(__replay_interrupt)
/* We are going to jump to the exception common code which
@@ -1646,7 +1650,7 @@ _GLOBAL(__replay_interrupt)
* we don't give a damn about, so we don't bother storing them.
*/
mfmsr r12
- mflr r11
+ LOAD_REG_ADDR(r11, .L__replay_interrupt_return)
mfcr r9
ori r12,r12,MSR_EE
cmpwi r3,0x900
@@ -1664,4 +1668,6 @@ FTR_SECTION_ELSE
cmpwi r3,0xa00
beq doorbell_super_common_msgclr
ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE)
+.L__replay_interrupt_return:
blr
+