git: 5833253dad65 - stable/13 - linux(4): Get rid of Linuxulator kernel build options.

From: Dmitry Chagin <dchagin_at_FreeBSD.org>
Date: Fri, 17 Jun 2022 19:32:07 UTC
The branch stable/13 has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=5833253dad65184610ef689fc63f4ad69c978011

commit 5833253dad65184610ef689fc63f4ad69c978011
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-06-17 19:30:22 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-06-17 19:30:22 +0000

    linux(4): Get rid of Linuxulator kernel build options.
    
    Stop confusing people, retire COMPAT_LINUX and COMPAT_LINUX32 kernel
    build options. Since we have 32 and 64 bit Linux emulators, we can't build both
    emulators together into the kernel. I don't think it matters, Linux emulation
    depends on loadable modules (via rc).
    
    Cut LINPROCFS and LINSYSFS for consistency.
    
    PR:                     215061
    Reviewed by:            bcr (manpages), trasz
    Differential Revision:  https://reviews.freebsd.org/D30751
    MFC after:              2 weeks
    
    (cherry picked from commit e013e36939ac87b53195370fb5e29f29c1a4b5c6)
---
 share/man/man4/aac.4     |  4 +---
 share/man/man4/aacraid.4 |  4 +---
 share/man/man4/tdfx.4    | 13 ++++++----
 sys/amd64/conf/NOTES     | 17 -------------
 sys/conf/NOTES           |  4 ++--
 sys/conf/files           |  5 ----
 sys/conf/files.amd64     | 62 ------------------------------------------------
 sys/conf/files.i386      | 57 --------------------------------------------
 sys/conf/files.x86       |  1 -
 sys/conf/options.amd64   |  2 +-
 sys/i386/conf/NOTES      | 16 ++-----------
 11 files changed, 16 insertions(+), 169 deletions(-)

diff --git a/share/man/man4/aac.4 b/share/man/man4/aac.4
index e0ffcaa5407d..eec5bc1671ca 100644
--- a/share/man/man4/aac.4
+++ b/share/man/man4/aac.4
@@ -75,9 +75,7 @@ and
 .Pa /dev/hpn?
 exist for compatibility with the Dell and HP versions of management tools,
 respectively.
-If the kernel is compiled with the
-.Dv COMPAT_LINUX
-option, or the
+If the
 .Pa aac_linux.ko
 and
 .Pa linux.ko
diff --git a/share/man/man4/aacraid.4 b/share/man/man4/aacraid.4
index 91725911602b..3f2e023a7a00 100644
--- a/share/man/man4/aacraid.4
+++ b/share/man/man4/aacraid.4
@@ -70,9 +70,7 @@ The
 .Pa /dev/aacraid?
 device nodes provide access to the management interface of the controller.
 One node exists per installed card.
-If the kernel is compiled with the
-.Dv COMPAT_LINUX
-option, or the
+If the
 .Pa aacraid_linux.ko
 and
 .Pa linux.ko
diff --git a/share/man/man4/tdfx.4 b/share/man/man4/tdfx.4
index 2a09a71cf6ce..76dbdd3d2f29 100644
--- a/share/man/man4/tdfx.4
+++ b/share/man/man4/tdfx.4
@@ -9,7 +9,6 @@
 .Nd Voodoo Graphics and VoodooII Memory Access GLIDE device driver
 .Sh SYNOPSIS
 .Cd device tdfx
-.Cd device tdfx_linux
 .Sh DESCRIPTION
 This driver creates an entry in
 .Pa /dev
@@ -50,9 +49,11 @@ It also does not currently support the Voodoo Rush.
 It also does not yet handle the SLI feature of the Voodoo II boards.
 You can only use each of them separately.
 .Pp
-By including
-.Nm tdfx_linux ,
-you can enable the linux ioctl code for this driver, where the only supported
+By loading the
+.Nm tdfx_linux.ko
+and
+.Nm linux.ko
+modules, you can enable the linux ioctl code for this driver, where the only supported
 applications currently reside.
 .Sh FILES
 .Bl -tag -width /dev/voodoo* -compact
@@ -70,6 +71,10 @@ Mirrors of above interfaces
 (Some apps use
 .Pa /dev/voodoo )
 .El
+.Sh SEE ALSO
+.Xr kld 4 ,
+.Xr linux 4 ,
+.Xr kldload 8
 .Sh HISTORY
 The
 .Nm
diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES
index d85d11d1e5d2..2bc84675f7ce 100644
--- a/sys/amd64/conf/NOTES
+++ b/sys/amd64/conf/NOTES
@@ -261,11 +261,8 @@ device		s3pci
 # linked to /dev/3dfx and /dev/voodoo.  Note that this is not the same as
 # the tdfx DRI module from XFree86 and is completely unrelated.
 #
-# To enable Linuxulator support, one must also include COMPAT_LINUX in the
-# config as well.  The other option is to load both as modules.
 
 device		tdfx			# Enable 3Dfx Voodoo support
-#XXX#device 	tdfx_linux		# Enable Linuxulator support
 
 #
 # ACPI support using the Intel ACPI Component Architecture reference
@@ -637,20 +634,6 @@ options 	COMPAT_CLOUDABI32
 # Enable 64-bit runtime support for CloudABI binaries.
 options 	COMPAT_CLOUDABI64
 
-# Enable Linux ABI emulation
-#XXX#options 	COMPAT_LINUX
-
-# Enable 32-bit Linux ABI emulation (requires COMPAT_FREEBSD32).
-options 	COMPAT_LINUX32
-
-# Enable the linux-like proc filesystem support (requires COMPAT_LINUX32
-# and PSEUDOFS)
-options 	LINPROCFS
-
-#Enable the linux-like sys filesystem support (requires COMPAT_LINUX32
-# and PSEUDOFS)
-options 	LINSYSFS
-
 #####################################################################
 # ZFS support
 
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index f3901e6ba40f..9c4aca472a17 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -1330,8 +1330,8 @@ envvar		hint.sa.1.target="6"
 # The pt driver drives SCSI Processor devices.
 #
 # The sg driver provides a passthrough API that is compatible with the
-# Linux SG driver.  It will work in conjunction with the COMPAT_LINUX
-# option to run linux SG apps.  It can also stand on its own and provide
+# Linux SG driver.  It will work in conjunction with the Linuxulator
+# to run linux SG apps.  It can also stand on its own and provide
 # source level API compatibility for porting apps to FreeBSD.
 #
 # Target Mode support is provided here but also requires that a SIM
diff --git a/sys/conf/files b/sys/conf/files
index fb999001b222..7fc99a929947 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -786,12 +786,10 @@ dev/aac/aac.c			optional aac
 dev/aac/aac_cam.c		optional aacp aac
 dev/aac/aac_debug.c		optional aac
 dev/aac/aac_disk.c		optional aac
-dev/aac/aac_linux.c		optional aac compat_linux
 dev/aac/aac_pci.c		optional aac pci
 dev/aacraid/aacraid.c		optional aacraid
 dev/aacraid/aacraid_cam.c	optional aacraid scbus
 dev/aacraid/aacraid_debug.c	optional aacraid
-dev/aacraid/aacraid_linux.c	optional aacraid compat_linux
 dev/aacraid/aacraid_pci.c	optional aacraid pci
 dev/acpi_support/acpi_wmi.c	optional acpi_wmi acpi
 dev/acpi_support/acpi_asus.c	optional acpi_asus acpi
@@ -914,7 +912,6 @@ dev/amdsmb/amdsmb.c		optional amdsmb pci
 dev/amr/amr.c			optional amr
 dev/amr/amr_cam.c		optional amrp amr
 dev/amr/amr_disk.c		optional amr
-dev/amr/amr_linux.c		optional amr compat_linux
 dev/amr/amr_pci.c		optional amr pci
 dev/an/if_an.c			optional an
 dev/an/if_an_isa.c		optional an isa
@@ -2438,7 +2435,6 @@ dev/mfi/mfi_pci.c		optional mfi pci
 dev/mfi/mfi_disk.c		optional mfi
 dev/mfi/mfi_syspd.c		optional mfi
 dev/mfi/mfi_tbolt.c		optional mfi
-dev/mfi/mfi_linux.c		optional mfi compat_linux
 dev/mfi/mfi_cam.c		optional mfip scbus
 dev/mii/acphy.c			optional miibus | acphy
 dev/mii/amphy.c			optional miibus | amphy
