[Skiboot] [PATCH v2 08/10] xive: Warn on valid VPs found in abnormal cases

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue Nov 21 20:32:29 AEDT 2017


If an allocated VP is left valid at xive_reset() or Linux tries
to free a valid (enabled) VP block, print errors. The former happens
occasionally if kdump'ing while KVM is running so keep it as a debug
message. The latter is a programming error in Linux so use a an
error log level.

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

diff --git a/hw/xive.c b/hw/xive.c
index ae95772e..b48b168e 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -4539,6 +4539,7 @@ static void xive_reset_one(struct xive *x)
 			continue;
 
 		/* Clear it */
+		xive_dbg(x, "VP 0x%x:0x%x is valid at reset\n", x->block_id, i);
 		xive_vpc_cache_update(x, x->block_id,
 				      i, 0, 8, &vp0, false, true);
 	}
@@ -4698,8 +4699,10 @@ static int64_t opal_xive_free_vp_block(uint64_t vp_base)
 		}
 
 		/* VP must be disabled */
-		if (vp->w0 & VP_W0_VALID)
+		if (vp->w0 & VP_W0_VALID) {
+			prlog(PR_ERR, "XIVE: freeing active VP %d\n", vp_id);
 			return OPAL_XIVE_FREE_ACTIVE;
+		}
 
 		/* Not populated */
 		if (vp->w1 == 0)
-- 
2.14.3



More information about the Skiboot mailing list