]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 months agoleapseconds: Update to the canonical place.
Warner Losh [Tue, 6 Feb 2024 23:11:38 +0000 (16:11 -0700)]
leapseconds: Update to the canonical place.

IERS is the source of truth for leap seconds. Their leapsecond file is
updated most quickly and is always right (unlike the IANA one which
often lags). IERS operates this public service for the express purpose
of random people downloading it. Their terms of service are compatible
with open source (we could include this in our release). Rather than
fighting with questions around this because the IANA one changed
locations or the auto update script broken, just use this.

This is in preference to the NIST ftp copy. NIST is in the process of
retiring their FTP services.

Sponsored by: Netflix
Reviewed by: philip, delphij, cy
Differential Revision: https://reviews.freebsd.org/D43752

3 months agoarm: Move locore-v6.S to locore.S
Warner Losh [Tue, 6 Feb 2024 22:46:06 +0000 (15:46 -0700)]
arm: Move locore-v6.S to locore.S

As a separate commit, now move locore-v6.S to locore.S. This makes git
annotate work, at least back to 2014 when Ian created locore-v6.S. svn
didn't save enough metadata for the converter to allow it to go back
further.

Sponsored by: Netflix

3 months agoarm: Use locore-v6.S directly
Warner Losh [Tue, 6 Feb 2024 22:42:03 +0000 (15:42 -0700)]
arm: Use locore-v6.S directly

Use locore-v6.S directly, rather than indirectly via including
locore.S. This loses acle-compat.h inclusion, but that's only needed for
gcc 4.8 and earlier. Since we don't support anything that old, there's
no need for it here.

Sponsored by: Netflix

3 months agoarm: Catchup to atmel retirement
Warner Losh [Tue, 6 Feb 2024 22:26:17 +0000 (15:26 -0700)]
arm: Catchup to atmel retirement

AT91 boot2 loaders have been long gone, and don't support the AT91 parts
that have armv7 cores (since we don't have specific support for
that). Mentioning its interface is OBE, so remove it.

Sponsored by: Netflix

3 months agoddb: Remove useless includes
Warner Losh [Tue, 6 Feb 2024 22:20:02 +0000 (15:20 -0700)]
ddb: Remove useless includes

systm.h was included for boothowto here, but it's not used here, so drop
this include. Also sys/cdefs.h isn't needed, drop it too.

Sponsored by: Netflix

3 months agovnic: fix compilation of an IPv6 only kernel
Michael Tuexen [Tue, 6 Feb 2024 21:47:16 +0000 (22:47 +0100)]
vnic: fix compilation of an IPv6 only kernel

MFC after: 1 week
Sponsored by: Netflix, Inc.

3 months agogit-arc: Retain color status messages
Warner Losh [Tue, 6 Feb 2024 21:16:51 +0000 (14:16 -0700)]
git-arc: Retain color status messages

Newer versions of archanist have an --ansi option to always include the
ansi colors when doing an arc list (or any command really). Add this to
the arc list that's relevant. Add filter to filter out the 'bolding'
though since that interferes with our parsing. This should restore the
color output after df834e06bbc7.

Fixes: df834e06bbc7
Sponsored by: Netflix
Reviewed by: markj, jhb
Differential Revision: https://reviews.freebsd.org/D43459

3 months agolibcompat: silence -Wdeprecated-non-prototype
Piotr Pawel Stefaniak [Sat, 3 Feb 2024 18:12:42 +0000 (19:12 +0100)]
libcompat: silence -Wdeprecated-non-prototype

by removing unnecessary re-declarations and converting K&R-style
function definitions.

Differential Revision: https://reviews.freebsd.org/D43723
Reviewed by: imp, emaste

3 months agopf: add a probe point to BOUND_IFACE
Kristof Provost [Fri, 2 Feb 2024 20:51:50 +0000 (21:51 +0100)]
pf: add a probe point to BOUND_IFACE

It's been useful at least once, so we may as well keep it.

Sponsored by: Rubicon Communications, LLC ("Netgate")

3 months agoRevert "hier.7: add /lib/casper directory"
Konstantin Belousov [Tue, 6 Feb 2024 04:48:16 +0000 (06:48 +0200)]
Revert "hier.7: add /lib/casper directory"

This reverts commit 407345752d0330766c86b5600740152c34be3ff0.
No longer needed since helpers are moved to /lib.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D43758

3 months agopf: Ensure that st->kif is obtained in a way which respects the r->rpool->mtx mutex
Kajetan Staszkiewicz [Mon, 5 Feb 2024 16:22:31 +0000 (17:22 +0100)]
pf: Ensure that st->kif is obtained in a way which respects the r->rpool->mtx mutex

The redirection pool stored in r->rpool.cur is used for loadbalancing
and cur can change whenever loadbalancing happens, which is for every
new connection. Therefore it can't be trusted outside of pf_map_addr()
and the r->rpool->mtx mutex. After evaluating the ruleset, loadbalancing
decission is made in pf_map_addr() called from within pf_create_state()
and stored in the state itself.

This patch modifies BOUND_IFACE() so that it only uses the information
already stored in the state which has been obtained in a way which
respects the r->rpool->mtx mutex.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D43741

3 months agoRevert "pf: Ensure that st->kif is obtained in a way which respects the r->rpool...
Kristof Provost [Tue, 6 Feb 2024 16:22:59 +0000 (17:22 +0100)]
Revert "pf: Ensure that st->kif is obtained in a way which respects the r->rpool->mtx mutex"