@@ -3241,7 +3237,6 @@ dev/syscons/syscons.c		optional sc
 dev/syscons/sysmouse.c		optional sc
 dev/syscons/warp/warp_saver.c	optional warp_saver
 dev/tcp_log/tcp_log_dev.c	optional tcp_blackbox inet | tcp_blackbox inet6
-dev/tdfx/tdfx_linux.c		optional tdfx_linux tdfx compat_linux
 dev/tdfx/tdfx_pci.c		optional tdfx pci
 dev/ti/if_ti.c			optional ti pci
 dev/twa/tw_cl_init.c		optional twa \
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index 9c3c8e855bde..990104441326 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -48,30 +48,6 @@ cloudabi64_vdso_blob.o		optional	compat_cloudabi64	\
 	no-implicit-rule						\
 	clean		"cloudabi64_vdso_blob.o"
 #
-linux32_genassym.o		optional	compat_linux32		\
-	dependency 	"$S/amd64/linux32/linux32_genassym.c offset.inc"		\
-	compile-with	"${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c ${.IMPSRC}" \
-	no-obj no-implicit-rule						\
-	clean		"linux32_genassym.o"
-#
-linux32_assym.h			optional	compat_linux32		\
-	dependency 	"$S/kern/genassym.sh linux32_genassym.o"	\
-	compile-with	"sh $S/kern/genassym.sh linux32_genassym.o > ${.TARGET}" \
-	no-obj no-implicit-rule before-depend				\
-	clean		"linux32_assym.h"
-#
-linux32_locore.o	optional	compat_linux32		\
-	dependency 	"linux32_assym.h $S/amd64/linux32/linux32_locore.asm"	\
-	compile-with	"${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s -pipe -I. -I$S ${WERROR} -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/amd64/linux32/linux32_vdso.lds.s -Wl,-soname=linux32_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \
-	no-obj no-implicit-rule						\
-	clean		"linux32_locore.o"
-#
-linux32_vdso.so		optional	compat_linux32			\
-	dependency 	"linux32_locore.o"				\
-	compile-with	"${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd --binary-architecture i386 linux32_locore.o ${.TARGET}" \
-	no-implicit-rule						\
-	clean		"linux32_vdso.so"
-#
 ia32_genassym.o			standard				\
 	dependency 	"$S/compat/ia32/ia32_genassym.c offset.inc"		\
 	compile-with	"${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c ${.IMPSRC}" \
@@ -428,44 +404,6 @@ amd64/ia32/ia32_signal.c	optional	compat_freebsd32
 amd64/ia32/ia32_syscall.c	optional	compat_freebsd32
 amd64/ia32/ia32_misc.c		optional	compat_freebsd32
 compat/ia32/ia32_sysvec.c	optional	compat_freebsd32
-compat/linprocfs/linprocfs.c	optional	linprocfs
-compat/linsysfs/linsysfs.c	optional	linsysfs
-#
-# Linux/i386 binary support
-#
-amd64/linux32/linux32_dummy_machdep.c	optional	compat_linux32
-amd64/linux32/linux32_machdep.c	optional	compat_linux32
-amd64/linux32/linux32_support.s	optional	compat_linux32		\
-	dependency 	"linux32_assym.h"
-amd64/linux32/linux32_sysent.c	optional	compat_linux32
-amd64/linux32/linux32_sysvec.c	optional	compat_linux32
-compat/linux/linux_dummy.c	optional	compat_linux32
-compat/linux/linux_emul.c	optional	compat_linux32
-compat/linux/linux_errno.c	optional	compat_linux32
-compat/linux/linux_file.c	optional	compat_linux32
-compat/linux/linux_fork.c	optional	compat_linux32
-compat/linux/linux_futex.c	optional	compat_linux32
-compat/linux/linux_getcwd.c	optional	compat_linux32
-compat/linux/linux_ioctl.c	optional	compat_linux32
-compat/linux/linux_ipc.c	optional	compat_linux32
-compat/linux/linux_mib.c	optional	compat_linux32
-compat/linux/linux_misc.c	optional	compat_linux32
-compat/linux/linux_mmap.c	optional	compat_linux32
-compat/linux/linux_signal.c	optional	compat_linux32
-compat/linux/linux_socket.c	optional	compat_linux32
-compat/linux/linux_stats.c	optional	compat_linux32
-compat/linux/linux_sysctl.c	optional	compat_linux32
-compat/linux/linux_time.c	optional	compat_linux32
-compat/linux/linux_timer.c	optional	compat_linux32
-compat/linux/linux_uid16.c	optional	compat_linux32
-compat/linux/linux_util.c	optional	compat_linux32
-compat/linux/linux_vdso.c	optional	compat_linux32
-compat/linux/linux_common.c	optional	compat_linux32
-compat/linux/linux_event.c	optional	compat_linux32
-compat/linux/linux.c		optional	compat_linux32
-x86/linux/linux_dummy_x86.c	optional	compat_linux32
-dev/amr/amr_linux.c		optional	compat_linux32 amr
-dev/mfi/mfi_linux.c		optional	compat_linux32 mfi
 compat/ndis/winx64_wrap.S	optional	ndisapi pci
 #
 # x86 real mode BIOS emulator, required by dpms/pci/vesa
