xen: credit2: fix spinlock irq-safety violation
authorDario Faggioli <dario.faggioli@citrix.com>
Thu, 21 Sep 2017 00:30:37 +0000 (02:30 +0200)
committerGeorge Dunlap <george.dunlap@citrix.com>
Thu, 21 Sep 2017 10:29:41 +0000 (11:29 +0100)
commit00cc5cd669122b77b336dae52566e813ec45122d
tree7e1c68249fc56fd90f9e7af29614658cea734782
parent0b2cadaaf2bc5216c2a6e43ada24c965380bf094
xen: credit2: fix spinlock irq-safety violation

In commit ad4b3e1e9df34 ("xen: credit2: implement
utilization cap") xfree() was being called (for
deallocating the budget replenishment timer, during
domain destruction) inside an IRQ disabled critical
section.

That must not happen, as it uses the mem-pool's lock,
which needs to be taken with IRQ enabled. And, in fact,
we crash (in debug builds):

(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Xen BUG at spinlock.c:47
(XEN) ****************************************

Let's, therefore, kill and deallocate the timer outside of
the critical sections, when IRQs are enabled.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
xen/common/sched_credit2.c