]> xenbits.xensource.com Git - people/hx242/xen.git/commit
x86/IRQ: don't keep EOI timer running without need
authorJan Beulich <jbeulich@suse.com>
Thu, 6 Jun 2019 14:04:09 +0000 (16:04 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 6 Jun 2019 14:04:09 +0000 (16:04 +0200)
commit359cf6f8a0eccca3bd48624dbc8abd3da44dcf20
treeb2a52c4e7638c867c4a34c716c92b3a3e63e7886
parent3b537c692361579b1c4e4108fc497dae8d0dcd86
x86/IRQ: don't keep EOI timer running without need

The timer needs to remain active only until all pending IRQ instances
have seen EOIs from their respective domains. Stop it when the in-flight
count has reached zero in desc_guest_eoi(). Note that this is race free
(with __do_IRQ_guest()), as the IRQ descriptor lock is being held at
that point.

Also pull up stopping of the timer in __do_IRQ_guest() itself: Instead
of stopping it immediately before re-setting, stop it as soon as we've
made it past any early returns from the function (and hence we're sure
it'll get set again).

Finally bail from the actual timer handler in case we find the timer
already active again by the time we've managed to acquire the IRQ
descriptor lock. Without this we may forcibly EOI an IRQ immediately
after it got sent to a guest. For this, timer_is_active() gets split out
of active_timer(), deliberately moving just one of the two ASSERT()s (to
allow the function to be used also on a never initialized timer).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/irq.c
xen/common/timer.c
xen/include/xen/timer.h