Home | History | Annotate | Download | only in kern
History log of /src/sys/kern/compat_stub.c
RevisionDateAuthorComments
 1.23  09-Dec-2023  pgoyette Modularize the COMPAT_90 code that resulted from the removal of
netinet6/nd6 from the kernel. Now, the minimal compat code can
be successfully loaded and unloaded along with the rest of the
COMPAT_90 code.

XXX pullup-10 - hopefully before RC2
 1.22  09-Aug-2021  andvar branches: 1.22.4;
fix various typos in compatibility, mainly in comments.
 1.21  01-Nov-2020  pgoyette Separate the compat_netbsd32_coredump from the compat_netbsd32 and
coredump modules, into its own module.

Welcome to 7.99.75 !!!
 1.20  19-Oct-2020  christos branches: 1.20.2;
Arrange so that no options COREDUMP and no options PTRACE work together.
Thanks to Paul Goyette for testing.
 1.19  20-Nov-2019  pgoyette Move all non-emulation-specific coredump code into the coredump module,
and remove all #ifdef COREDUMP conditional compilation. Now, the
coredump module is completely separated from the emulation modules, and
they can all be independently loaded and unloaded.

Welcome to 9.99.18 !
 1.18  16-Nov-2019  pgoyette Remove some XXX'd comments that were remnants of when I was working
on the [pgoyette-compat] code.

NFC
 1.17  10-Nov-2019  pgoyette Convert the coredump_vec modular function pointer to use the new
compat_hook mechanism.

XXX Should be pulled up to -9 despite the kernel <--> module ABI
XXX change.
 1.16  10-Nov-2019  pgoyette Convert the sendsig_sigcontext_16 function pointer to use the new
compat_hook mechanism.

XXX Despite being a kernel<-->module abi change, this should be
XXX pulled up to -9
 1.15  20-Jul-2019  christos branches: 1.15.2;
add a register validation hook for ptrace on netbsd32 to be used for
64 -> 32 debugging.
 1.14  16-Jul-2019  pgoyette Move the assignment of SCTP-specific function hooks/pointers.

Without this, a rumpkernel (appropriately modified) built with SCTP
enabled will try to assign the function pointers, but the targets
are only available in rumpnet. We cannot link the rumpkernel against
rumpnet because rumpnet is already linked against rumpkernel and we
would end up with a circular dependency.

As reported in private Email by rjs@
 1.13  25-Jun-2019  rjs Split out the prototypes for add/delete address into a separate header file.
 1.12  17-May-2019  msaitoh branches: 1.12.2;
The max subtype of the ifmedia word is 31. It's too small for Ethernet now.
We currently use use it up to 30. We should extend the limit to be able to use
more than 10Gbps speeds. Our ifmedia(4) is inconvenience and have some problem
so we should redesign the interface, but it's too late for netbsd-9 to do it.
So, we keep the data structure size and modify the structure a bit. The
strategy is almost the same as FreeBSD. Many bits of IFM_OMASK for Ethernet
have not used, so use some of them for Ethernet's subtype.

The differences against FreeBSD are:
- We use NetBSD style compat code (i.e. no SIOCGIFXMEDIA).
- FreeBSD's IFM_ETH_XTYPE's bit location is from 11 to "14" even though
IFM_OMASK is from 8 to "15". We use _IFM_ETH_XTMASK from bit 13 to "15".
- FreeBSD changed the meaning of IFM_TYPE_MATCH(). I think we should
not do it. We keep it not changing and added new IFM_TYPE_SUBTYPE_MATCH()
macro for matching both TYPE and SUBTYPE.
- Added up to 400GBASE-SR16.

New layout of the media word is as follows (from ifmedia_h):

* if_media Options word:
* Bits Use
* ---- -------
* 0-4 Media subtype MAX SUBTYPE == 255 for ETH and 31 for others
* 5-7 Media type
* 8-15 Type specific options
* 16-18 Mode (for multi-mode devices)
* 19 (Reserved for Future Use)
* 20-27 Shared (global) options
* 28-31 Instance
*
* 3 2 1
* 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
* +-------+---------------+-+-----+---------------+-----+---------+
* | | |R| | | | |
* | IMASK | GMASK |F|MMASK+-----+ OMASK |NMASK| TMASK |
* | | |U| |XTMSK| | | |
* +-------+---------------+-+-----+-----+---------+-----+---------+
* <-----> <---> <--->
* IFM_INST() IFM_MODE() IFM_TYPE()
*
* IFM_SUBTYPE(other than ETH)<------->
*
* <---> IFM_SUBTYPE(ETH)<------->
*
*
* <-------------> <------------->
* IFM_OPTIONS()
 1.11  29-Apr-2019  roy Introduce rt_addrmsg_src which adds RTA_AUTHOR to the message.
