rcu: add assertions to debug build
authorJuergen Gross <jgross@suse.com>
Thu, 26 Mar 2020 11:46:48 +0000 (12:46 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 26 Mar 2020 11:46:48 +0000 (12:46 +0100)
commita6fe79a5979a64c86ed5e60715ddfe5090bf1963
tree3b7228b6837191fee80e0fbb396bcc930ec12dd0
parentcef21210fb133038ba399a3a98228f0f9f277c6f
rcu: add assertions to debug build

Xen's RCU implementation relies on no softirq handling taking place
while being in a RCU critical section. Add ASSERT()s in debug builds
in order to catch any violations.

For that purpose modify rcu_read_[un]lock() to use a dedicated percpu
counter additional to preempt_[en|dis]able() as this enables to test
that condition in __do_softirq() (ASSERT_NOT_IN_ATOMIC() is not
usable there due to __cpu_up() calling process_pending_softirqs()
while holding the cpu hotplug lock).

While at it switch the rcu_read_[un]lock() implementation to static
inline functions instead of macros.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/rcupdate.c
xen/common/softirq.c
xen/include/xen/rcupdate.h