This commit is correct, but was misattributed. Revert so we can re-apply
with the correct author set.

This reverts commit 6d4a140acfdf637bb559d371c583e4db478e1549.

3 months agovmm: Fix compiling error with BHYVE_SNAPSHOT
Vitaliy Gusev [Tue, 6 Feb 2024 15:36:17 +0000 (10:36 -0500)]
vmm: Fix compiling error with BHYVE_SNAPSHOT

The return values of copyin() and copyout() must be checked.
vm_snapshot_buf_cmp() is unused by the kernel and was incorrectly
implemented, so just remove it.

Reviewed by: markj
Sponsored by: vStack
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43754

3 months agoarm64: Add netmap(4) to default kernel config
Daniel Roethlisberger [Tue, 6 Feb 2024 15:26:13 +0000 (10:26 -0500)]
arm64: Add netmap(4) to default kernel config

Allows the development, testing and deployment of netmap(4)-based code
on arm64 without having to recompile the kernel.  netmap(4) is already
in the amd64 and powerpc64 default configs, so it does not seem
unreasonable to also provide it on arm64 by default.

Note that netmap(4) is useful even on systems without NIC that fully
support it.

Reviewed by: vmaffione
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D43702

3 months agomsgs: Use C99 bool instead of defining our own
Collin Funk [Tue, 6 Feb 2024 12:40:05 +0000 (04:40 -0800)]
msgs: Use C99 bool instead of defining our own

Use stdbool.h definitions instead of defining non-standard ones.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Pull-request: https://github.com/freebsd/freebsd-src/pull/1105

3 months agofix poweroff regression from 9cdf326b4f by delaying shutdown_halt
Andriy Gapon [Tue, 6 Feb 2024 08:55:13 +0000 (10:55 +0200)]
fix poweroff regression from 9cdf326b4f by delaying shutdown_halt

The regression affected ACPI-based systems without EFI poweroff support
(including VMs).

The key reason for the regression is that I overlooked that poweroff is
requested by RB_POWEROFF | RB_HALT combination of flags.  In my opinion,
that command is a bit bipolar, but since we've been doing that forever,
then so be it.  Because of that flag combination, the order of
shutdown_final handlers that check for either flag does matter.

Some additional complexity comes from platform-specific shutdown_final
handlers that aim to handle multiple reboot options at once.  E.g.,
acpi_shutdown_final handles both poweroff and reboot / reset.  As
explained in 9cdf326b4f, such a handler must run after shutdown_panic to
give it a chance.  But as the change revealed, the handler must also run
before shutdown_halt, so that the system can actually power off before
entering the halt limbo.

Previously, shutdown_panic and shutdown_halt had the same priority which
appears to be incompatible with handlers that can do both poweroff and
reset.

The above also applies to power cycle handlers.

PR: 276784
Reported by: many
Tested by: Katsuyuki Miyoshi <katsubsd@gmail.com>,
Masachika ISHIZUKA <ish@amail.plala.or.jp>
Fixes: 9cdf326b4fae run acpi_shutdown_final later to give other handlers a chance
MFC after: 1 week

3 months agoofed: fix warnings during libibverbs compilation
Bartosz Sobczak [Tue, 6 Feb 2024 02:43:48 +0000 (18:43 -0800)]
ofed: fix warnings during libibverbs compilation

create_qp_handle_resp_common_cleanup should be void
__ibv_cleanup_wq should use wq->cond for cond destroy
both issues were overlooked in:
a687910 ('Cleanup pthread locks in ofed RDMA verbs')

Signed-off-by: Bartosz Sobczak <bartosz.sobczak@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: sean.lim@dell.com, vangyzen@, erj@
MFC after: 1 day
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D43491

3 months agospeaker: Use standard C bool
John Baldwin [Mon, 5 Feb 2024 23:40:34 +0000 (15:40 -0800)]
speaker: Use standard C bool

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43717

3 months agoi386: Use bool for booleans in getmemsize
John Baldwin [Mon, 5 Feb 2024 23:39:31 +0000 (15:39 -0800)]
i386: Use bool for booleans in getmemsize

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43716

3 months agofib_algo(4): Lower level of algorithm switching messages to LOG_INFO
Marius Strobl [Mon, 5 Feb 2024 19:36:13 +0000 (20:36 +0100)]
fib_algo(4): Lower level of algorithm switching messages to LOG_INFO

Otherwise, with the default flm_debug_level of LOG_NOTICE, it's rather
easy to trigger debug messages such as:
[fib_algo] inet.0 (bsearch4#18) rebuild_fd_flm: switching algo to
radix4_lockless

Also, the "severity" of these events generally only justifies LOG_INFO
and not LOG_NOTICE.

Reviewed by: melifaro

3 months agosdhci_fsl_fdt(4): Actually use modified SDHCI capabilities
Marius Strobl [Mon, 5 Feb 2024 19:08:33 +0000 (20:08 +0100)]
sdhci_fsl_fdt(4): Actually use modified SDHCI capabilities

SDHCI_QUIRK_MISSING_CAPS needs to be set unconditionally so sdhci(4)
adheres to the slot caps and caps2 set by sdhci_fsl_fdt(4). However,
so far this bug didn't have an impact as the front-end only filters
SDHCI_CAN_DO_SUSPEND, which in turn isn't used, yet.

3 months agoacpica: Create merge commit against vendor branch
Warner Losh [Mon, 5 Feb 2024 22:13:57 +0000 (15:13 -0700)]
acpica: Create merge commit against vendor branch

Merge tracking branch 'vendor/acpica' for vendor/acpica/20230628, and
resolve conflicts.

This deletes files that we've deleted since the last merge (during SVN
times it seems) so future merges don't bring them up.