diff --git a/sys/conf/files.i386 b/sys/conf/files.i386
index 1dbca0f9b607..4be98810b32e 100644
--- a/sys/conf/files.i386
+++ b/sys/conf/files.i386
@@ -23,57 +23,8 @@ cloudabi32_vdso_blob.o		optional	compat_cloudabi32	\
 	no-implicit-rule						\
 	clean		"cloudabi32_vdso_blob.o"
 #
-linux_genassym.o		optional	compat_linux		\
-	dependency 	"$S/i386/linux/linux_genassym.c offset.inc"		\
-	compile-with	"${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c ${.IMPSRC}" \
-	no-obj no-implicit-rule						\
-	clean		"linux_genassym.o"
-#
-linux_assym.h			optional	compat_linux		\
-	dependency 	"$S/kern/genassym.sh linux_genassym.o"		\
-	compile-with	"sh $S/kern/genassym.sh linux_genassym.o > ${.TARGET}" \
-	no-obj no-implicit-rule before-depend				\
-	clean		"linux_assym.h"
-#
-linux_locore.o			optional	compat_linux		\
-	dependency 	"linux_assym.h $S/i386/linux/linux_locore.asm"	\
-	compile-with	"${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S ${WERROR} -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \
-	no-obj no-implicit-rule						\
-	clean		"linux_locore.o"
-#
-linux_vdso.so			optional	compat_linux		\
-	dependency 	"linux_locore.o"				\
-	compile-with	"${OBJCOPY} --input-target binary --output-target elf32-i386-freebsd --binary-architecture i386 linux_locore.o ${.TARGET}" \
-	no-implicit-rule						\
-	clean		"linux_vdso.so"
-#
 cddl/dev/dtrace/i386/dtrace_asm.S			optional dtrace compile-with "${DTRACE_S}"
 cddl/dev/dtrace/i386/dtrace_subr.c			optional dtrace compile-with "${DTRACE_C}"
-compat/linprocfs/linprocfs.c	optional linprocfs
-compat/linsysfs/linsysfs.c	optional linsysfs
-compat/linux/linux_dummy.c	optional compat_linux
-compat/linux/linux_event.c	optional compat_linux
-compat/linux/linux_emul.c	optional compat_linux
-compat/linux/linux_errno.c	optional compat_linux
-compat/linux/linux_file.c	optional compat_linux
-compat/linux/linux_fork.c	optional compat_linux
-compat/linux/linux_futex.c	optional compat_linux
-compat/linux/linux_getcwd.c	optional compat_linux
-compat/linux/linux_ioctl.c	optional compat_linux
-compat/linux/linux_ipc.c	optional compat_linux
-compat/linux/linux_mib.c	optional compat_linux
-compat/linux/linux_misc.c	optional compat_linux
-compat/linux/linux_mmap.c	optional compat_linux
-compat/linux/linux_signal.c	optional compat_linux
-compat/linux/linux_socket.c	optional compat_linux
-compat/linux/linux_stats.c	optional compat_linux
-compat/linux/linux_sysctl.c	optional compat_linux
-compat/linux/linux_time.c	optional compat_linux
-compat/linux/linux_timer.c	optional compat_linux
-compat/linux/linux_uid16.c	optional compat_linux
-compat/linux/linux_util.c	optional compat_linux
-compat/linux/linux_vdso.c	optional compat_linux
-compat/linux/linux.c		optional compat_linux
 compat/ndis/winx32_wrap.S	optional ndisapi pci
 crypto/aesni/aeskeys_i386.S	optional aesni
 crypto/des/arch/i386/des_enc.S	optional netsmb
