diff mbox series

[v2,07/10] xive: Properly reserve built-in VPs in non-group mode

Message ID 20171121093231.28909-7-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
This is not normally used but if the #define is changed to
disable block group mode we would incorrectly clear the
buddy completely without marking the built-in VPs reserved.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 hw/xive.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/hw/xive.c b/hw/xive.c
index e5b97b50..ae95772e 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -4546,6 +4546,8 @@  static void xive_reset_one(struct xive *x)
 #ifndef USE_BLOCK_GROUP_MODE
 	/* If block group mode isn't enabled, reset VP alloc buddy */
 	buddy_reset(x->vp_buddy);
+	if (x->block_id == 0)
+		assert(buddy_reserve(x->vp_buddy, 0x800, 11));
 #endif
 
 #ifdef USE_INDIRECT