Use this when we notify userland of a duplicate address
and set RTA_AUTHOR to the hardware address of the sender.

While here, match the logging diagnostic of INET6 to the simpler one
of INET so it's consistent.
 1.10  29-Apr-2019  roy rtsock: Route address message simplification

Rename rt_newaddrmsg to rt_addrmsg_rt.
Add rt_addrmsg which drops the error and route arguments which are only
needed by one caller.
 1.9  15-Apr-2019  pgoyette Split the COMPAT_50 socket-timeout stuff out of kern/uipc_socket.c
and into its own source file, which is now included in the compat_50
module.

(Not sure how this got missed during the original [pgoyette-compat] work)
 1.8  05-Feb-2019  christos - Redo all the ioctl compat stuff to use a standard "ioctl" interface,
and provide methods to the private softc
- Provide a function for constructing a RF_Raid_t from an RF_Config_t
- Factor out the big inline ioctl code into functions
 1.7  03-Feb-2019  pgoyette Don't include the raidframe compat code in the main raid module, the
compat code lives in their own compat_raid_xx modules, which will now
be autoloaded if needed.

While here, extract the compat_netbsd32_raid code into its own module,
too.

Welcome to 8.99.34
 1.6  29-Jan-2019  pgoyette Normalize all the compat hooks' names to the form

<subsystem>_<function>_<version>_hook

NFCI

XXX Note that although this introduces a change in the kernel-to-
XXX module interface, we are NOT bumping the kernel version number.
XXX We will bump the version number once the interface stabilizes.
 1.5  29-Jan-2019  pgoyette Rename the if43_20_hook to if43_cvtcmd_20_hook
 1.4  28-Jan-2019  christos - Don't expose random data conversion functions, but expose the high level
entry point (such as ioctl) instead.
- Attempt to autoload the module before using it.

Naming: Should the names of the hooks be:
<category>_<version>_<function>_hook_t
or:
<category>_<function>_<version>_hook_t

We should make those consistent.
 1.3  28-Jan-2019  christos - provide a hook for the 43 tty ioctls
- make the 60 tty ioctl hook look the same
- fix the tty code to call both hooks and remove unused lock
 1.2  27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.1  20-Mar-2018  pgoyette branches: 1.1.2;
file compat_stub.c was initially added on branch pgoyette-compat.
 1.1.2.42  25-Jan-2019  pgoyette Move the netbsd32_machine32_hook into the main kernel with most of
the other hooks.

Although this hook might better belong in compat/netbsd32/ code,
there are some machines without a netbsd32 module (for example, i386
and sgimips) which still have consumers/users of this hook. :(
 1.1.2.41  24-Jan-2019  pgoyette Rework placement of the new netbsd32_machine32_hook
 1.1.2.40  24-Jan-2019  pgoyette Replace weak symbol definition for machine32 with a hook. Our in-kernel
linker doesn't handle weak symbols, so this prevented us from loading the
compat_linux32 module.

XXX There don't seem to be any other consumers of machine32 (nor does
XXX there seem to be any consumers of machine_arch32), even though it
XXX is defined for aarch64, arm32, and riscv).
 1.1.2.39  15-Jan-2019  pgoyette Add a comment for the SCTP section, as was done for the NTP section
 1.1.2.38  15-Jan-2019  pgoyette Add missing # to fix the non-SCTP case.
 1.1.2.37  15-Jan-2019  pgoyette Include appropriate headers to define the sctp routines
 1.1.2.36  15-Jan-2019  pgoyette Add vectors for sctp_{add,delete}_ipaddr() so we can check them
in rtsock.c rather than depending on the SCTP kernel compile
option. This is similar to what was done previously with NTP.
 1.1.2.35  13-Jan-2019  pgoyette Add the required hooks for rtsock_50 and modify the COMPATCALL() macro
to use the hooks. While the rtsock_50 situation is still sub-optimal
(it includes the main rtsock.c with a whole bunch of function and
variable redefinitions via macros), this at least makes it possible to
load the rtsock_50 code separately from more recent code, rather than
the previous requirement that rtsock_50 be built-in.
 1.1.2.34  13-Jan-2019  pgoyette Remove the HOOK2 versions of the MODULE_HOOK macros. There were