It resolves conflicts in several files that we have modified (but we can
likely fix the build system so we don't have to modify them since it's
almost all headers) and one ifndef kernel that could be solved with an
empty #define.

It also deletes new files in the platform directory that are similar to
prior non-freebsd platform files we've deleted.

The net delta: +1 line.

Sponsored by: Netflix

3 months agopf: Ensure that st->kif is obtained in a way which respects the r->rpool->mtx mutex
Igor Ostapenko [Mon, 5 Feb 2024 16:22:31 +0000 (17:22 +0100)]
pf: Ensure that st->kif is obtained in a way which respects the r->rpool->mtx mutex

The redirection pool stored in r->rpool.cur is used for loadbalancing
and cur can change whenever loadbalancing happens, which is for every
new connection. Therefore it can't be trusted outside of pf_map_addr()
and the r->rpool->mtx mutex. After evaluating the ruleset, loadbalancing
decission is made in pf_map_addr() called from within pf_create_state()
and stored in the state itself.

This patch modifies BOUND_IFACE() so that it only uses the information
already stored in the state which has been obtained in a way which
respects the r->rpool->mtx mutex.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D43741

3 months agolibc: make syscall stubs empty for shared lib
Brooks Davis [Fri, 5 Jan 2024 19:04:53 +0000 (19:04 +0000)]
libc: make syscall stubs empty for shared lib

They are always replaced by libsys so just make them empty.  In
https://reviews.freebsd.org/D14609 x86 variants call abort2, but that
requires per-arch assembly and should be of low value in the steady
state.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agoSYS.h: make _SYSCALL_BODY overridable
Brooks Davis [Fri, 5 Jan 2024 18:33:37 +0000 (18:33 +0000)]
SYS.h: make _SYSCALL_BODY overridable

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: link libsys as a auxiliary filter library
Brooks Davis [Wed, 15 Nov 2023 23:35:16 +0000 (23:35 +0000)]
libc: link libsys as a auxiliary filter library

At runtime, when rtld loads libc it will also load libsys.  For each
symbol that is present in both, the libsys one will override the libc
one.  It continues to be the case that program need only link against
libc (usually implicitly).  The linkage to libsys is automatic.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibthr: move _umtx_op_err() to libsys
Brooks Davis [Wed, 17 Jan 2024 20:26:52 +0000 (20:26 +0000)]
libthr: move _umtx_op_err() to libsys

Declare in sys/umtx.h and implement in libsys.  Explicitly link libthr
with libsys.

When building libthr static include _umtx_op_err so we don't break static
linkage with -lpthread.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibsys: plumb in to build
Brooks Davis [Wed, 15 Nov 2023 23:31:57 +0000 (23:31 +0000)]
libsys: plumb in to build

libsys provides the FreeBSD kernel interface (auxargs, system calls,
vdso).  It can be linked directly for programs using a non-standard
libc and will later be linked as a filter library to libc providing
the actual system call implementation.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibsys: generate private symbol map
Brooks Davis [Tue, 21 Nov 2023 18:30:00 +0000 (18:30 +0000)]
libsys: generate private symbol map

We now export all _ and __sys_ prefixed syscalls stubs from libc and
libsys so that libsys can replace them.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agomakesyscalls: generate private syscall symbols
Brooks Davis [Tue, 21 Nov 2023 16:55:06 +0000 (16:55 +0000)]
makesyscalls: generate private syscall symbols

For libsys we need to expose all the private symbols (_ and __sys_
prefixes) so libsys can replace the libc versions.  Rather than trying
to maintain a table, teach makesyscalls to generate it.

There are a small number of "_" prefixed symbols that are exposed as
public interfaces rather than in the private symbol space.  Since the
list is short, just hardcode it for now.

If doesn't appear that we need to export freebsd#_foo symbols for compat
system calls explicitly.  If it turns out we do, there are probably few
enough of them to handle seperately.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: move __getosreldate to libsys
Brooks Davis [Fri, 17 Nov 2023 20:13:40 +0000 (20:13 +0000)]
libc: move __getosreldate to libsys

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: move getpagesize(s) to libsys
Brooks Davis [Fri, 17 Nov 2023 18:55:25 +0000 (18:55 +0000)]
libc: move getpagesize(s) to libsys

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: elf auxiliary vector handling to libsys
Brooks Davis [Wed, 15 Nov 2023 20:53:28 +0000 (20:53 +0000)]
libc: elf auxiliary vector handling to libsys

This is part of the interface to the kernel and some syscall wrappers
depend on it so move it there.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: compile _once in libsys
Brooks Davis [Tue, 21 Nov 2023 18:30:43 +0000 (18:30 +0000)]
libc: compile _once in libsys

auxv support requires _once(), but we don't want the libsys version
stomping on the libc version should they diverge in the future.  We
could rename it entierly, but for now just hook it in via Makefile.sys.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: move MD sys related symbols to libsys
Brooks Davis [Wed, 15 Nov 2023 21:48:45 +0000 (21:48 +0000)]
libc: move MD sys related symbols to libsys

