opnsense-src/sys/dev/xen
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
..
balloon xen/dev: remove __unused from driver argument of identify functions 2023-11-28 13:32:57 +01:00
blkback xen/dev: switch to DEVMETHOD_END 2023-11-28 13:31:47 +01:00
blkfront xen/dev: switch to DEVMETHOD_END 2023-11-28 13:31:47 +01:00
bus x86/xen: fix accounted interrupt time 2024-04-16 09:06:33 +02:00
console x86/xen: introduce non-hypercall based emergency print 2024-02-22 11:08:03 +01:00
control xen/dev: remove __unused from driver argument of identify functions 2023-11-28 13:32:57 +01:00
cpu sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
debug sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
efi sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
evtchn sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
gntdev gntdev: Handle errors from suword32() in gntdev_alloc_gref() 2023-12-25 21:04:01 -05:00
grant_table xen/dev: remove __unused from driver argument of identify functions 2023-11-28 13:32:57 +01:00
netback netpfil: Use accessor functions and named constants for all tcphdr flags 2023-12-25 13:18:01 +01:00
netfront xen-netfront: attempt to make cleanup idempotent 2023-11-06 11:17:40 +01:00
privcmd sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
timer xen/intr: correct misuses of Xen handle pointer type 2023-11-28 12:51:19 +01:00
xenpci xen/dev: switch to DEVMETHOD_END 2023-11-28 13:31:47 +01:00
xenstore xen/dev: remove __unused from driver argument of identify functions 2023-11-28 13:32:57 +01:00