Commit Graph

278135 Commits

Author SHA1 Message Date
Jens Schweikhardt
25c54b848e Reference correct section for free(3). 2022-09-17 13:12:44 +02:00
Mateusz Guzik
b77bdfdb67 vfs: fix non-INVARIANTS build after 5b5b7e2ca2
Reported by:	gj
2022-09-17 10:45:12 +00:00
Mateusz Guzik
aede6a9670 vfs: fixup parse_mount_dev_present after 5b5b7e2ca2
Reported by:	kib
2022-09-17 10:35:00 +00:00
Mateusz Guzik
5b5b7e2ca2 vfs: always retain path buffer after lookup
This removes some of the complexity needed to maintain HASBUF and
allows for removing injecting SAVENAME by filesystems.

Reviewed by:	kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D36542
2022-09-17 09:10:38 +00:00
Mateusz Guzik
3df3d88cc5 vfs: move cn_nameptr assignment out of namei_getpath 2022-09-17 09:08:34 +00:00
Mateusz Guzik
41a0a99f85 vfs: slightly reorganize error handling in chroot
This avoids duplicated NDFREE_NOTHING which will be of importance
later.
2022-09-17 09:08:34 +00:00
Konstantin Belousov
55c5216582 vm/vm.h: cleanup
Move declarations for in-kernel function and variables to _KERNEL
section.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36612
2022-09-17 11:58:52 +03:00
Brooks Davis
bb23932803 ktrace: make ktr_tid a long not intptr_t (NFC)
Long ago, ktr_tid was ktr_buffer which pointed to the buffer following
the header and was used internally in the kernel.  Use was removed in
efbbbf570d and it was repurposed as ktr_kid in c6854c347f.  For
ABI reasons, it stayed an intptr_t rather than becoming an lwpid_t at
the time.  Since it doesn't hold a pointer any more (unless you have
a ktrace.out from 2005), change the type to long which is alwasy the
same size on all supported architectures.  Add a suggestion to change
the type to lwpid_t (__int32_t) on a future ABI break.

Remove most remaining references to ktr_buffer, retaing a comment in
kdump.c explaining why negative values are treated as 0.  While here,
accept that pid_t and lwpid_t are of type int and simplify casts in
printf.

This changed was motivated by CheriBSD where intptr_t is 16-bytes
in the pure-capability ABI.

Reviewed by:	kib, markj
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D36599
2022-09-17 09:21:59 +01:00
Jens Schweikhardt
714300faec Change sysctl section to 3 as suggested by Benjamin Kaduk. 2022-09-17 09:35:49 +02:00
Warner Losh
7cd4984e67 SPDX: Not BSD-4-Clause
This is not BSD-4-Clause. It's closer to a modified BSD-2-Clause with 2
added clauses (and the first one has added clauses). Remove
SPDX-License-Idnetifier since this license doesn't match anything in
SPDX.
2022-09-16 21:49:16 -06:00
Ben Woods
e4505364c0 release/rc.local: Provide option to shutdown after installation complete
This can be useful instead of reboot if installing in a virtual machine,
and the user wants to modify the VM hardware or virtual media mounts
prior to booting into the newly installed system.

Reported by:	Juan Manuel Palacios (@jmp_imaginarium on Twitter)
Approved by:	philip
Differential Revision:	https://reviews.freebsd.org/D36560
2022-09-17 08:07:25 +08:00
Konstantin Belousov
0e2af3b59a jemalloc: Define SWAP_RESERVE_* if not provided by the system headers
instead ifdef-ing out the return statement.

Reported by:	Mark Millard <marklmi@yahoo.com>
Fixes:	87384c51e0
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2022-09-17 01:35:35 +03:00
Jens Schweikhardt
a09bb0ed18 Correct a typo in man page references: rpcset_gss -> rpcsec_gss. 2022-09-16 22:38:42 +02:00
Doug Moore
87cd087a4a iommu_gas: don't remove and insert boundary entry
Avoid removing an item in iommu_gas_free_region only to reinsert it,
by avoiding removing an entry that is either first_place or
last_place.