This is a mix genuine MD interfaces and compat symbols like _getlogin.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: move rfork_thread(3) to libsys
Brooks Davis [Wed, 15 Nov 2023 21:44:43 +0000 (21:44 +0000)]
libc: move rfork_thread(3) to libsys

rfork_thread(3) is assembly that makes syscalls directly and uses
cerror so it belongs in libsys.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: Move per-arch sys/Makefile.inc to libsys
Brooks Davis [Tue, 14 Nov 2023 22:25:24 +0000 (22:25 +0000)]
libc: Move per-arch sys/Makefile.inc to libsys

libc/<arch>/sys/Makefile.inc -> libsys/<arch>/Makefile.sys.

Require that libsys/<arch>/Makefile.sys exist.  At least for current
archtiectures, it's not possible for an architecture to not have and MD
syscall bits.

powerpcspe/Makefile.sys's structure means it had to be modified when moved
so rename detection won't work, but it has trivial contents so the
history is unimportant.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: remove .PATH refs to libc/<arch>/sys
Brooks Davis [Tue, 14 Nov 2023 22:11:34 +0000 (22:11 +0000)]
libc: remove .PATH refs to libc/<arch>/sys

There are no longer any source files here so remove references.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: remove remaining x86 sys bits to libsys
Brooks Davis [Tue, 14 Nov 2023 22:05:59 +0000 (22:05 +0000)]
libc: remove remaining x86 sys bits to libsys

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: libc/<arch>/sys/__vdso_gettc -> libsys/<arch>/
Brooks Davis [Tue, 14 Nov 2023 21:39:35 +0000 (21:39 +0000)]
libc: libc/<arch>/sys/__vdso_gettc -> libsys/<arch>/

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: libc/gen/sched_getcpu_gen.c -> libsys/
Brooks Davis [Tue, 14 Nov 2023 21:35:01 +0000 (21:35 +0000)]
libc: libc/gen/sched_getcpu_gen.c -> libsys/

It is a trivial system call wrapper.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibsys: move __libsys_interposer consumers
Brooks Davis [Tue, 16 Jan 2024 22:25:07 +0000 (22:25 +0000)]
libsys: move __libsys_interposer consumers

These system call wrappers call interposed system calls in fairly
trivial ways.  Move them over to libsys so all __libsys_interposer
consumers end up in libsys.

Also move recvmmsg and sendmmsg as they are documented with recv and
send.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: libc/sys/Makefile.inc -> libsys/Makefile.sys
Brooks Davis [Tue, 14 Nov 2023 20:19:10 +0000 (20:19 +0000)]
libc: libc/sys/Makefile.inc -> libsys/Makefile.sys

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibsys: relocate implementations and manpages
Brooks Davis [Tue, 14 Nov 2023 17:54:03 +0000 (17:54 +0000)]
libsys: relocate implementations and manpages

Remove core system call implementations and documentation to lib/libsys
and lib/libsys/<arch> from lib/libc/sys and lib/libc/<arch>/<sys>.
Update paths to allow libc to find them in their new home.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: split libc and syscall interposing (2/2)
Brooks Davis [Tue, 16 Jan 2024 22:51:40 +0000 (22:51 +0000)]
libc: split libc and syscall interposing (2/2)

Move the __libc_interposing implementation to libc/gen so it doesn't end
up in libsys.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agolibc: split libc and syscall interposing (1/2)
Brooks Davis [Tue, 16 Jan 2024 20:16:39 +0000 (20:16 +0000)]
libc: split libc and syscall interposing (1/2)

System calls or their wrappers are now interposed by
__libsys_interposing with purely libc entries remaining in
__libc_interposing.

Use __libsys_interposing_slot in libthr to update __libsys_interposing,
but also make __libc_interposing_slot fall back to
__libsys_interposing_slot so an out of date libc has a chance of working
during updates.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908

3 months agoOpenSSL: Update date string
Cy Schubert [Mon, 5 Feb 2024 20:09:08 +0000 (12:09 -0800)]
OpenSSL: Update date string

Reported by: "Herbert J. Skuhra" <herbert@gojira.at>
Fixes: 74fe298c8299
MFC after: 3 days

3 months agovtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT
Warner Losh [Mon, 5 Feb 2024 05:43:49 +0000 (22:43 -0700)]
vtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT

Some platforms require an adjustment of the ethernet hearders. Rather
than make this be on __NO_STRICT_ALIGNMENT being defined, define
VTNET_ETHER_ALIGN to be either 0 or ETHER_ALIGN (aka 2). Add a test to
the if statements to only do them when != 0. This eliminates the #ifdef
sprinkled in the code, still communicates the intent and gives the same
compiled results.

Sponsored by: Netflix
Reviewed by: bz, bryanv
Differential Revision: https://reviews.freebsd.org/D43654

3 months agovtnet: Account for the padding when selecting allocation size
Warner Losh [Mon, 5 Feb 2024 05:43:39 +0000 (22:43 -0700)]
vtnet: Account for the padding when selecting allocation size

