freebsd-dev/sys/i386/i386
Elliott Mitchell af610cabf1 xen/intr: adjust xen_intr_handle_upcall() to match driver filter
xen_intr_handle_upcall() has two interfaces.  It needs to be called by
the x86 assembly code invoked by the APIC.  Second, it needs to be called
as a driver_filter_t for the XenPCI code and for architectures besides
x86.

Unfortunately the driver_filter_t interface was implemented as a wrapper
around the x86-APIC interface.  Now create a simple wrapper for the
x86-APIC code, which calls an architecture-independent
xen_intr_handle_upcall().

When called via intr_event_handle(), driver_filter_t functions expect
preemption to be disabled.  This removes the need for
critical_enter()/critical_exit() when called this way.

The lapic_eoi() call is only needed on x86 in some cases when invoked
directly as an APIC vector handler.

Additionally driver_filter_t functions have no need to handle interrupt
counters.  The intrcnt_add() calling function was reworked to match the
current situation.  intrcnt_add() is now only called via one path.

The increment/decrement of curthread->td_intr_nesting_level had
previously been left out.  Appears this was mostly harmless, but this
was noticed during implementation and has been added.

CONFIG_X86 is a leftover from use with Linux.  While the barrier isn't
needed for FreeBSD on x86, it will be needed for FreeBSD on other
architectures.

Copyright note.  xen_intr_intrcnt_add() was introduced at 76acc41fb7
by Justin T. Gibbs.  xen_intrcnt_init() was introduced at fd036deac1
by John Baldwin.

sys/x86/xen/xen_arch_intr.c was originally created by Julien Grall in
2015 for the purpose of holding the x86 interrupt interface.  Later it
was found xen_intr_handle_upcall() was better earlier, and the x86
interrupt interface better later.  As such the filename and header list
belong to Julien Grall, but what those were created for is later.

Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D30006
2023-04-14 15:58:52 +02:00
..
apic_vector.S xen/intr: adjust xen_intr_handle_upcall() to match driver filter 2023-04-14 15:58:52 +02:00
atpic_vector.S sys: use .S for assembly language files that use the preprocessor 2022-11-02 10:29:00 -04:00
bios.c i386: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-09 14:26:43 -07:00
bioscall.S sys: use .S for assembly language files that use the preprocessor 2022-11-02 10:29:00 -04:00
bpf_jit_machdep.c malloc: delegate M_EXEC handling to dedicacted routines 2020-10-30 20:02:32 +00:00
bpf_jit_machdep.h
copyout_fast.S sys: use .S for assembly language files that use the preprocessor 2022-11-02 10:29:00 -04:00
copyout.c Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
db_disasm.c i386: ansify 2023-03-25 23:21:03 +03:00
db_interface.c
db_trace.c i386: ansify 2023-03-25 23:21:03 +03:00
elan-mmcr.c i386: clean up empty lines in .c and .h files 2020-09-01 21:19:39 +00:00
elf_machdep.c Retire sv_transtrap 2022-05-20 14:54:03 +03:00
exception.S sys: use .S for assembly language files that use the preprocessor 2022-11-02 10:29:00 -04:00
exec_machdep.c i386: do not allow userspace to set tf_trapno on sigreturn(2) 2022-08-24 22:11:57 +03:00
gdb_machdep.c x86: remove unused T_USER flag 2021-12-05 11:12:40 -04:00
genassym.c i386: Make boot loader smaller by reducing size of bootinfo 2022-09-16 09:18:57 -06:00
geode.c set_cputicker: use a bool 2022-06-23 15:15:11 -03:00
in_cksum_machdep.c i386: ansify 2023-03-25 23:21:03 +03:00
initcpu.c i386: Fix a few typos 2021-03-13 16:10:01 +01:00
io.c
k6_mem.c
locore.S sys: use .S for assembly language files that use the preprocessor 2022-11-02 10:29:00 -04:00
longrun.c
machdep.c i386: ansify 2023-03-25 23:21:03 +03:00
mem.c Add the MEM_EXTRACT_PADDR ioctl to /dev/mem. 2020-09-02 18:12:47 +00:00
minidump_machdep_base.c kerneldump: remove physical from dump routines 2022-05-13 10:43:19 -03:00
minidump_machdep_nopae.c Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
minidump_machdep_pae.c Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
minidump_machdep.c minidump: Parameterize minidumpsys() 2021-11-19 15:05:52 -04:00
mp_clock.c i386: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-09 14:26:43 -07:00
mp_machdep.c Retire broken GPROF support from the kernel 2022-11-15 14:17:10 +00:00
mpboot.S sys: use .S for assembly language files that use the preprocessor 2022-11-02 10:29:00 -04:00
npx.c amd64: Eliminate write only cpu_fxsr. 2023-02-01 18:17:06 +03:00
perfmon.c Fix some common typos in source code comments 2021-08-28 18:57:23 +02:00
pmap_base.c pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t. 2022-09-22 15:08:52 -07:00
pmap_nopae.c Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
pmap_pae.c Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
pmap.c Add vm_page_any_valid() 2022-10-19 20:24:07 +03:00
ptrace_machdep.c x86: Add a NT_X86_SEGBASES register set. 2022-03-24 11:36:19 -07:00
sigtramp.S sys: use .S for assembly language files that use the preprocessor 2022-11-02 10:29:00 -04:00
support.S sys: use .S for assembly language files that use the preprocessor 2022-11-02 10:29:00 -04:00
swtch.S sys: use .S for assembly language files that use the preprocessor 2022-11-02 10:29:00 -04:00
sys_machdep.c i386: ansify 2023-03-25 23:21:03 +03:00
trap.c Complete removal of opt_compat.h 2023-02-13 19:07:38 +03:00
uio_machdep.c
vm86.c i386: clean up empty lines in .c and .h files 2020-09-01 21:19:39 +00:00
vm86bios.S sys: use .S for assembly language files that use the preprocessor 2022-11-02 10:29:00 -04:00
vm_machdep.c Remove dead code. 2022-04-26 19:40:59 +03:00