Reviewed by:	kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D36597
2022-09-16 15:32:11 -05:00
Konstantin Belousov
daa85548d5 rtld: teach LD_SHOW_AUXV about AT_USRSTACK*
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:24:18 +03:00
Konstantin Belousov
e03c7f5005 libthr: extract code to get main stack base and size into helpers
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:24:12 +03:00
Konstantin Belousov
e2879ece43 libc, libthr: use AT_USRSTACK{BASE,LIM} instead of sysctl("kern.usrstack") and get_rlimit(RLIMIT_STACK)
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:24:06 +03:00
Konstantin Belousov
ebf7a01594 libthr: use nitems() for mib length
Suggested by:	imp
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:23:59 +03:00
Konstantin Belousov
0ae364adcd jemalloc: use auxv ELF_BSDF_VMNOOVERCOMMIT instead of sysctl("vm.overcommit")
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:23:52 +03:00
Konstantin Belousov
62b4fb22df auxv.3: Document AT_USRSTACKBASE and AT_USRSTACKLIM
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:23:46 +03:00
Konstantin Belousov
1d280f2142 procstat(1): print AT_USRSTACKBASE and AT_USRSTACKLIM
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:23:38 +03:00
Konstantin Belousov
8f2668b060 _elf_aux_info(3): add support for AT_USRSTACK{BASE,LIM}
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:23:32 +03:00
Konstantin Belousov
ff41239f58 Add AT_USRSTACK{BASE, LIM} AT vectors, and ELF_BSDF_VMNOOVERCOMMIT flag
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:23:26 +03:00
Konstantin Belousov
87384c51e0 jemalloc: use symbolic definitions for bits in vm_overcommit
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:23:19 +03:00
Konstantin Belousov
26eed2aa06 swap_pager: style, wrap long lines
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:23:13 +03:00
Konstantin Belousov
ccdaa1ab1c vm_overcommit: put into __read_mostly section
Suggested by:	mjg
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:23:04 +03:00
Konstantin Belousov
a6cc4c6e98 vm: make vm.overcommit available externally
Reviewed by:	brooks, imp (previous version)
Discussed with:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36540
2022-09-16 23:22:49 +03:00
Gordon Bergling
30cfb3c8ee ctime.3: Add a note about a possible return value of localtime(3)
The localtime(3) function returns a NULL pointer, if the passed in-time
translates to a year that will not fit in an integer type. It is stricly
recommended to check the return value to avoid garage output.

Reported by:		mckusick
Reviewed by:		mckusick, imp, rpokala
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D36515
2022-09-16 20:38:58 +02:00
Jens Schweikhardt
e9e615c88a Fix dead references (wrong section) to sysctl(8). 2022-09-16 20:00:49 +02:00
Jens Schweikhardt
e6044abdbe More precise language: what is called data pointer, C calls object pointer.
Also delete reference to non-existing lint(1).
2022-09-16 19:40:11 +02:00
Jens Schweikhardt
59a1db5be6 Fix dead refs to pam(8) with pam(3) as well as some other PAM functions. 2022-09-16 19:33:30 +02:00
Mateusz Guzik
50176b0296 locks: whack a failed experiment in form of restrict_starvation
This was never enabled and only pollutes the code. The issue will
be addressed later in a different manner.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-09-16 17:29:37 +00:00
Jens Schweikhardt
cf13e67730 Fix dead reference to boot0(8) to point to boot0cfg(8). 2022-09-16 19:08:22 +02:00
Jens Schweikhardt
91dba0dae7 Correct wrong sections for bpf and pcap. 2022-09-16 19:03:37 +02:00
Warner Losh
dd2b9c2967 stand: fix mismerge
Remove stray line from mismerge of 5d1531d9d4. This is no longer
needed.

Fixes:			5d1531d9d4
Sponsored by:		Netflix
2022-09-16 10:54:04 -06:00
Warner Losh
c0ecae78ab stand/elf: Only support swapping headers on powerpc.
Powerpc is currently the only architecture that we support more than one
endian. It's the only one that benefits from this swapping, so restrict
the code to there. This saves about 1k in the i386 BIOS loader.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D36577
2022-09-16 09:18:57 -06:00
Warner Losh
9758dd3de1 stand: Allocate bootinfo rather than have it be static
This saves 80 bytes (the new bootinfo structure was 84 bytes, and a
pointer is 4 bytes). The bi_load32 code is the same size.

Sponsored by:		Netflix
Reviewed by:		tsoome
Differential Revision:	https://reviews.freebsd.org/D36575
2022-09-16 09:18:57 -06:00
Warner Losh
4134f677eb i386: Make boot loader smaller by reducing size of bootinfo
We don't need the 56 bytes at the end of bootinfo, and never had.  Don't
copy them from old boot loaders, and don't provide them with new boot
loaders.

Add comments about what versions of FreeBSD 'old' means in various
contexts. Add note that old disk loader (from 1.x/2.x) is doomed to
failure because it doesn't provide metadata that we now require to boot,
and has been since approximately FreeBSD 7.x. Retain all this
information to explain why we have 4 arguments that are always 0, even
though it's ancient history.

This saves 56 bytes in the boot loader.

Sponsored by:		Netflix
Reviewed by:		phk, rgrimes, kib
Differential Revision:	https://reviews.freebsd.org/D36550
2022-09-16 09:18:57 -06:00
Warner Losh
59b1d07428 i386: Mark the obsolete fields in bootinfo with _was_
Mark the obsolete fields in bootinfo with _was_. Note that the fields
from bi_memdesc_version to the end of the structure never were used in a
release. They were added in April 2010 for i386 EFI booting. The boot
loader set these fields though 2019, but no kernel ever looked at them
and we never supported i386 EFI booting, and likely never will in this
form. They can likely be deleted entirely in the future, but locore.S
needs to change to do that (it also needs to change to drop support for
really old booting scenarios as well, which will eliminate bi_endcommon
too).

