freebsd-dev/sys
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
..
amd64 xen/intr: adjust xen_intr_handle_upcall() to match driver filter 2023-04-14 15:58:52 +02:00
arm arm: Remove a double word in a comment in setjmp 2023-04-13 20:37:25 +02:00
arm64 Create pmap_mask_set_locked on arm64 2023-04-12 13:10:13 +01:00
bsm
cam cam iosched: Use the existing CTLFLAG_RDTUN and CTLFLAG_RWTUN flag definitions 2023-04-12 12:20:38 +08:00
cddl dtrace: handle NOP instructions in the riscv invop handler 2023-04-10 12:14:11 -04:00
compat linux(4): Implement close_range over native 2023-04-04 23:24:04 +03:00
conf xen/intr: adjust xen_intr_handle_upcall() to match driver filter 2023-04-14 15:58:52 +02:00
contrib zfs: Appease set by unused warnings for spl_fstrans_*mark stubs. 2023-04-10 10:36:14 -07:00
crypto OpenSSL: Regen an assembly file for arm 2023-03-21 15:13:51 -04:00
ddb ddb: ansify 2023-02-08 00:09:23 +00:00
dev xen/intr: adjust xen_intr_handle_upcall() to match driver filter 2023-04-14 15:58:52 +02:00
dts
fs tarfs: Use the existing CTLFLAG_RWTUN flag definition 2023-04-12 12:20:38 +08:00
gdb
geom Implement GEOM::rotation_rate for gmirror 2023-04-10 10:27:10 -06:00
gnu
i386 xen/intr: adjust xen_intr_handle_upcall() to match driver filter 2023-04-14 15:58:52 +02:00
isa
kern kern: remove a double word in a KASSERT in subr_trap 2023-04-13 20:03:37 +02:00
kgssapi nfsd: Enable the NFSD_VNET vnet front end macros 2023-02-18 14:59:36 -08:00
libkern
modules imgact_binmisc: unbreak module build outside of kernel build environment 2023-04-11 17:32:29 +07:00
net bridge: distinguish no vlan and vlan 1 2023-04-14 13:17:02 +02:00
net80211 net80211: fail for unicast traffic without unicast key 2023-04-10 23:38:57 +00:00
netgraph ng_atmllc: remove 2023-03-09 18:04:21 +00:00
netinet tcp: rack pacing has some caveats that need to be obeyed when LRO is missing 2023-04-14 09:33:36 -04:00
netinet6 inet6: protect address manipulation with a lock 2023-03-30 08:46:38 +00:00
netipsec ipsec: only update lastused when it changes 2023-02-16 07:33:51 +00:00
netlink netlink: improve source ifa selection algorithm when adding routes. 2023-04-09 13:33:22 +00:00
netpfil pf: backport OpenBSD syntax of "scrub" option for "match" and "pass" rules 2023-04-14 09:04:06 +02:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed infiniband: Opt-in for net epoch 2023-04-06 00:08:23 +08:00
opencrypto Complete removal of opt_compat.h 2023-02-13 19:07:38 +03:00
powerpc powerpc: Use the existing CTLFLAG_RDTUN and CTLFLAG_RWTUN flag definitions 2023-04-12 12:20:38 +08:00
riscv Remove the riscv64sf architecture. 2023-04-12 11:09:27 -07:00
rpc svc_rpcsec_gss.c: Separate out the non-vnet initialization 2023-03-01 15:29:25 -08:00
security kdb: Modify securelevel policy 2023-03-30 10:45:00 -04:00
sys Add witness_is_owned(9) 2023-04-11 15:59:49 +03:00
teken
tests
tools vfs: validate that vop vectors provide all or none fplookup vops 2023-04-06 15:20:41 +00:00
ufs vn_lock_pair(): allow to request shared locking 2023-04-08 01:58:26 +03:00
vm vnode_pager_input: return runningbufspace back 2023-03-26 00:55:29 +02:00
x86 xen/intr: adjust xen_intr_handle_upcall() to match driver filter 2023-04-14 15:58:52 +02:00
xdr xdr: ansify 2023-02-13 18:37:31 +00:00
xen xen/intr: adjust xen_intr_handle_upcall() to match driver filter 2023-04-14 15:58:52 +02:00
Makefile
README.md note that some arch independent code can live in dev (e.g. SMBios) 2023-03-03 01:54:07 -08:00

FreeBSD Kernel Source:

This directory contains the source files and build glue that make up the FreeBSD kernel and its modules, including both original and contributed software.

Kernel configuration files are located in the conf/ subdirectory of each architecture. GENERIC is the configuration used in release builds. NOTES contains documentation of all possible entries. LINT is a compile-only configuration used to maximize build coverage and detect regressions.

Source Roadmap:

Directory Description
amd64 AMD64 (64-bit x86) architecture support
arm 32-bit ARM architecture support
arm64 64-bit ARM (AArch64) architecture support
cam Common Access Method storage subsystem - cam(4) and ctl(4)
cddl CDDL-licensed optional sources such as DTrace
conf kernel build glue
compat Linux compatibility layer, FreeBSD 32-bit compatibility
contrib 3rd-party imported software such as OpenZFS
crypto crypto drivers
ddb interactive kernel debugger - ddb(4)
fs most filesystems, excluding UFS, NFS, and ZFS
dev device drivers and other arch independent code
gdb kernel remote GDB stub - gdb(4)
geom GEOM framework - geom(4)
i386 i386 (32-bit x86) architecture support
kern main part of the kernel
libkern libc-like and other support functions for kernel use
modules kernel module infrastructure
net core networking code
net80211 wireless networking (IEEE 802.11) - net80211(4)
netgraph graph-based networking subsystem - netgraph(4)
netinet IPv4 protocol implementation - inet(4)
netinet6 IPv6 protocol implementation - inet6(4)
netipsec IPsec protocol implementation - ipsec(4)
netpfil packet filters - ipfw(4), pf(4), and ipfilter(4)
opencrypto OpenCrypto framework - crypto(7)
powerpc PowerPC/POWER (32 and 64-bit) architecture support
riscv 64-bit RISC-V architecture support
security security facilities - audit(4) and mac(4)
sys kernel headers
tests kernel unit tests
ufs Unix File System - ffs(7)
vm virtual memory system
x86 code shared by AMD64 and i386 architectures