locking/pvqspinlock: Fix kernel panic in locking-selftest
authorWaiman Long <Waiman.Long@hp.com>
Sun, 12 Jul 2015 01:19:19 +0000 (21:19 -0400)
committerIngo Molnar <mingo@kernel.org>
Tue, 21 Jul 2015 08:18:07 +0000 (10:18 +0200)
commitcba77f03f2c7b6cc0b0a44a3c679e0abade7da62
treedaba72ef7775e93627688ce9dd086a6e421c1feb
parent9d634c410b07be7bf637ea03362d3ff132088fe3
locking/pvqspinlock: Fix kernel panic in locking-selftest

Enabling locking-selftest in a VM guest may cause the following
kernel panic:

  kernel BUG at .../kernel/locking/qspinlock_paravirt.h:137!

This is due to the fact that the pvqspinlock unlock function is
expecting either a _Q_LOCKED_VAL or _Q_SLOW_VAL in the lock
byte. This patch prevents that bug report by ignoring it when
debug_locks_silent is set. Otherwise, a warning will be printed
if it contains an unexpected value.

With this patch applied, the kernel locking-selftest completed
without any noise.

Tested-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Waiman Long <Waiman.Long@hp.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1436663959-53092-1-git-send-email-Waiman.Long@hp.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/locking/qspinlock_paravirt.h