From 4f24ef23411d270ef392e1dc280479c0f5304305 Mon Sep 17 00:00:00 2001 From: Frederic Barrat Date: Tue, 23 Jan 2018 20:57:11 +0100 Subject: xive: Mask MMIO load/store to bad location FIR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Cédric Le Goater Signed-off-by: Stewart Smith --- 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 271256b..998705e 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 5262cb4..47dc2c2 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 -- cgit v1.1