[Skiboot] [PATCH] xive: Mask MMIO load/store to bad location FIR

Andrew Donnellan andrew.donnellan at au1.ibm.com
Wed Jan 31 14:45:13 AEDT 2018


On 24/01/18 06:57, Frederic Barrat wrote:
> For opencapi, the trigger page of an interrupt is mapped to user
> space. The intent is to write the page to raise an interrupt but
> there's nothing to prevent a user process from reading it, which has
> the infortunate consequence of checkstopping the system.
> 
> Mask the FIR bit raised when an MMIO operation targets an invalid
> location. It's the recommendation from recent documentation and
> hostboot is expected to mask it at some point. In the meantime, let's
> play it safe.
> 
> Signed-off-by: Frederic Barrat <fbarrat at linux.vnet.ibm.com>

Reviewed-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

> ---
>   hw/xive.c      | 8 +++++++-
>   include/xive.h | 2 ++
>   2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/xive.c b/hw/xive.c
> index 271256bc..998705e9 100644
> --- a/hw/xive.c
> +++ b/hw/xive.c
> @@ -1774,7 +1774,13 @@ static bool xive_config_init(struct xive *x)
>   	/* Disable error reporting in the FIR for info errors
>   	 * from the VC.
>   	 */
> -	xive_regw(x, CQ_FIRMASK_OR, 3ull);
> +	xive_regw(x, CQ_FIRMASK_OR, CQ_FIR_VC_INFO_ERROR_0_1);
> +
> +	/* Mask CI Load and Store to bad location, as IPI trigger
> +	 * pages may be mapped to user space, and a read on the
> +	 * trigger page causes a checkstop
> +	 */
> +	xive_regw(x, CQ_FIRMASK_OR, CQ_FIR_PB_RCMDX_CI_ERR1);
> 
>   	return true;
>   }
> diff --git a/include/xive.h b/include/xive.h
> index 5262cb48..47dc2c29 100644
> --- a/include/xive.h
> +++ b/include/xive.h
> @@ -72,6 +72,8 @@
>   #define CQ_RST_CTL		0x118
>   #define X_CQ_FIRMASK		0x33
>   #define CQ_FIRMASK		0x198
> +#define  CQ_FIR_PB_RCMDX_CI_ERR1	PPC_BIT(19)
> +#define  CQ_FIR_VC_INFO_ERROR_0_1	PPC_BITMASK(62,63)
>   #define X_CQ_FIRMASK_AND	0x34
>   #define CQ_FIRMASK_AND		0x1a0
>   #define X_CQ_FIRMASK_OR		0x35
> 

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com  IBM Australia Limited



More information about the Skiboot mailing list