While we account for the padding in the length of the mbuf we use, we do
not account for it when we 'guess' the size of the mbuf to allocate
based in the MTU of the device. This leads to a situation where we might
fail if the mtu is close to a bucket size (say 2018) such that the added
padding would push us over the edge for a full-sized packet. mtu of 2018
is super rare (2016 and 2020 would both work), but fix it none-the-less.
It's a shame we can't just set VTNET_RX_HEADER_PAD to 2 in this case. The 4
seems hard-coded somewhere I've not found documented (I think it's in the
protocol given the comments about VIRTIO_F_ANY_LAYOUT).

Sponsored by: Netflix
Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D43656

3 months agosubr_firmware: Sort includes
Warner Losh [Mon, 5 Feb 2024 03:12:37 +0000 (20:12 -0700)]
subr_firmware: Sort includes

Sponsored by: Netflix

3 months agolibjail: Guard against programmer error in jailparam_export()
Mark Johnston [Sun, 4 Feb 2024 02:22:09 +0000 (21:22 -0500)]
libjail: Guard against programmer error in jailparam_export()

If the caller didn't use jailparam_import() to fetch the parameter
value, an attempt to export it will trigger a segfault.  Make it a bit
easier to figure out what's happening in this situation.

PR: 276809
Reviewed by: jamie
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43732

3 months agoloader: For EFI, if we don't have ConOut, try ConIn
Warner Losh [Sun, 4 Feb 2024 21:09:48 +0000 (14:09 -0700)]
loader: For EFI, if we don't have ConOut, try ConIn

Try ConIn if we don't have a ConOut variable. ConIn will contain HID
devices and/or serial devices. We currently just search for serial
devices and will use them instead of video with the current code. While
ConIn w/o ConOut is fairly common on laptops, is kinda rare on servers.
Some refinement may be needed in the future if servers come to
light. This is also minimal to allow possible integration into 13.3
release.

MFC After: 1 week
Sponsored by: Netflix
Reviewed by: dab, tsoome
Differential Revision: https://reviews.freebsd.org/D43714

3 months agofusefs: fix invalid value for st_birthtime.tv_nsec
Alan Somers [Thu, 25 Jan 2024 15:19:37 +0000 (08:19 -0700)]
fusefs: fix invalid value for st_birthtime.tv_nsec

If a file system's on-disk format does not support st_birthtime, it
isn't clear what value it should return in stat(2).  Neither our man
page nor the OpenGroup specifies.  But our convention for UFS and
msdosfs is to return { .tv_sec = -1, .tv_nsec = 0 }.  fusefs is
different.  It returns { .tv_sec = -1, .tv_nsec = -1 }.  It's done that
ever since the initial import in SVN r241519.

Most software apparently handles this just fine.  It must, because we've
had no complaints.  But the Rust standard library will panic when
reading such a timestamp during std::fs::metadata, even if the caller
doesn't care about that particular value.  That's a separate bug, and
should be fixed.

Change our invalid value to match msdosfs and ufs, pacifying the Rust
standard library.

PR: 276602
MFC after: 1 week
Sponsored by: Axcient
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D43590

3 months agobsdinstall: complete whitelabeling the installer
Mariusz Zaborski [Sun, 4 Feb 2024 11:59:07 +0000 (12:59 +0100)]
bsdinstall: complete whitelabeling the installer

The commit 147585b4893bc38698aaa971af336b241477eac3 introduces
whitlabeling. This commit addresses couple more places where the
os name was missed.

Reviewed by: imp, asiciliano, brd
Differential Revision: https://reviews.freebsd.org/D43638

3 months agolibstdthreads: destroy mutexattr in mtx_init()
Hodong [Sun, 4 Feb 2024 10:14:22 +0000 (12:14 +0200)]
libstdthreads: destroy mutexattr in mtx_init()

PR: 276818
MFC after: 1 week

3 months agopmap: Reflect 1f1b228 in man page
Minsoo Choo [Sun, 4 Feb 2024 01:10:16 +0000 (20:10 -0500)]
pmap: Reflect 1f1b228 in man page

Fixes: 1f1b2286fd5a ("pmap: Convert boolean_t to bool.")
Differential Revision: https://reviews.freebsd.org/D43729

3 months agolibc: Specify parameter types for function pointer
Minsoo Choo [Sun, 4 Feb 2024 01:07:18 +0000 (20:07 -0500)]
libc: Specify parameter types for function pointer

Reviewed by: dab
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43726

3 months agobsdinstall: Fix broken netconfig persistence for installed system
Jessica Clarke [Sat, 3 Feb 2024 22:50:47 +0000 (22:50 +0000)]
bsdinstall: Fix broken netconfig persistence for installed system

The replacement of echo >> with sysrc -f used sysrc key value, which
means "read variables key and value" and thus did nothing useful (and in
fact emitted errors to the log about neither existing). Instead use the
correct sysrc key=value form so the installed system comes back up with
working networking.

Fixes: 60b37735f305 ("bsdinstall netconfig: avoid duplicate entries in rc.conf")

3 months agounix: synchronize shutdown(2) with read(2)
Gleb Smirnoff [Sat, 3 Feb 2024 21:08:41 +0000 (13:08 -0800)]
unix: synchronize shutdown(2) with read(2)

unp_dispose() is called on shutdown(2) and thus needs to acquire socket
I/O receive sx(9) to synchronize with read(2) that may read top of the
buffer without socket buffer mutex.  Notice in the last chunk of the diff
that the function used to be called with the lock already acquired in the
past.

