COMPAT_FREEBSD<ancient>
- Reply: Konstantin Belousov : "Re: COMPAT_FREEBSD<ancient>"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 16 Sep 2025 12:36:11 UTC
Greetings, A couple of months ago I was looking through some random kernel code and I noticed COMPAT_FREEBSD4 and friends. I was curious how much code was behind those so I whipped up a couple of quick and dirty patches to remove COMPAT_FREEBSD4 and COMPAT_43. The answer is about 1300 and 1800 loc, respectively. Which brings up a question - at what point does it make sense to remove some of this code? IIUC, this code falls well outside the current policy around ABI compatibility. So the only thing that the removal of these compat layers should affect is source compatibility, but since this compat code is about syscalls (at least according to sys/conf/NOTES) any code still using these interfaces would have to explicitly invoke these compat syscalls and not their new replacements. IOW, this should be a vanishingly small number of programs. (As an additional data point, on amd64 GENERIC defines all of them but MINIMAL starts with COMPAT_FREEBSD10.) I'm happy to clean up my diffs and get them into 16.0-CURRENT if there is interest. Thanks, Jeff. --- In case anyone is curious, here are the diffstats for the two removals: COMPAT_43 sys/amd64/amd64/exec_machdep.c | 9 - sys/amd64/ia32/ia32_signal.c | 166 ---------------- sys/amd64/ia32/ia32_sigtramp.S | 16 - sys/amd64/ia32/ia32_syscall.c | 60 ------ sys/arm/arm/exec_machdep.c | 3 - sys/arm64/arm64/exec_machdep.c | 3 - sys/arm64/arm64/freebsd32_machdep.c | 15 - sys/arm64/linux/linux_sysvec.c | 3 - sys/compat/freebsd32/freebsd32_misc.c | 281 ---------------------------- sys/compat/freebsd32/freebsd32_sysent.c | 4 - sys/compat/ia32/ia32_genassym.c | 3 - sys/i386/i386/exec_machdep.c | 284 ----------------------------- sys/i386/i386/genassym.c | 9 - sys/i386/i386/machdep.c | 25 -- sys/i386/i386/sigtramp.S | 42 ---- sys/i386/i386/trap.c | 28 -- sys/kern/init_sysent.c | 4 - sys/kern/kern_descrip.c | 26 -- sys/kern/kern_exit.c | 15 - sys/kern/kern_prot.c | 13 - sys/kern/kern_resource.c | 54 ----- sys/kern/kern_sig.c | 261 +-------------------------- sys/kern/kern_xxx.c | 251 ------------------------- sys/kern/sys_generic.c | 14 - sys/kern/uipc_syscalls.c | 6 - sys/kern/vfs_syscalls.c | 190 ------------------- sys/vm/vm_mmap.c | 78 ------- 27 files changed, 2 insertions(+), 1861 deletions(-) COMPAT_FREEBSD4 sys/amd64/amd64/exec_machdep.c | 8 - sys/amd64/conf/FIRECRACKER | 4 + sys/amd64/conf/GENERIC | 1 - sys/amd64/conf/MINIMAL | 4 + sys/amd64/ia32/ia32_signal.c | 188 ------------------------ sys/amd64/ia32/ia32_sigtramp.S | 12 - sys/arm/arm/machdep.c | 2 +- sys/arm/conf/NOTES | 1 - sys/arm64/conf/NOTES | 1 - sys/compat/freebsd32/freebsd32_ipc.h | 2 +- sys/compat/freebsd32/freebsd32_misc.c | 172 +--------------------- sys/compat/freebsd32/freebsd32_proto.h | 48 ------ sys/compat/freebsd32/freebsd32_sysent.c | 4 - sys/compat/ia32/ia32_genassym.c | 7 - sys/compat/ia32/ia32_sysvec.c | 5 - sys/conf/NOTES | 3 - sys/conf/options | 1 - sys/dev/atkbdc/atkbd.c | 10 +- sys/dev/gpio/gpiokeys.c | 10 +- sys/dev/hid/hkbd.c | 10 +- sys/dev/hyperv/input/hv_kbd.c | 8 +- sys/dev/pci/pci_user.c | 10 +- sys/dev/syscons/scvidctl.c | 8 +- sys/dev/syscons/syscons.c | 22 +- sys/dev/usb/input/ukbd.c | 10 +- sys/dev/vt/vt_core.c | 2 +- sys/i386/conf/GENERIC | 1 - sys/i386/conf/MINIMAL | 4 + sys/i386/i386/exec_machdep.c | 226 ----------------------------- sys/i386/i386/genassym.c | 7 - sys/i386/i386/sigtramp.S | 22 -- sys/i386/include/md_var.h | 3 - sys/i386/include/sigframe.h | 16 -- sys/i386/include/ucontext.h | 35 ---- sys/kern/init_sysent.c | 4 - sys/kern/kern_mib.c | 3 - sys/kern/kern_sendfile.c | 30 --- sys/kern/kern_sig.c | 36 ---- sys/kern/kern_xxx.c | 129 ---------------- sys/kern/sys_generic.c | 2 +- sys/kern/syscalls.master | 76 +-------- sys/kern/sysv_ipc.c | 4 +- sys/kern/sysv_msg.c | 12 +- sys/kern/sysv_sem.c | 10 +- sys/kern/sysv_shm.c | 18 +- sys/kern/vfs_bio.c | 2 +- sys/kern/vfs_syscalls.c | 159 -------------------- sys/kern/vfs_vnops.c | 2 +- sys/net/if_tuntap.c | 3 +- sys/powerpc/powerpc/exec_machdep.c | 8 - sys/riscv/conf/NOTES | 1 - sys/sys/fcntl.h | 2 +- sys/sys/ioccom.h | 2 +- sys/sys/ipc.h | 4 +- sys/sys/msg.h | 2 +- sys/sys/sem.h | 4 +- sys/sys/shm.h | 2 +- sys/sys/sysproto.h | 61 ------- tools/tools/nanobsd/pcengines/ALIX_DSK | 1 - 59 files changed, 102 insertions(+), 1342 deletions(-)