aboutsummaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-02-02 15:34:09 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2018-02-08 18:21:42 -0600
commit92777d335ab3fe8e364014584b454ac48883993b (patch)
tree865e51dac3ab47bee27ceb66d6f89d07578bb8d0 /asm
parent3a7422851bc345971773c4d22881199b7911da33 (diff)
downloadskiboot-92777d335ab3fe8e364014584b454ac48883993b.zip
skiboot-92777d335ab3fe8e364014584b454ac48883993b.tar.gz
skiboot-92777d335ab3fe8e364014584b454ac48883993b.tar.bz2
core/init: manage MSR[ME] explicitly, always enable
The current boot sequence inherits MSR[ME] from the IPL firmware, and never changes it. Some environments disable MSR[ME] (e.g., mambo), and others can enable it (hostboot). This has two problems. First, MSR[ME] must be disabled while in the process of taking over the interrupt vector from the previous environment. Second, after installing our machine check handler, MSR[ME] should be enabled to get some useful output rather than a checkstop. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'asm')
-rw-r--r--asm/head.S29
1 files changed, 29 insertions, 0 deletions
diff --git a/asm/head.S b/asm/head.S
index 264899b..e2ddc91 100644
--- a/asm/head.S
+++ b/asm/head.S
@@ -479,6 +479,35 @@ call_relocate:
.long 0xa6037b7d; /* mtsrr1 r11 */ \
.long 0x2400004c /* rfid */
+.global enable_machine_check
+enable_machine_check:
+ mflr %r0
+ bcl 20,31,$+4
+0: mflr %r3
+ addi %r3,%r3,(1f - 0b)
+ mtspr SPR_HSRR0,%r3
+ mfmsr %r3
+ ori %r3,%r3,MSR_ME
+ mtspr SPR_HSRR1,%r3
+ hrfid
+1: mtlr %r0
+ blr
+
+.global disable_machine_check
+disable_machine_check:
+ mflr %r0
+ bcl 20,31,$+4
+0: mflr %r3
+ addi %r3,%r3,(1f - 0b)
+ mtspr SPR_HSRR0,%r3
+ mfmsr %r3
+ li %r4,MSR_ME
+ andc %r3,%r3,%r4
+ mtspr SPR_HSRR1,%r3
+ hrfid
+1: mtlr %r0
+ blr
+
pm_save_regs:
SAVE_GPR(2,%r1)
SAVE_GPR(14,%r1)