freebsd-src/sys/dev/xen/bus
Roger Pau Monné f750dce972 x86/xen: fix accounted interrupt time
The current addition to the interrupt nesting level in
xen_arch_intr_handle_upcall() needs to be compensated in
xen_intr_handle_upcall(), otherwise interrupts dispatched by the upcall handler
end up seeing a td_intr_nesting_level of 2 or more, which makes them assume
there's been an interrupt nesting.

Such extra interrupt nesting count lead to statclock() reporting idle time as
interrupt, as the call from interrupt context will always be seen as a nested
one (td->td_intr_nesting_level >= 2) due to the nesting count increase done by
both xen_arch_intr_handle_upcall() and intr_execute_handlers().

Fix this by adjusting the nested interrupt count before dispatching interrupts
from xen_intr_handle_upcall().

PR: 277231
Reported by: Matthew Grooms <mgrooms@shrew.net>
Fixes: af610cabf1 ('xen/intr: adjust xen_intr_handle_upcall() to match driver filter')
Sponsored by: Cloud Software Group
Reviewed by: Elliott Mitchell <ehem+freebsd@m5p.com>
2024-04-16 09:06:33 +02:00
..
intr-internal.h xen/intr: move interrupt allocation/release to architecture 2023-04-14 15:58:56 +02:00
xen_intr.c x86/xen: fix accounted interrupt time 2024-04-16 09:06:33 +02:00
xenpv.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00