@@ -202,13 +153,6 @@ i386/i386/trap.c		standard
 i386/i386/uio_machdep.c		standard
 i386/i386/vm86.c		standard
 i386/i386/vm_machdep.c		standard
-i386/linux/imgact_linux.c	optional compat_linux
-i386/linux/linux_copyout.c	optional compat_linux
-i386/linux/linux_dummy_machdep.c	optional compat_linux
-i386/linux/linux_machdep.c	optional compat_linux
-i386/linux/linux_ptrace.c	optional compat_linux
-i386/linux/linux_sysent.c	optional compat_linux
-i386/linux/linux_sysvec.c	optional compat_linux
 i386/pci/pci_cfgreg.c		optional pci
 i386/pci/pci_pir.c		optional pci
 isa/syscons_isa.c		optional sc
@@ -239,7 +183,6 @@ x86/isa/atpic.c			optional atpic
 x86/isa/elcr.c			optional atpic | apic
 x86/isa/isa.c			optional isa
 x86/isa/isa_dma.c		optional isa
-x86/linux/linux_dummy_x86.c	optional compat_linux
 x86/x86/io_apic.c		optional apic
 x86/x86/local_apic.c		optional apic
 x86/x86/mptable.c		optional apic
diff --git a/sys/conf/files.x86 b/sys/conf/files.x86
index ae68faa002ff..a5a565483fe8 100644
--- a/sys/conf/files.x86
+++ b/sys/conf/files.x86
@@ -176,7 +176,6 @@ dev/ipmi/ipmi_smbus.c		optional	ipmi smbus
 dev/ipmi/ipmi_smbios.c		optional	ipmi
 dev/ipmi/ipmi_ssif.c		optional	ipmi smbus
 dev/ipmi/ipmi_pci.c		optional	ipmi pci
-dev/ipmi/ipmi_linux.c		optional	ipmi compat_linux32
 dev/isci/isci.c							optional isci
 dev/isci/isci_controller.c					optional isci
 dev/isci/isci_domain.c						optional isci
diff --git a/sys/conf/options.amd64 b/sys/conf/options.amd64
index cd90747ba732..0a08b2717474 100644
--- a/sys/conf/options.amd64
+++ b/sys/conf/options.amd64
@@ -18,7 +18,7 @@ PV_STATS		opt_pmap.h
 COMPAT_AOUT		opt_dontuse.h
 COMPAT_FREEBSD32	opt_global.h
 #COMPAT_LINUX		opt_dontuse.h
-COMPAT_LINUX32		opt_compat.h
+COMPAT_LINUX32		opt_dontuse.h
 LINPROCFS		opt_dontuse.h
 LINSYSFS		opt_dontuse.h
 NDISAPI			opt_dontuse.h
diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES
index 48304670d4c2..fb0d52ad8582 100644
--- a/sys/i386/conf/NOTES
+++ b/sys/i386/conf/NOTES
@@ -429,11 +429,9 @@ device		s3pci
 # linked to /dev/3dfx and /dev/voodoo.  Note that this is not the same as
 # the tdfx DRI module from XFree86 and is completely unrelated.
 #
-# To enable Linuxulator support, one must also include COMPAT_LINUX in the
-# config as well.  The other option is to load both as modules.
+# To enable Linuxulator support, one must also load linux.ko and tdfx_linux.ko.
 
 device		tdfx			# Enable 3Dfx Voodoo support
-device		tdfx_linux		# Enable Linuxulator support
 
 options 	IOMMU			# Enable IOMMU support
 
@@ -879,22 +877,12 @@ options 	COMPAT_AOUT
 # Enable 32-bit runtime support for CloudABI binaries.
 options 	COMPAT_CLOUDABI32
 
-# Enable Linux ABI emulation
-options 	COMPAT_LINUX
-
-# Enable the linux-like proc filesystem support (requires COMPAT_LINUX
-# and PSEUDOFS)
-options 	LINPROCFS
-
-#Enable the linux-like sys filesystem support (requires COMPAT_LINUX
-# and PSEUDOFS)
-options 	LINSYSFS
-
 # Enable NDIS binary driver support
 options 	NDISAPI
 device		ndis
 
 
+=======
 #####################################################################
 # VM OPTIONS