opnsense-src/sys/dev/xen
Roger Pau Monné dfde5dff70 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>
2025-07-09 10:05:48 +02:00
..
balloon sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
blkback xen/blk{front,back}: fix usage of sector sizes different than 512b 2024-10-15 10:12:19 +02:00
blkfront xen/blk{front,back}: fix usage of sector sizes different than 512b 2024-10-15 10:12:19 +02:00
bus x86/xen: fix accounted interrupt time 2025-07-09 10:05:48 +02:00
console sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
control xen: improve shutdown hook 2023-12-08 18:02:44 -04: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: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
evtchn sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
gntdev gntdev: Handle errors from suword32() in gntdev_alloc_gref() 2024-01-01 19:29:56 -05:00
grant_table xen: fix initialization of grant table frame array 2024-10-11 09:06:13 +02:00
netback sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
netfront xen-netfront: attempt to make cleanup idempotent 2024-10-11 09:06:25 +02:00
privcmd sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
timer sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
xenpci sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
xenstore sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00