3 months agoRevert "sockets: retire sorflush()"
Gleb Smirnoff [Sat, 3 Feb 2024 21:08:41 +0000 (13:08 -0800)]
Revert "sockets: retire sorflush()"

Provide a comment in sorflush() why the socket I/O sx(9) lock is actually
important.

This reverts commit 507f87a799cf0811ce30f0ae7f10ba19b2fd3db3.

3 months agocdefs: Introduce __result_use_or_ignore_check
Mark Johnston [Sat, 3 Feb 2024 19:16:50 +0000 (14:16 -0500)]
cdefs: Introduce __result_use_or_ignore_check

Try to paper over inconsistent semantics for __warn_unused_result__
between clang and gcc.  See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 for a spirited
discussion of these semantics.

Introduce __result_use_or_ignore_check, which allows callers to
explicitly ignore the return value with a cast to void.  Use that to
restore some checking for copyout() and friends, previously removed in
commit d07acc58d898 ("systm: Relax __result_use_check annotations").

Reviewed by: olce, rpokala, kib, emaste
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D43426

3 months agoctfmerge: Remove function cast of strcompare() for qsort()
Minsoo Choo [Sat, 3 Feb 2024 19:06:49 +0000 (14:06 -0500)]
ctfmerge: Remove function cast of strcompare() for qsort()

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43715

3 months agopmap: Reflect commit 1f1b228 in man page
Minsoo Choo [Sat, 3 Feb 2024 18:41:22 +0000 (13:41 -0500)]
pmap: Reflect commit 1f1b228 in man page

Reviewed by: mhorne
Fixes: 1f1b2286fd5a ("pmap: Convert boolean_t to bool.")
Differential Revision: https://reviews.freebsd.org/D43722

3 months agonet80211: make sure calls to (*iv_update_bss)() are locked
Bjoern A. Zeeb [Fri, 19 Jan 2024 14:52:03 +0000 (14:52 +0000)]
net80211: make sure calls to (*iv_update_bss)() are locked

It turned out thare various calls into (*iv_update_bss)(), that is
direct changes to vap->iv_bss in the old days, happened without
synchronisation.

Use locking assertions to document the requirement or status quo
at some callers given ic locking will eventually have to be dealt
with.

MFC after: 3 days
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43512

3 months agonet80211: fix a NULL deref in ieee80211_sta_join1()
Bjoern A. Zeeb [Tue, 16 Jan 2024 18:53:06 +0000 (18:53 +0000)]
net80211: fix a NULL deref in ieee80211_sta_join1()

When ieee80211_sta_join1() gets an obss without ni_nt trying to lock
that will cause a NULL pointer deref.  Check for the table to be
valid and deal with the obss node accordingly.

This can happen if sta_newstate() calls ieee80211_reset_bss() for
nstate == INIT and ostate != INIT.  ieee80211_reset_bss() itself
calls ieee80211_node_table_reset() which calls node_reclaim()
which ends up in ieee80211_del_node_nt() which does remove the
node from the table and sets ni_table to NULL.
That node (former iv_bss) can then be returned as obss in the
(*iv_update_bss)() call in join1().

MFC after: 3 days
Reviewed by: adrian, cc
Differential Revision: https://reviews.freebsd.org/D43469

3 months agoLinuxKPI: implement memset_after()
Bjoern A. Zeeb [Mon, 29 Jan 2024 14:19:59 +0000 (14:19 +0000)]
LinuxKPI: implement memset_after()

memset_after() is needed by iwlwifi d3.c.

MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D43644

3 months agoiwlwifi: add the d3 (PM) bits to the Makefile (disabled)
Bjoern A. Zeeb [Mon, 29 Jan 2024 12:51:16 +0000 (12:51 +0000)]
iwlwifi: add the d3 (PM) bits to the Makefile (disabled)

Add the logic to conditionally enable PM for iwlwifi.
This should help suspend/resume in the future.
For now leave it disabled until other preconditional problems are
sorted.

Sponsored by: The FreeBSD Foundation (2023)
MFC after: 3 days
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43647

3 months agoiwlwifi: adjust to make d3.c compile
Bjoern A. Zeeb [Mon, 29 Jan 2024 14:23:01 +0000 (14:23 +0000)]
iwlwifi: adjust to make d3.c compile

struct iwl_mvm_wep_key_cmd ends in a variable sized array but later
is included in another struct followed by the actual
struct iwl_mvm_wep_key in d3.c.  Make the array[0] instead of []
to avoid the warning about it being a GNU-extension.
Also include string.h explicitly for memset_after().

MFC after: 3 days
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43647

3 months agoLinuxKPI: 802.11: extend ieee80211_key_seq and WLAN_KEY_LEN_* defines
Bjoern A. Zeeb [Mon, 29 Jan 2024 14:21:17 +0000 (14:21 +0000)]
LinuxKPI: 802.11: extend ieee80211_key_seq and WLAN_KEY_LEN_* defines

For iwlwifi(4) d3.c we need another struct in struct ieee80211_key_seq
and related WLAN_KEY_LEN_* defines in.

MFC after: 3 days
Reviewed by: cc, emaste
Differential Revision: https://reviews.freebsd.org/D43646

3 months agoLinuxKPI: 802.11: fix field order in ieee80211_key_conf
Bjoern A. Zeeb [Sun, 28 Jan 2024 00:51:23 +0000 (00:51 +0000)]
LinuxKPI: 802.11: fix field order in ieee80211_key_conf