only a few uses, and using them led to some lack of clarity in the
code. Instead, we now use two separate hooks, with names that
make it clear(er) what we're doing.

This also positions us to start unraveling some of the rtsock_50
mess, which will need (at least) five hooks.
 1.1.2.33  11-Jan-2019  pgoyette Rework the various sysctl-related routines to call the correct code
for each version. While here, extract the 5.0 specific code instead
of including in the main rtsock.c code.

Also, clean up all the sysctl-related routines to prevent building
more than one copy, no matter how many places rtsock.c gets #include'd
into!
 1.1.2.32  15-Oct-2018  pgoyette Convert the final non-MP-safe "vectored" compat routine to use the
MP-safe mechanism.
 1.1.2.31  15-Oct-2018  pgoyette Convert the compat70_unp_addsockcred hook to the MP-safe mechanism.

XXX One more remaining: sysvipc50_sysctl
 1.1.2.30  15-Oct-2018  pgoyette Convert the openat_10 hook to use the MP-safe mechanism

XXX Still to do: compat70_unp_addsockcred and sysvipc50_sysctl
 1.1.2.29  15-Oct-2018  pgoyette Convert another hook to the MP-sfe mechanism.

XXX still have three more to convert: openat_10, sysvipc50_sysctl and
XXX compat70_unp_addsockcred
 1.1.2.28  15-Oct-2018  pgoyette Convert a couple more hooks to the MP-safe mechanism.

While here, clean up some headers and remove any that are now empty.
 1.1.2.27  12-Oct-2018  pgoyette Use a MP-safe hook for the rnd_ioctl compat_50 calls.
 1.1.2.26  02-Oct-2018  pgoyette Use a hook callback to allow sparc fpu code to determine if a process
is running under sunos emulation (in which case, fpu cleanup uses a
different set of fpu_codes[]).
 1.1.2.25  25-Sep-2018  pgoyette Additional use of NTP function pointers, since the NTP code might not
exist in the kernel. (NTP is not (yet) a module, so we don't need to
use the MP-safe mechanism.)
 1.1.2.24  23-Sep-2018  pgoyette Actually allocate/define the kern_proc_32 hook
 1.1.2.23  21-Sep-2018  pgoyette Adapt the ieee80211_20 code to the new MP-safe mechanism
 1.1.2.22  21-Sep-2018  pgoyette Clean-up some pre-existing function-pointer code (related to if_43)
to use the new MP-safe mechanism.
 1.1.2.21  20-Sep-2018  pgoyette Use the MP-safe hooks mechanism for the uipc_syscalls_40 and _50
routines.
 1.1.2.20  19-Sep-2018  pgoyette Split out the vnd COMPAT_50 code
 1.1.2.19  18-Sep-2018  pgoyette Split the COMPAT_CALL_HOOK to separate the declaration from the
implementation. Some hooks are called from multiple source files,
and the old method resulted in duplicate implementations.

Implement MP-safe hooks for the usb_subr_30 code. Pass the helper
functions as arguments to the compat code so it does not have to
determine if the kernel contains usb code.
 1.1.2.18  17-Sep-2018  pgoyette Adapt (most of) the indirect function pointers to the new MP-safe
mechanism. Still remaining are the compat_netbsd32 stuff, and
some usb subroutines.
 1.1.2.17  16-Sep-2018  pgoyette Yay - we got the ccd_ioctl_60 stuff to build!

Now we can use that as a template for cleaning up all the others.
 1.1.2.16  15-Sep-2018  pgoyette Prepare for adding MP-safe stuff.

While here, move some header #includes
 1.1.2.15  17-Apr-2018  pgoyette Finish separating the compat_09 and compat_43 stuff
 1.1.2.14  03-Apr-2018  pgoyette Remove fixed allocation of modules' "required" lists (previously
limited to MAXMODDEPS entries). Update the modctl(MODCTL_STAT)
syscall to return the required data in a new format, and retain
the previous data format in MODCTL_OSTAT. Update the compat_80
and compat_netbsd32 modules as needed.
 1.1.2.13  30-Mar-2018  pgoyette Extract compat_14 stuff into its own module
 1.1.2.12  30-Mar-2018  pgoyette Create and build the compat_20 module
 1.1.2.11  29-Mar-2018  pgoyette Split out the usb compat_30 code and add it to the module
 1.1.2.10  28-Mar-2018  pgoyette Split vnd compat_30 code out of the main driver and into the compat_30
