diff mbox series

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

Message ID 20171121093231.28909-8-benh@kernel.crashing.org
State Accepted
Headers show
Series [v2,01/10] xive: Define API for single-escalation VP mode | expand

Commit Message

Benjamin Herrenschmidt Nov. 21, 2017, 9:32 a.m. UTC
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@kernel.crashing.org>
---
 hw/xive.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

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)