When adding the new field link_id to struct ieee80211_key_conf, it
was erroneously placed at the end of the struct;  the zero-length
(variable sized) array for the key always needs to stay last.
Resort fields and add hopefully helpful comment to avoid the problem
in the future.

Fixes: adff403fe7a87
MFC after: 3 days
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43635

3 months agoReapply "pkgbase: Create a FreeBSD-dtb package"
Emmanuel Vadot [Fri, 2 Feb 2024 18:25:55 +0000 (19:25 +0100)]
Reapply "pkgbase: Create a FreeBSD-dtb package"

This reverts commit 9bbe06b004e2cadb55a3792c77991ee640bf0f52.

Before that dtbs where included in each kernel packages which prevents
us to install multiple kernels.

Fix mtree-to-plist.awk to only generate a dtb.plist when we create
the kernel one (because dtb are installed during make installkernel).

Sponsored by:   Beckhoff Automation GmbH & Co. KG

3 months agotests/netinet: push variable 'sin' into function scope
Gleb Smirnoff [Sat, 3 Feb 2024 05:08:16 +0000 (21:08 -0800)]
tests/netinet: push variable 'sin' into function scope

This should fix build with GCC 13.

Fixes: 861274c9f8cf2a5c00ded9580ea91b22def683f7

3 months agoipf: Fix some typos
Elyes Haouas [Sun, 15 Oct 2023 16:03:11 +0000 (18:03 +0200)]
ipf: Fix some typos

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
3 months agovt.4: explain console fonts
Alexander Ziaee [Mon, 15 Jan 2024 19:54:20 +0000 (14:54 -0500)]
vt.4: explain console fonts

Add explaination about console fonts, how to convert them, which subset
of things support them and how to use them.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1063

3 months ago.github: Enable manually running github actions
Andrew Turner [Fri, 27 Oct 2023 16:02:55 +0000 (17:02 +0100)]
.github: Enable manually running github actions

Sponsored by: Arm Ltd

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/878

3 months ago.github: Build stable/14
Andrew Turner [Fri, 27 Oct 2023 16:26:15 +0000 (17:26 +0100)]
.github: Build stable/14

Sponsored by: Arm Ltd

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/878

3 months agoinclude/math.h: fix warning with -Wconversion
Martin Oliveira [Tue, 12 Sep 2023 20:31:00 +0000 (14:31 -0600)]
include/math.h: fix warning with -Wconversion

The way the __fp_type_select macro uses the _Generic expression causes
gcc to throw a warning on valid code if the -Wconversion flag is used.

For example, consider the following program:

    #include <math.h>
    int main()
    {
     double x = 1.0;
     isnan(x);
     return 0;
    }

which throws a warning:

    $ gcc -Wconversion a.c
    a.c:5:15: warning: conversion from 'double' to 'float' may change value [-Wfloat-conversion]
        5 |         isnan(x);
          |               ^

This happens because the functions are invoked inside of the _Generic.
Looking at the example of _Generic in the C11 specification, one sees
that the parameters are outside of the _Generic expression (see page 79
here: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf).

Reference: https://stackoverflow.com/a/68309379
Signed-off-by: Martin Oliveira <martin.oliveira@eideticom.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/841

3 months agorelease: Add the Ed25519 vagrant insecure key
Jose Luis Duran [Sat, 4 Nov 2023 00:17:19 +0000 (00:17 +0000)]
release: Add the Ed25519 vagrant insecure key

Both insecure keys, RSA and Ed25519, are required.

Obtained from: https://github.com/hashicorp/vagrant/commit/b40f6e5fdae1113518e9c92f96dfcd364b646ff9
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/835

3 months agorelease: Allow sudo -g anyone and sudo -u anyone -g anytwo
Jose Luis Duran [Mon, 4 Sep 2023 16:45:52 +0000 (16:45 +0000)]
release: Allow sudo -g anyone and sudo -u anyone -g anytwo

When only the user (ALL) is specified explicitly, and the group is
implied, only sudo -u works.  Specifying both the user and group, like
(ALL:ALL), is required to:

1. Use sudo -g by itself (with no -u user)
2. Use sudo -u and -g together, with a -g group that is different from
   the -u user's primary group

Obtained from: https://github.com/sudo-project/sudo/commit/1d13533ea3cda05ec666c45c6c533b614fdd97aa
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/835

3 months agourndis(4): retrospective, address for hselasky
Graham Perrin [Sat, 2 Sep 2023 18:25:52 +0000 (19:25 +0100)]
urndis(4): retrospective, address for hselasky

PR: 273530
Fixes: 08c9016bc61b Add a manpage for the urndis driver.
Signed-off-by: Graham Perrin <grahamperrin@gmail.com>
Reviewed-by: imp, zlei
Pull-request: https://github.com/freebsd/freebsd-src/pull/834

3 months agotraceroute: Remove $FreeBSD$ rcsid tags
Jose Luis Duran [Fri, 17 Nov 2023 18:36:30 +0000 (18:36 +0000)]
traceroute: Remove $FreeBSD$ rcsid tags

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901

3 months agotraceroute: Lint manuals
Jose Luis Duran [Fri, 17 Nov 2023 16:41:24 +0000 (16:41 +0000)]
traceroute: Lint manuals

Fix a number of warning mandoc -Tlint and igor turned up.  No changes
intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901

