diff options
author | Andrew Donnellan <andrew.donnellan@au1.ibm.com> | 2017-06-20 15:54:06 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-06-21 17:07:20 +1000 |
commit | 16991da59133dc4a4e321a136cf2c63c42dca8bd (patch) | |
tree | 894ea0dd17863ae7633fe7eff861cdf0ec2e8548 /hw | |
parent | c74e88e8614de0a82cba5c30812d5aa39db747a9 (diff) | |
download | skiboot-16991da59133dc4a4e321a136cf2c63c42dca8bd.zip skiboot-16991da59133dc4a4e321a136cf2c63c42dca8bd.tar.gz skiboot-16991da59133dc4a4e321a136cf2c63c42dca8bd.tar.bz2 |
xive: Fix initialisation of xive_cpu_state struct
When using XIVE emulation with DEBUG=1, we run into crashes in log_add()
due to the xive_cpu_state->log_pos being uninitialised (and thus, with
DEBUG enabled, initialised to the poison value of 0x99999999).
Zero out the xive_cpu_state to fix this.
Fixes: 6480d9656348 ("XIVE: Base XIVE support for OPAL XICS emulation calls")
Reported-by: Alastair D'Silva <alastair@d-silva.org>
Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xive.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -3057,6 +3057,7 @@ static void xive_init_cpu(struct cpu_thread *c) /* Initialize the state structure */ c->xstate = xs = local_alloc(c->chip_id, sizeof(struct xive_cpu_state), 1); assert(xs); + memset(xs, 0, sizeof(struct xive_cpu_state)); xs->xive = x; init_lock(&xs->lock); |