[Skiboot] [PATCH] cpu: Clear PCR SPR in opal_reinit_cpus()

Vaidyanathan Srinivasan svaidy at linux.vnet.ibm.com
Fri May 18 15:49:21 AEST 2018


* Michael Neuling <mikey at neuling.org> [2018-05-18 11:58:27]:

> 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 at neuling.org>

Reviewed-by: Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com>

> ---
>  core/cpu.c          | 1 +
>  include/processor.h | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/core/cpu.c b/core/cpu.c
> index 1569c9f6c7..0077103d1a 100644
> --- a/core/cpu.c
> +++ b/core/cpu.c
> @@ -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 27cc1aa394..6b262b45e0 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

                                        /* Processor Compatibility Register */
Maybe add a comment just like other sprs.

--Vaidy



More information about the Skiboot mailing list