If check_lock() triggers, a crash will occur. Instead of simply identifying "the irq context was different", indicate the expected and current irq context.
Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> --- CC: George Dunlap <george.dun...@eu.citrix.com> CC: Jan Beulich <jbeul...@suse.com> CC: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> CC: Stefano Stabellini <sstabell...@kernel.org> CC: Tim Deegan <t...@xen.org> CC: Wei Liu <wei.l...@citrix.com> CC: Julien Grall <julien.gr...@arm.com> check_lock() only exists in debug builds, which makes this a low risk change for 4.10. --- xen/common/spinlock.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c index 44b07b7..8f2ba08 100644 --- a/xen/common/spinlock.c +++ b/xen/common/spinlock.c @@ -44,7 +44,13 @@ static void check_lock(struct lock_debug *debug) if ( unlikely(debug->irq_safe != irq_safe) ) { int seen = cmpxchg(&debug->irq_safe, -1, irq_safe); - BUG_ON(seen == !irq_safe); + + if ( seen == !irq_safe ) + { + printk("CHECKLOCK FAILURE: prev irqsafe: %d, curr irqsafe %d\n", + seen, irq_safe); + BUG(); + } } } -- 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel