freebsd-dev/sys/conf
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
..
config.mk
dtb.build.mk
dtb.mk
files xen/efi: make Xen PV EFI clock optional 2023-04-14 15:58:47 +02:00
files.amd64
files.arm
files.arm64
files.i386
files.powerpc
files.riscv
files.x86 xen/intr: adjust xen_intr_handle_upcall() to match driver filter 2023-04-14 15:58:52 +02:00
kern.mk Remove the riscv64sf architecture. 2023-04-12 11:09:27 -07:00
kern.opts.mk
kern.post.mk
kern.pre.mk
kmod_syms_prefix.awk
kmod_syms.awk
kmod.mk
kmod.opts.mk
ldscript.amd64
ldscript.arm
ldscript.arm64
ldscript.i386
ldscript.kmod.amd64
ldscript.kmod.i386
ldscript.powerpc
ldscript.powerpc64
ldscript.powerpc64le
ldscript.powerpcspe
ldscript.riscv
Makefile.amd64
Makefile.arm
Makefile.arm64
Makefile.i386
Makefile.powerpc
Makefile.riscv
newvers.sh
NOTES
options
options.amd64
options.arm
options.arm64
options.i386
options.powerpc
options.riscv
std.nodebug
sysent.mk
systags.sh
vdso_amd64_ia32.ldscript
vdso_amd64.ldscript
WITHOUT_SOURCELESS
WITHOUT_SOURCELESS_HOST
WITHOUT_SOURCELESS_UCODE