Skip to content

Commit

Permalink
cpu: Clear PCR SPR in opal_reinit_cpus()
Browse files Browse the repository at this point in the history
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 3d01958)
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
mikey authored and stewartsmith committed May 18, 2018
1 parent 2339591 commit b179d8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions include/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b179d8f

Please sign in to comment.