summaryrefslogtreecommitdiffstats
path: root/hw/xive.c
diff options
context:
space:
mode:
authorRussell Currey <ruscur@russell.cc>2017-08-10 16:58:38 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-08-11 16:37:14 +1000
commit3e4cd293c9690b06e437b404b1f032a280630dc3 (patch)
treebf6851a43f455a987fb3c2243af128f5e7039dda /hw/xive.c
parent2c67c7bc4a780f46253c6947dbfce29a9a1f7efa (diff)
downloadtalos-skiboot-3e4cd293c9690b06e437b404b1f032a280630dc3.tar.gz
talos-skiboot-3e4cd293c9690b06e437b404b1f032a280630dc3.zip
xive: Check for valid PIR index when decoding
This fixes an unlikely but possible assert() fail on kdump. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/xive.c')
-rw-r--r--hw/xive.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/xive.c b/hw/xive.c
index 03b9478e..18636723 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -601,6 +601,8 @@ static bool xive_decode_vp(uint32_t vp, uint32_t *blk, uint32_t *idx,
/* PIR case */
if (((vp >> 30) & 1) == 0) {
+ if (find_cpu_by_pir(index) == NULL)
+ return false;
if (blk)
*blk = PIR2VP_BLK(index);
if (idx)
@@ -656,6 +658,8 @@ static bool xive_decode_vp(uint32_t vp, uint32_t *blk, uint32_t *idx,
/* PIR case */
if (((vp >> 30) & 1) == 0) {
+ if (find_cpu_by_pir(index) == NULL)
+ return false;
if (blk)
*blk = PIR2VP_BLK(index);
if (idx)
OpenPOWER on IntegriCloud