All the other fields haven't been used since the 4.x -> 5.x cutover of
the wdc driver to ata.

The bi_bios_dev field is used in the handoff between bootXX and the
loader. The loader uses it to determine what disk it was loaded off of
to detmerine the default root filesystem. It's not used by the i386
kernel anymore to determine anything.

Sponsored by:		Netflix
Reviewed by:		tsoome
Differential Revision:	https://reviews.freebsd.org/D36544
2022-09-16 09:18:57 -06:00
Warner Losh
d43bcf62a2 stand: Stop support booting 4.x and earlier kernels
FreeBSD 4.x and earlier used the bi_bios_geom to get the geometry of the
device. Starting in 5.x, with the wdc -> ata rewrite, it was used only
in pc98 kernels to report geometry of the drives. It can be safely
removed as booting kernels this old is no longer supported. This saves
176 bytes in the BIOS loader.

Sponsored by:		Netflix
Reviewed by:		adrian, emaste
Differential Revision:	https://reviews.freebsd.org/D36543
2022-09-16 09:18:57 -06:00
Warner Losh
e895ab3fbd stand: Remove dead store to bi_kernelname
We set this value twice: once to 0 and once to the VA that has the name
of the kernel. The first store is redundant. In addition, these two
stores of 0 are also redundant. Since we never set them, they will
always be zero, even if we're called multiple times. This saves 21
bytes on BIOS loader.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D36541
2022-09-16 09:18:56 -06:00
Warner Losh
fc352701ff stand: collapse all copies of *copyenv into md_copyenv
Use the efi's bi_copyenv to md_copyenv and place it in modinfo.c. Remove
all other nearly identical and efi's has the best error handling.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D36574
2022-09-16 09:18:56 -06:00
Warner Losh
2e6ed47a46 stand: Move MOD_xxx macros from modinfo.h to .c
Now that MOD_xxx macros are modinfo.c, they don't need to be in
modinfo.h.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D36573
2022-09-16 09:18:56 -06:00
Warner Losh
5d1531d9d4 stand: Move md_copymodules into modinfo.c and reduce copies
md_copymodules, bi_copymdoules, bi_copymodules32 (x2) and
bi_copymodules64 (x2) are all the same routine... Replace them all with
md_copymodules. This saves about 800 bytes on i386 BIOS loader, which is
a nice bonus.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D36572
2022-09-16 09:18:56 -06:00
Warner Losh
bca9c87b61 stand: Create common/modinfo.h
Move all the MOD_xxx macros to this header. Each user of this interface
is currently required to define MOD_ALIGNMENT(l). modinfo was selected
because it sits inbetween modules and metadata and will make it easier
to migrate to new, shared intefaces.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D36571
2022-09-16 09:18:56 -06:00
Warner Losh
8b19d28d68 stand: Create MOD_ALIGN macro and use it everywhere
To further reduce the differences between the different MOD_xxx macros,
use MOD_ALIGN to do the proper alignment for the given use.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D36570
2022-09-16 09:18:56 -06:00
Warner Losh
4c670b53a0 stand: use archsw.arch_copyin instead of direct call
This replaces the CALLBACK(copyin, ...) with a call to
archsw.arch_copyin which points to a function that does the
callback. More diff reduction for the multiple copies of these routines
in the tree.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D36569
2022-09-16 09:18:56 -06:00
Warner Losh
a705c72f21 stand: use archsw.arch_copyin instead of i386_copyin
Since archsw.arch_copyin is always i386_copyin, this will be a nop in
terms of functionality. This is a diff reduction against other copies of
the code that differ only by what copyin routine they call.

Sponsored by:		Netflix
Reviewed by:		tsoome
Differential Revision:	https://reviews.freebsd.org/D36568
2022-09-16 09:18:56 -06:00
Nuno Teixeira
b44869cba1 sound: add patch for Lenovo Legion 5 Intel
Laptop Legion Lenovo 5 15MH05 (Intel)

Patch to fix the sound on this machine.
It requires sending the speaker and the headphone jack to the same nid.

PR:		265632
Approved by:	emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D36511
2022-09-16 14:29:30 +01:00
Kristof Provost
b417407957 bridge.4: describe new MTU behaviour
1865ebfb12 changed if_bridge to have it change the MTU on newly added
interfaces to match the if_bridge MTU, rather than rejecting them for
having an incorrect MTU.

Update the man page to reflect this, as pointed out by woodsb02.

Reviewed by:	woodsb02
Differential Revision:	https://reviews.freebsd.org/D36481
2022-09-16 12:49:16 +02:00