3 months agotraceroute: Standardize usage
Jose Luis Duran [Sun, 5 Nov 2023 18:35:23 +0000 (18:35 +0000)]
traceroute: Standardize usage

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901

3 months agotraceroute: Update values in examples
Jose Luis Duran [Sun, 5 Nov 2023 17:57:25 +0000 (17:57 +0000)]
traceroute: Update values in examples

Standardize the documentation and update it to reflect the current
values.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901

3 months agotraceroute: Silence compiler warning
Jose Luis Duran [Fri, 17 Nov 2023 16:15:27 +0000 (16:15 +0000)]
traceroute: Silence compiler warning

Silence the warning:

argument to 'sizeof' in 'strncpy' call is the same expression as the
source; did you mean to use the size of the destination?"

by using strlcpy() and the size of the destination (device).

No functional change intended.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/901

3 months agobsdinstall: Drop Error from title in netconfig no interfaces dialog
Jessica Clarke [Sat, 3 Feb 2024 01:52:53 +0000 (01:52 +0000)]
bsdinstall: Drop Error from title in netconfig no interfaces dialog

This isn't inherently an error. It is if you're attempting to download
dist tarballs or later install packages, but a FreeBSD system with no
NIC is a reasonable setup to have, especially in a throwaway VM setting,
so we shouldn't say it is one.

Leaving the exit code as 1 is still fine, since auto will ignore it, and
avoids breaking other uses.

MFC after: 1 week

3 months agobsdinstall: Fix netconfig script when no interfaces are present
Jessica Clarke [Sat, 3 Feb 2024 01:52:37 +0000 (01:52 +0000)]
bsdinstall: Fix netconfig script when no interfaces are present

The script uses [ -z "$INTERFACES" ] to check if the list of interfaces
is empty and will exit early if so, but INTERFACES always contains at
least a space due to the way it appends the list of wireless devices.
Fix this by only adding the space when there are devices to append,
mirroring the behaviour for non-wireless devices above (both will result
in a redundant leading space when the list is non-empty, but that one is
harmless).

Fixes: 159ca5c844cd ("Adapt to new wireless scheme where base wlan interfaces do not show up in ifconfig anymore.")
MFC after: 1 week

3 months agolib/libfetch/common.c: remove an extra semicolon
rilysh [Sat, 3 Feb 2024 00:38:13 +0000 (17:38 -0700)]
lib/libfetch/common.c: remove an extra semicolon

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959

3 months agolib/libbe/be.c: remove an extra semicolon
rilysh [Sat, 3 Feb 2024 00:38:13 +0000 (17:38 -0700)]
lib/libbe/be.c: remove an extra semicolon

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959

3 months agolib/libvgl/main.c: remove an extra semicolon
rilysh [Sat, 3 Feb 2024 00:38:13 +0000 (17:38 -0700)]
lib/libvgl/main.c: remove an extra semicolon

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959

3 months agosys/arm64/rockchip/rk_gpio.c: remove an extra semicolon
rilysh [Sat, 3 Feb 2024 00:38:13 +0000 (17:38 -0700)]
sys/arm64/rockchip/rk_gpio.c: remove an extra semicolon

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959

3 months agosys/netlink/route/iface.c: remove an extra semicolon
rilysh [Sat, 3 Feb 2024 00:38:13 +0000 (17:38 -0700)]
sys/netlink/route/iface.c: remove an extra semicolon

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959

3 months agosys/fs/unionfs/union_vnops.c: remove an extra semicolon
rilysh [Sat, 3 Feb 2024 00:38:13 +0000 (17:38 -0700)]
sys/fs/unionfs/union_vnops.c: remove an extra semicolon

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959

3 months agosys/compat/linux/linux_misc.c: remove an extra semicolon
rilysh [Sat, 3 Feb 2024 00:38:13 +0000 (17:38 -0700)]
sys/compat/linux/linux_misc.c: remove an extra semicolon

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959

3 months agosys/netpfil/pf/pf.c: remove an extra semicolon
rilysh [Sat, 3 Feb 2024 00:38:13 +0000 (17:38 -0700)]
sys/netpfil/pf/pf.c: remove an extra semicolon

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959

3 months agosys/netpfil/pf/pf.c: remove an extra semicolon
rilysh [Sat, 3 Feb 2024 00:38:12 +0000 (17:38 -0700)]
sys/netpfil/pf/pf.c: remove an extra semicolon

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959

3 months agosys/dev/enic/if_enic.c: remove an extra semicolon
rilysh [Sat, 3 Feb 2024 00:38:12 +0000 (17:38 -0700)]
sys/dev/enic/if_enic.c: remove an extra semicolon

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959

3 months agosys/dev/mii/mcommphy.c: remove an extra semicolon
rilysh [Sat, 3 Feb 2024 00:38:12 +0000 (17:38 -0700)]
sys/dev/mii/mcommphy.c: remove an extra semicolon

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959

3 months agosys/dev/iicbus/pmic/rockchip/rk8xx.c: remove an extra semicolon
rilysh [Sat, 3 Feb 2024 00:38:12 +0000 (17:38 -0700)]
sys/dev/iicbus/pmic/rockchip/rk8xx.c: remove an extra semicolon

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/959

3 months agoqlnx: Fix typo (triple M)
Jose Luis Duran [Sat, 3 Feb 2024 00:35:54 +0000 (17:35 -0700)]
qlnx: Fix typo (triple M)

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/963