diff options
author | Michael Neuling <mikey@neuling.org> | 2018-05-18 11:58:27 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-05-18 15:03:00 +1000 |
commit | b179d8ff62a89c0ef30e6faf552bf14e9cdc15db (patch) | |
tree | 57946067898419915d4e70dcfe8cb5e56e43f6e8 | |
parent | 2339591c446548a4d8bbad0d1ceb093a095955be (diff) | |
download | skiboot-b179d8ff62a89c0ef30e6faf552bf14e9cdc15db.zip skiboot-b179d8ff62a89c0ef30e6faf552bf14e9cdc15db.tar.gz skiboot-b179d8ff62a89c0ef30e6faf552bf14e9cdc15db.tar.bz2 |
cpu: Clear PCR SPR in opal_reinit_cpus()
Currently if Linux boots with a non-zero PCR, things can go bad where
some early userspace programs can take illegal instructions. This is
being fixed in Linux, but in the mean time, we should cleanup in
skiboot also.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
(cherry picked from commit 3d019581c98153fc047821e3266d90852141f70d)
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r-- | core/cpu.c | 1 | ||||
-rw-r--r-- | include/processor.h | 1 |
2 files changed, 2 insertions, 0 deletions
@@ -1333,6 +1333,7 @@ static void cpu_cleanup_one(void *param __unused) { mtspr(SPR_AMR, 0); mtspr(SPR_IAMR, 0); + mtspr(SPR_PCR, 0); } static int64_t cpu_cleanup_all(void) diff --git a/include/processor.h b/include/processor.h index 27cc1aa..6b262b4 100644 --- a/include/processor.h +++ b/include/processor.h @@ -77,6 +77,7 @@ #define SPR_LPCR 0x13e #define SPR_HMER 0x150 /* Hypervisor Maintenance Exception */ #define SPR_HMEER 0x151 /* HMER interrupt enable mask */ +#define SPR_PCR 0x152 #define SPR_AMOR 0x15d #define SPR_PSSCR 0x357 /* RW: Stop status and control (ISA 3) */ #define SPR_TSCR 0x399 |