module
 1.1.2.9  28-Mar-2018  pgoyette Initial pass at a compat_30 module.

Still needs some work for dev/vnd and various dev/usb/*
 1.1.2.8  27-Mar-2018  pgoyette Create a compat_40 module
 1.1.2.7  24-Mar-2018  pgoyette Move the compat_50-specific code out of wscons/wsevent.c into its own
source file, which is now part of the compat_50 module.
 1.1.2.6  24-Mar-2018  pgoyette Add fs/puffs compat_50 to the modules
 1.1.2.5  24-Mar-2018  pgoyette Separate the compat_50 and compat_80 dispatching code from the main
body of raidframe, and place into the appropriate compat modules.

Enable building of the compat_80 module.
 1.1.2.4  23-Mar-2018  pgoyette Handle the compat_50 stuff for opencrypto/cryptodev
 1.1.2.3  21-Mar-2018  pgoyette Move if_spppsubr compat code into the compat50 module.

More prep work for compat80 module (for raidframe)
 1.1.2.2  21-Mar-2018  pgoyette Split the compat_50 code out from the dev/clockctl driver and include
it in the compat_50 and compat modules.
 1.1.2.1  20-Mar-2018  pgoyette Initial implementation of sys/kern/kern_stup.c as discussed on tech-kern

For now, we only handle the dev/ccd and NTP needs; more to follow.
 1.12.2.3  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.12.2.2  10-Jun-2019  christos Sync with HEAD
 1.12.2.1  17-May-2019  christos file compat_stub.c was added on branch phil-wifi on 2019-06-10 22:09:02 +0000
 1.15.2.1  11-Nov-2019  martin Pull up following revision(s) (requested by pgoyette in ticket #413):

sys/kern/kern_core.c: revision 1.27 (patch)
sys/kern/kern_sig.c: revision 1.377 (patch)
sys/kern/kern_sig.c: revision 1.378 (patch)
sys/kern/sys_sig.c: revision 1.50
sys/kern/sys_ptrace_common.c: revision 1.70
sys/kern/compat_stub.c: revision 1.16
sys/compat/common/kern_sig_16.c: revision 1.4
sys/kern/compat_stub.c: revision 1.17
sys/sys/compat_stub.h: revision 1.20
sys/sys/signalvar.h: revision 1.98
sys/sys/compat_stub.h: revision 1.21
sys/sys/signalvar.h: revision 1.99

Convert the sendsig_sigcontext_16 function pointer to use the new
compat_hook mechanism.
XXX Despite being a kernel<-->module abi change, this should be
XXX pulled up to -9

-

Convert the coredump_vec modular function pointer to use the new
compat_hook mechanism.
XXX Should be pulled up to -9 despite the kernel <--> module ABI
XXX change.
 1.20.2.1  14-Dec-2020  thorpej Sync w/ HEAD.
 1.22.4.1  10-Dec-2023  martin Pull up following revision(s) (requested by pgoyette in ticket #487):

sys/compat/common/compat_90_mod.c: revision 1.5
sys/compat/common/compat_90_mod.c: revision 1.6
sys/netinet6/in6.c: revision 1.290
sys/netinet6/in6.c: revision 1.291
sys/compat/common/files.common: revision 1.11
sys/netinet6/icmp6.c: revision 1.255
sys/compat/common/net_inet6_nd_90.c: revision 1.1
sys/compat/common/net_inet6_nd_90.c: revision 1.2
sys/modules/compat_90/Makefile: revision 1.2
sys/modules/compat_90/Makefile: revision 1.3
sys/netinet6/nd6.c: revision 1.281
sys/compat/common/compat_mod.h: revision 1.10
sys/kern/compat_stub.c: revision 1.23
sys/sys/compat_stub.h: revision 1.27

Identify the need to rework the COMPAT_* code to be more
module-aware.
This is an XXX comment block only, NFCI.

Modularize the COMPAT_90 code that resulted from the removal of
netinet6/nd6 from the kernel. Now, the minimal compat code can
be successfully loaded and unloaded along with the rest of the
COMPAT_90 code.

Allow kernels builds which don't define INET6 to compile compat bits
too.

Default the build of compat_90 module to include IPv6, as is done
for other INET6-sensitive modules (see if_lagg).

RSS XML Feed