kernel - Fix spinlock bug introduced with windowing
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 2 May 2018 17:19:01 +0000 (10:19 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 2 May 2018 17:19:01 +0000 (10:19 -0700)
commitc5cfe2c8a9e60978d4b0e30340f4cbb1ba1bb5d3
treecb6162bcc5fc8c028bf2a17a0aa0b58617d90843
parente13f6b17d3e877bef9869d8f886dff4cb293b359
kernel - Fix spinlock bug introduced with windowing

* The exclusive spinlock contention code was improperly assuming that
  non-zero EXCLWAIT bits prevented the SHARED bit from being set.  This
  is no longer true, shared locks can sometimes override EXCLWAIT.
  This assumption could result in spin_lock() returning with a shared
  lock instead of an exclusive lock.

* Fixed by ensuring that the SHARED bit is cleared when resolving the
  contended exclusive lock.

* Should hopefully fix the pmap pv == NULL assertion.

Reported-by: dillon, zrj
sys/kern/kern_spinlock.c