Commit 68de1a47 authored by Michael Neuling's avatar Michael Neuling Committed by Stefan Bader

powerpc/64s: Clear PCR on boot

BugLink: https://bugs.launchpad.net/bugs/1776177

commit faf37c44 upstream.

Clear the PCR (Processor Compatibility Register) on boot to ensure we
are not running in a compatibility mode.

We've seen this cause problems when a crash (and kdump) occurs while
running compat mode guests. The kdump kernel then runs with the PCR
set and causes problems. The symptom in the kdump kernel (also seen in
petitboot after fast-reboot) is early userspace programs taking
sigills on newer instructions (seen in libc).
Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 686690de
...@@ -27,6 +27,7 @@ _GLOBAL(__setup_cpu_power7) ...@@ -27,6 +27,7 @@ _GLOBAL(__setup_cpu_power7)
beqlr beqlr
li r0,0 li r0,0
mtspr SPRN_LPID,r0 mtspr SPRN_LPID,r0
mtspr SPRN_PCR,r0
mfspr r3,SPRN_LPCR mfspr r3,SPRN_LPCR
bl __init_LPCR bl __init_LPCR
bl __init_tlb_power7 bl __init_tlb_power7
...@@ -40,6 +41,7 @@ _GLOBAL(__restore_cpu_power7) ...@@ -40,6 +41,7 @@ _GLOBAL(__restore_cpu_power7)
beqlr beqlr
li r0,0 li r0,0
mtspr SPRN_LPID,r0 mtspr SPRN_LPID,r0
mtspr SPRN_PCR,r0
mfspr r3,SPRN_LPCR mfspr r3,SPRN_LPCR
bl __init_LPCR bl __init_LPCR
bl __init_tlb_power7 bl __init_tlb_power7
...@@ -55,6 +57,7 @@ _GLOBAL(__setup_cpu_power8) ...@@ -55,6 +57,7 @@ _GLOBAL(__setup_cpu_power8)
beqlr beqlr
li r0,0 li r0,0
mtspr SPRN_LPID,r0 mtspr SPRN_LPID,r0
mtspr SPRN_PCR,r0
mfspr r3,SPRN_LPCR mfspr r3,SPRN_LPCR
ori r3, r3, LPCR_PECEDH ori r3, r3, LPCR_PECEDH
bl __init_LPCR bl __init_LPCR
...@@ -74,6 +77,7 @@ _GLOBAL(__restore_cpu_power8) ...@@ -74,6 +77,7 @@ _GLOBAL(__restore_cpu_power8)
beqlr beqlr
li r0,0 li r0,0
mtspr SPRN_LPID,r0 mtspr SPRN_LPID,r0
mtspr SPRN_PCR,r0
mfspr r3,SPRN_LPCR mfspr r3,SPRN_LPCR
ori r3, r3, LPCR_PECEDH ori r3, r3, LPCR_PECEDH
bl __init_LPCR bl __init_LPCR
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment