]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
21 months agovfs: indent V_VALID_FLAGS with a tab
Mateusz Guzik [Sun, 18 Sep 2022 21:32:25 +0000 (21:32 +0000)]
vfs: indent V_VALID_FLAGS with a tab

Requested by: kib

21 months agorb_tree: silence unused function warnings
Doug Moore [Sun, 18 Sep 2022 08:34:47 +0000 (03:34 -0500)]
rb_tree: silence unused function warnings

With DIAGNOSTIC set a kernel build generates warnings about the
defined-but-unused RB_RANK method. Don't set _RB_DIAGNOSTIC
automatically, to silence these warnings.

Reported by: mjguzik@gmail.com
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D36617

21 months agolinuxkpi: use SI_SUB_EVENTHANDLER + 1, like other consumers
Mateusz Guzik [Sat, 17 Sep 2022 23:41:46 +0000 (23:41 +0000)]
linuxkpi: use SI_SUB_EVENTHANDLER + 1, like other consumers

Otherwise it may try to initialize before eventhandler subsystem.

21 months agostand: Pass in the proper size for bootinfo
Warner Losh [Sat, 17 Sep 2022 21:15:51 +0000 (15:15 -0600)]
stand: Pass in the proper size for bootinfo

Missed one sizeof(bi) -> sizeof(*bi) in 9758dd3de1cdd conversion to
allocating bootinfo.

Noticed by: tijl@
Fixes: 9758dd3de1cdd
Sponsored by: Netflix

21 months agovfs: introduce V_PCATCH to stop abusing PCATCH
Mateusz Guzik [Sat, 17 Sep 2022 15:22:04 +0000 (17:22 +0200)]
vfs: introduce V_PCATCH to stop abusing PCATCH

21 months agovfs: deperl msleep flag calculation in vn_start_*write
Mateusz Guzik [Sat, 17 Sep 2022 15:17:20 +0000 (17:17 +0200)]
vfs: deperl msleep flag calculation in vn_start_*write

21 months agovfs: clean up parse_mount_dev_present
Mateusz Guzik [Sat, 17 Sep 2022 12:42:46 +0000 (12:42 +0000)]
vfs: clean up parse_mount_dev_present

21 months agozfs: don't access nameidata unless namei succeeded
Mateusz Guzik [Sat, 17 Sep 2022 12:25:59 +0000 (12:25 +0000)]
zfs: don't access nameidata unless namei succeeded

21 months agoThere's no PEM(3) anywhere around; delete reference.
Jens Schweikhardt [Sat, 17 Sep 2022 11:14:01 +0000 (13:14 +0200)]
There's no PEM(3) anywhere around; delete reference.

21 months agoReference correct section for free(3).
Jens Schweikhardt [Sat, 17 Sep 2022 11:11:42 +0000 (13:11 +0200)]
Reference correct section for free(3).

21 months agovfs: fix non-INVARIANTS build after 5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179
Mateusz Guzik [Sat, 17 Sep 2022 10:45:12 +0000 (10:45 +0000)]
vfs: fix non-INVARIANTS build after 5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179

Reported by: gj

21 months agovfs: fixup parse_mount_dev_present after 5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179
Mateusz Guzik [Sat, 17 Sep 2022 10:35:00 +0000 (10:35 +0000)]
vfs: fixup parse_mount_dev_present after 5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179

Reported by: kib

21 months agovfs: always retain path buffer after lookup
Mateusz Guzik [Sat, 17 Sep 2022 09:10:38 +0000 (09:10 +0000)]
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

21 months agovfs: move cn_nameptr assignment out of namei_getpath
Mateusz Guzik [Sat, 17 Sep 2022 00:59:32 +0000 (00:59 +0000)]
vfs: move cn_nameptr assignment out of namei_getpath

21 months agovfs: slightly reorganize error handling in chroot
Mateusz Guzik [Sat, 17 Sep 2022 01:19:42 +0000 (01:19 +0000)]
vfs: slightly reorganize error handling in chroot

This avoids duplicated NDFREE_NOTHING which will be of importance
later.

21 months agovm/vm.h: cleanup
Konstantin Belousov [Fri, 16 Sep 2022 22:44:39 +0000 (01:44 +0300)]
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

21 months agoktrace: make ktr_tid a long not intptr_t (NFC)
Brooks Davis [Sat, 17 Sep 2022 08:21:32 +0000 (09:21 +0100)]
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
efbbbf570d70b and it was repurposed as ktr_kid in c6854c347f4d8.  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

21 months agoChange sysctl section to 3 as suggested by Benjamin Kaduk.
Jens Schweikhardt [Sat, 17 Sep 2022 07:35:49 +0000 (09:35 +0200)]
Change sysctl section to 3 as suggested by Benjamin Kaduk.

21 months agoSPDX: Not BSD-4-Clause
Warner Losh [Sat, 17 Sep 2022 03:47:23 +0000 (21:47 -0600)]
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.

21 months agorelease/rc.local: Provide option to shutdown after installation complete
Ben Woods [Wed, 14 Sep 2022 13:03:22 +0000 (21:03 +0800)]
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

21 months agojemalloc: Define SWAP_RESERVE_* if not provided by the system headers
Konstantin Belousov [Fri, 16 Sep 2022 21:08:03 +0000 (00:08 +0300)]
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: 87384c51e047
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

21 months agoCorrect a typo in man page references: rpcset_gss -> rpcsec_gss.
Jens Schweikhardt [Fri, 16 Sep 2022 20:37:20 +0000 (22:37 +0200)]
Correct a typo in man page references: rpcset_gss -> rpcsec_gss.

21 months agoiommu_gas: don't remove and insert boundary entry
Doug Moore [Fri, 16 Sep 2022 20:32:11 +0000 (15:32 -0500)]
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

21 months agortld: teach LD_SHOW_AUXV about AT_USRSTACK*
Konstantin Belousov [Thu, 15 Sep 2022 10:16:30 +0000 (13:16 +0300)]
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

21 months agolibthr: extract code to get main stack base and size into helpers
Konstantin Belousov [Tue, 13 Sep 2022 22:14:24 +0000 (01:14 +0300)]
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

21 months agolibc, libthr: use AT_USRSTACK{BASE,LIM} instead of sysctl("kern.usrstack") and get_rl...
Konstantin Belousov [Mon, 12 Sep 2022 19:45:21 +0000 (22:45 +0300)]
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

21 months agolibthr: use nitems() for mib length
Konstantin Belousov [Mon, 12 Sep 2022 20:24:55 +0000 (23:24 +0300)]
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

21 months agojemalloc: use auxv ELF_BSDF_VMNOOVERCOMMIT instead of sysctl("vm.overcommit")
Konstantin Belousov [Mon, 12 Sep 2022 19:44:37 +0000 (22:44 +0300)]
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

21 months agoauxv.3: Document AT_USRSTACKBASE and AT_USRSTACKLIM
Konstantin Belousov [Thu, 15 Sep 2022 10:08:59 +0000 (13:08 +0300)]
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

21 months agoprocstat(1): print AT_USRSTACKBASE and AT_USRSTACKLIM
Konstantin Belousov [Thu, 15 Sep 2022 10:14:17 +0000 (13:14 +0300)]
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

21 months ago_elf_aux_info(3): add support for AT_USRSTACK{BASE,LIM}
Konstantin Belousov [Mon, 12 Sep 2022 19:36:24 +0000 (22:36 +0300)]
_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

21 months agoAdd AT_USRSTACK{BASE, LIM} AT vectors, and ELF_BSDF_VMNOOVERCOMMIT flag
Konstantin Belousov [Mon, 12 Sep 2022 19:32:02 +0000 (22:32 +0300)]
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

21 months agojemalloc: use symbolic definitions for bits in vm_overcommit
Konstantin Belousov [Thu, 15 Sep 2022 09:59:42 +0000 (12:59 +0300)]
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

21 months agoswap_pager: style, wrap long lines
Konstantin Belousov [Tue, 13 Sep 2022 10:03:11 +0000 (13:03 +0300)]
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

21 months agovm_overcommit: put into __read_mostly section
Konstantin Belousov [Tue, 13 Sep 2022 10:00:12 +0000 (13:00 +0300)]
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

21 months agovm: make vm.overcommit available externally
Konstantin Belousov [Mon, 12 Sep 2022 19:31:30 +0000 (22:31 +0300)]
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

21 months agoctime.3: Add a note about a possible return value of localtime(3)
Gordon Bergling [Fri, 16 Sep 2022 18:38:58 +0000 (20:38 +0200)]
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

21 months agoFix dead references (wrong section) to sysctl(8).
Jens Schweikhardt [Fri, 16 Sep 2022 18:00:49 +0000 (20:00 +0200)]
Fix dead references (wrong section) to sysctl(8).

21 months agoMore precise language: what is called data pointer, C calls object pointer.
Jens Schweikhardt [Fri, 16 Sep 2022 17:40:11 +0000 (19:40 +0200)]
More precise language: what is called data pointer, C calls object pointer.

Also delete reference to non-existing lint(1).

21 months agoFix dead refs to pam(8) with pam(3) as well as some other PAM functions.
Jens Schweikhardt [Fri, 16 Sep 2022 17:32:11 +0000 (19:32 +0200)]
Fix dead refs to pam(8) with pam(3) as well as some other PAM functions.

21 months agolocks: whack a failed experiment in form of restrict_starvation
Mateusz Guzik [Fri, 16 Sep 2022 17:28:35 +0000 (17:28 +0000)]
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")

21 months agoFix dead reference to boot0(8) to point to boot0cfg(8).
Jens Schweikhardt [Fri, 16 Sep 2022 17:08:22 +0000 (19:08 +0200)]
Fix dead reference to boot0(8) to point to boot0cfg(8).

21 months agoCorrect wrong sections for bpf and pcap.
Jens Schweikhardt [Fri, 16 Sep 2022 17:03:37 +0000 (19:03 +0200)]
Correct wrong sections for bpf and pcap.

21 months agostand: fix mismerge
Warner Losh [Fri, 16 Sep 2022 16:54:04 +0000 (10:54 -0600)]
stand: fix mismerge

Remove stray line from mismerge of 5d1531d9d4e7. This is no longer
needed.

Fixes: 5d1531d9d4e7
Sponsored by: Netflix

21 months agostand/elf: Only support swapping headers on powerpc.
Warner Losh [Fri, 16 Sep 2022 15:10:14 +0000 (09:10 -0600)]
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

21 months agostand: Allocate bootinfo rather than have it be static
Warner Losh [Fri, 16 Sep 2022 15:09:41 +0000 (09:09 -0600)]
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

21 months agoi386: Make boot loader smaller by reducing size of bootinfo
Warner Losh [Fri, 16 Sep 2022 15:09:26 +0000 (09:09 -0600)]
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

21 months agoi386: Mark the obsolete fields in bootinfo with _was_
Warner Losh [Fri, 16 Sep 2022 15:09:16 +0000 (09:09 -0600)]
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

21 months agostand: Stop support booting 4.x and earlier kernels
Warner Losh [Fri, 16 Sep 2022 15:09:07 +0000 (09:09 -0600)]
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

21 months agostand: Remove dead store to bi_kernelname
Warner Losh [Fri, 16 Sep 2022 15:09:02 +0000 (09:09 -0600)]
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

21 months agostand: collapse all copies of *copyenv into md_copyenv
Warner Losh [Fri, 16 Sep 2022 15:08:57 +0000 (09:08 -0600)]
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

21 months agostand: Move MOD_xxx macros from modinfo.h to .c
Warner Losh [Fri, 16 Sep 2022 15:08:52 +0000 (09:08 -0600)]
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

21 months agostand: Move md_copymodules into modinfo.c and reduce copies
Warner Losh [Fri, 16 Sep 2022 15:08:47 +0000 (09:08 -0600)]
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

21 months agostand: Create common/modinfo.h
Warner Losh [Fri, 16 Sep 2022 15:08:42 +0000 (09:08 -0600)]
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

21 months agostand: Create MOD_ALIGN macro and use it everywhere
Warner Losh [Fri, 16 Sep 2022 15:08:37 +0000 (09:08 -0600)]
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

21 months agostand: use archsw.arch_copyin instead of direct call
Warner Losh [Fri, 16 Sep 2022 15:08:32 +0000 (09:08 -0600)]
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

21 months agostand: use archsw.arch_copyin instead of i386_copyin
Warner Losh [Fri, 16 Sep 2022 15:08:23 +0000 (09:08 -0600)]
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

21 months agosound: add patch for Lenovo Legion 5 Intel
Nuno Teixeira [Fri, 16 Sep 2022 13:29:30 +0000 (14:29 +0100)]
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

21 months agobridge.4: describe new MTU behaviour
Kristof Provost [Thu, 15 Sep 2022 06:26:49 +0000 (08:26 +0200)]
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

21 months agouname.1: Clarify the -r option
Gordon Bergling [Fri, 16 Sep 2022 11:27:54 +0000 (13:27 +0200)]
uname.1: Clarify the -r option

It is some times hard to understand the difference between
kernel version and userland version. So clarify the -r option
of uname(1) in terms of a printed kernel version.

While here, add some cross references:

- cross reference freebsd-version(1) in uname(1)
- cross reference freebsd-version(1) and uname(1) in freebsd-update(8)

PR: 265594
Reported by: rwatson
Reviewed by: gbe, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36516

21 months agoarch: armv4 isn't supported either on aarch64 running in aarch32 mode
Warner Losh [Thu, 15 Sep 2022 17:17:12 +0000 (11:17 -0600)]
arch: armv4 isn't supported either on aarch64 running in aarch32 mode

FreeBSD used to support both armv4 and armv5 binaries. All of that
support has been removed from the tree. We have only ever supported
armv6 and armv7 binaries in that mode. Note armv4 here too for
completeness since it flowed better than 'armv5 and earlier' and means
the same thing (FreeBSD never ran on an armv3 or earlier CPU).

Sponsored by: Netflix

21 months agofreebsd32: Make sendmsg match native ABI for unpadded final control message
Jessica Clarke [Thu, 15 Sep 2022 16:16:22 +0000 (17:16 +0100)]
freebsd32: Make sendmsg match native ABI for unpadded final control message

The API says that CMSG_SPACE should be used for msg_controllen, but in
practice the native ABI allows you to only use CMSG_LEN for the final
(typically only) control message, and real-world software does this,
including Wayland. For freebsd32, this is in practice mostly harmless,
since control messages are generally used to carry file descriptors,
which are already 4 bytes in size and thus no padding is needed, but
they can carry other quantities that may not result in an aligned
length. This was discovered after CheriBSD's freebsd64 equivalent was
updated to match the freebsd32 implementation, as that uses 8 byte
alignment which does break the file descriptor use case, and thus
Wayland.

This used to be addressed by aligning buflen before the first iteration,
but that allowed unwanted invalid inputs and was lost in 1b1428dcc82b,
with no safer equivalent put in its place.

Reviewed by: brooks, kib, markj
Obtained from: CheriBSD
Fixes: 1b1428dcc82b ("Fix a TOCTOU vulnerability in freebsd32_copyin_control().")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36554

21 months agoObsoleteFiles: fix some dates in my comments
Gleb Smirnoff [Thu, 15 Sep 2022 16:04:50 +0000 (09:04 -0700)]
ObsoleteFiles: fix some dates in my comments

21 months agostand/efi: Clean the proper files
Guido van Rooij [Thu, 15 Sep 2022 15:10:20 +0000 (09:10 -0600)]
stand/efi: Clean the proper files

Need to clean the specific loader we build, not the generic loader.efi

Reviewed by: imp

21 months agoAdd deprecation notices for OPIE.
Dag-Erling Smørgrav [Thu, 15 Sep 2022 14:21:33 +0000 (16:21 +0200)]
Add deprecation notices for OPIE.

Differential Revision: https://reviews.freebsd.org/D36593

21 months agoRetire ISA sound card DMA support
Ed Maste [Fri, 18 Mar 2022 16:22:21 +0000 (12:22 -0400)]
Retire ISA sound card DMA support

As all ISA sound card drivers have been removed sndbuf_dma no longer
serves any purpose.

Reviewed by: mav
Relnotes:  Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34671

21 months agotests/sys/fs: remove mips workaround
Mitchell Horne [Thu, 15 Sep 2022 13:57:43 +0000 (10:57 -0300)]
tests/sys/fs: remove mips workaround

MIPS is gone, so we no longer require this check.

Reviewed by: imp, asomers
Differential Revision: https://reviews.freebsd.org/D36566

21 months agopf tests: require scapy for ether:short_pkt
Mitchell Horne [Thu, 15 Sep 2022 13:57:07 +0000 (10:57 -0300)]
pf tests: require scapy for ether:short_pkt

The pft_ether.py script requires both python and scapy to be installed.
Check for this so we properly skip the test when it is unavailable.

Reviewed by: kp
Fixes: 07ffa50ba075d ("pf tests: test short packets")
Differential Revision: https://reviews.freebsd.org/D36561

21 months agoUpdate SEE ALSO sections for resolver.{3,5} and hosts.5
Gordon Bergling [Thu, 15 Sep 2022 13:24:28 +0000 (15:24 +0200)]
Update SEE ALSO sections for resolver.{3,5} and hosts.5

The mentioned document "Name Server Operations Guide for BIND" is
outdated, so remove it from the SEE ALSO section of hosts.5
and resolver.{3,5}.

PR: 266360
Reported by: Graham Perrin <grahamperrin at FreeBSD dot org>
Reviewed by: karels
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36557

21 months agoqlnxe(4): Fix a typo in a source code comment
Gordon Bergling [Thu, 15 Sep 2022 08:31:05 +0000 (10:31 +0200)]
qlnxe(4): Fix a typo in a source code comment

- s/paramters/parameters/

MFC after: 3 days

21 months agocxgbetool(8): Fix a typo in a source code comment
Gordon Bergling [Thu, 15 Sep 2022 08:29:54 +0000 (10:29 +0200)]
cxgbetool(8): Fix a typo in a source code comment

- s/paramter/parameter/

MFC after: 3 days

21 months agobootptest: Fix a typo in a source code comment
Gordon Bergling [Thu, 15 Sep 2022 08:28:52 +0000 (10:28 +0200)]
bootptest: Fix a typo in a source code comment

- s/avaible/available/

MFC after: 3 days

21 months agosafexcel: Fix a typo in a source code comment
Gordon Bergling [Thu, 15 Sep 2022 08:26:48 +0000 (10:26 +0200)]
safexcel: Fix a typo in a source code comment

- s/paramters/parameters/

MFC after: 3 days

21 months agoflua: Fix a typo in a source code comment
Gordon Bergling [Thu, 15 Sep 2022 08:25:54 +0000 (10:25 +0200)]
flua: Fix a typo in a source code comment

- s/paramter/parameter/

MFC after: 3 days

21 months agokern_jail: Fix a typo in a source code comment
Gordon Bergling [Thu, 15 Sep 2022 08:25:19 +0000 (10:25 +0200)]
kern_jail: Fix a typo in a source code comment

- s/paramter/parameter/

MFC after: 3 days

21 months agonetpfil: Fix some typos in source code comments
Gordon Bergling [Thu, 15 Sep 2022 08:24:00 +0000 (10:24 +0200)]
netpfil: Fix some typos in source code comments

- s/paramter/parameter/
- s/paramters/parameters/

MFC after: 3 days

21 months agoSPDX: Not BSD-4-Clause
Warner Losh [Thu, 15 Sep 2022 03:17:44 +0000 (21:17 -0600)]
SPDX: Not BSD-4-Clause

This license has 4 clauses, and shares some text with the BSD-4-Clause
license. However, it omits the standard disclaimer and has 2 clauses all
its own. Remove this tag, since it was made in error and this doesn't
match the SPDX copy of the BSD-4-Clause license.

