[Skiboot] [PATCH 59/60] xive: Properly initialize new VP and EQ structures

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Dec 22 14:17:07 AEDT 2016


We were using uninitialized memory for the VPs, causing occasionally
spurrious interrupts at startup due to IPB being non-0

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 hw/xive.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/xive.c b/hw/xive.c
index 2c0c006..9e80540 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -782,6 +782,8 @@ static struct xive_vp *xive_get_vp(struct xive *x, unsigned int idx)
 static void xive_init_default_vp(struct xive_vp *vp,
 				 uint32_t eq_blk, uint32_t eq_idx)
 {
+	memset(vp, 0, sizeof(struct xive_vp));
+
 	/* Stash the EQ base in the pressure relief interrupt field
 	 * and set the ACK# to 0xff to disable pressure relief interrupts
 	 */
@@ -795,6 +797,8 @@ static void xive_init_default_eq(uint32_t vp_blk, uint32_t vp_idx,
 				 struct xive_eq *eq, void *backing_page,
 				 uint8_t prio)
 {
+	memset(eq, 0, sizeof(struct xive_eq));
+
 	eq->w1 = EQ_W1_GENERATION;
 	eq->w3 = ((uint64_t)backing_page) & 0xffffffff;
 	eq->w2 = (((uint64_t)backing_page)) >> 32 & 0x0fffffff;
@@ -3846,6 +3850,7 @@ static int64_t opal_xive_alloc_vp_block(uint32_t alloc_order)
 		 * as we have made sure when freeing the entries to scrub
 		 * it out of the cache.
 		 */
+		memset(vp, 0, sizeof(*vp));
 		vp->w1 = (blk << 28) | eqs;
 		vp->w5 = 0xff000000;
 	}
-- 
2.9.3



More information about the Skiboot mailing list