Sponsored by: Netflix

21 months agoip_output: always increase "cantfrag" stat if ip_fragment() fails
Gleb Smirnoff [Thu, 15 Sep 2022 02:22:40 +0000 (19:22 -0700)]
ip_output: always increase "cantfrag" stat if ip_fragment() fails

While here, join two unlikely cases into one if clause.

Submitted by: Ivan Rozhuk <rozhuk.im gmail.com>
PR: 265718
Reviewed by: mjg, melifaro
Differential revision: https://reviews.freebsd.org/D36584

21 months agoUnbreak the build after b3ee318b79d54a59190d35b8c76a63a8fb81b903
Mateusz Guzik [Wed, 14 Sep 2022 23:52:05 +0000 (23:52 +0000)]
Unbreak the build after b3ee318b79d54a59190d35b8c76a63a8fb81b903

21 months agovfs: make delmntque return with the interlock held
Mateusz Guzik [Wed, 14 Sep 2022 23:08:08 +0000 (23:08 +0000)]
vfs: make delmntque return with the interlock held

saves on relocking dance -- the lock is taken immediately
afterwards anyway.

21 months agolockf: elide vnode interlock in the common case in lf_purgelocks
Mateusz Guzik [Wed, 14 Sep 2022 23:04:22 +0000 (23:04 +0000)]
lockf: elide vnode interlock in the common case in lf_purgelocks

The interlock was already taken and released when dooming, thus by
API contract locking state cannot be legally installed.

At the same time the state is almost never there to begin with.

21 months agodevfs: stop taking the interlock in devfs_delete
Mateusz Guzik [Wed, 14 Sep 2022 22:51:42 +0000 (22:51 +0000)]
devfs: stop taking the interlock in devfs_delete

It buys nothing now that vhold does not require it.

21 months agodevfs: retire the unused DEVFS_DEL_VNLOCKED flag
Mateusz Guzik [Wed, 14 Sep 2022 22:47:53 +0000 (22:47 +0000)]
devfs: retire the unused DEVFS_DEL_VNLOCKED flag

21 months agodomains: rewrite documentation to describe present state
Gleb Smirnoff [Wed, 14 Sep 2022 21:11:40 +0000 (14:11 -0700)]
domains: rewrite documentation to describe present state

Reviewed by: debdrup, pauamma
Differential revision: https://reviews.freebsd.org/D36513

21 months agovfs: retire the V_MNTREF flag
Mateusz Guzik [Sat, 10 Sep 2022 20:13:19 +0000 (22:13 +0200)]
vfs: retire the V_MNTREF flag

Reviewed by: kib, mckusick
Differential Revision: https://reviews.freebsd.org/D36521

21 months agovfs: stop using the V_MNTREF flag
Mateusz Guzik [Sat, 10 Sep 2022 20:12:08 +0000 (22:12 +0200)]
vfs: stop using the V_MNTREF flag

Reviewed by: kib, mckusick
Differential Revision: https://reviews.freebsd.org/D36521

21 months agoufs: stop using the V_MNTREF flag
Mateusz Guzik [Sat, 10 Sep 2022 20:11:42 +0000 (22:11 +0200)]
ufs: stop using the V_MNTREF flag

Reviewed by: kib, mckusick
Differential Revision: https://reviews.freebsd.org/D36521

21 months agoufs: try to elide the interlock in ufs_itimes
Mateusz Guzik [Mon, 12 Sep 2022 23:20:59 +0000 (23:20 +0000)]
ufs: try to elide the interlock in ufs_itimes

Reviewed by: kib, mckusick
Differential Revision: https://reviews.freebsd.org/D36522

21 months agoufs: always call ufs_itimes on close
Mateusz Guzik [Mon, 12 Sep 2022 23:19:42 +0000 (23:19 +0000)]
ufs: always call ufs_itimes on close

While here dedup code with fifo.

Reviewed by: kib, mckusick
Differential Revision: https://reviews.freebsd.org/D36522

21 months agobsdinstall: fix a couple stragglers in whitelabeling the scripts
Brad Davis [Wed, 14 Sep 2022 17:04:07 +0000 (11:04 -0600)]
bsdinstall: fix a couple stragglers in whitelabeling the scripts

PR: 265797
Reviewed by: allanjude, asiciliano
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D36235

21 months agoi386: explain the handshake between copyout_fast.s and page fault handler
Konstantin Belousov [Fri, 9 Sep 2022 20:44:48 +0000 (23:44 +0300)]
i386: explain the handshake between copyout_fast.s and page fault handler

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

21 months agoi386: lower register's pressure on copyout_fast
Konstantin Belousov [Fri, 9 Sep 2022 20:38:57 +0000 (23:38 +0300)]
i386: lower register's pressure on copyout_fast

Do not require that %ebx contains idlePTD AKA %kcr3.  This also
simplifies KBI contract between copyout_fast and page handler.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

21 months agoi386 copyout/in_fast: handle page fault from KVA access
Konstantin Belousov [Thu, 8 Sep 2022 20:15:32 +0000 (23:15 +0300)]
i386 copyout/in_fast: handle page fault from KVA access

by delegating the work to the slow path.

Some kernel memory, like pipe buffers, is pageable.  We must not enable
interrupts, and consequently, preemption, while in critical section in
the fast copyout path, because we use pcpu buffers.  If page fault
occurs while copying from the pcpu copyout_buf to kernel memory, abort
fast path and delegate work to the slow implementation.

In collaboration with: pho, tijl
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

21 months agoi386: check that trap() and syscall() run on the thread kstack
Konstantin Belousov [Wed, 7 Sep 2022 20:13:35 +0000 (23:13 +0300)]
i386: check that trap() and syscall() run on the thread kstack

and not on the trampoline stack.  This is a useful way to ensure that
we did not enabled interrupts while on user %cr3 or trampoline stack.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

21 months agoi386 copyout_fast: do not use trampstk for temporal data, reduce ucr3 region
Konstantin Belousov [Mon, 5 Sep 2022 07:06:15 +0000 (10:06 +0300)]
i386 copyout_fast: do not use trampstk for temporal data, reduce ucr3 region

This simplifies code a lot.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

21 months agoi386 double fault: %ebx printout was missed
Konstantin Belousov [Mon, 5 Sep 2022 07:52:46 +0000 (10:52 +0300)]
i386 double fault: %ebx printout was missed

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

21 months agoip_reass: use correct comparison in ipreass_callout()
Gleb Smirnoff [Wed, 14 Sep 2022 15:32:07 +0000 (08:32 -0700)]
ip_reass: use correct comparison in ipreass_callout()

Reported-by: syzbot+55415dc73f9b89b87fce@syzkaller.appspotmail.com

21 months agonxprtc: Fix timing issue with register access.
Tetsuya Uemura [Wed, 14 Sep 2022 13:34:15 +0000 (07:34 -0600)]
nxprtc: Fix timing issue with register access.

My Adafruit PCF8523 RTC on either RPi2B or RPi3B+ failed to work around
80 ~ 90 % of boot-ups, by printing the following log lines.

nxprtc0: <NXP PCF8523 RTC> at addr 0xd0 on iicbus0
nxprtc0: cannot set up timer
Warning: no time-of-day clock registered, system time will not be set accurately

This is due to pcf8523_start_timer(sc) returned non-zero in
nxprtc_start() due to a register read failure of PCF8523_R_TMR_A_FREQ or
PCF8523_R_TMR_CLKOUT or a failure to program a new value.

The pause_sbt("nxpbat") sleep was too short and caused the register
access failures.

PR: 266093

21 months agoCapitalize title like in all other titles.
Jens Schweikhardt [Wed, 14 Sep 2022 11:42:43 +0000 (13:42 +0200)]
Capitalize title like in all other titles.

21 months agoCorrect typos: s/mit Aksenten/mit Akzenten
Jens Schweikhardt [Wed, 14 Sep 2022 09:53:44 +0000 (11:53 +0200)]
Correct typos: s/mit Aksenten/mit Akzenten