Commit graph

289367 commits

Author SHA1 Message Date
Brooks Davis 49d684369c libthr: filter rather than link with libsys
The allows gcc + GNU ld to link programs with -m32 -pthread without
erroring out due to _umtx_op_err being undefined (unless -lsys is added
to the link command.

We now always link _umtx_op_err into libthr (not just when it's static)
and filter it with libsys so we call that implementation.  The dynamic
implementations (at least the assembly ones) should likely become stubs
as a further refinement.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D43783
2024-02-07 19:50:47 +00:00
Brooks Davis 49076f376a libc: don't directly link libsys
It is sufficent to add it as a filter.

Reported by:	kib
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D43781
2024-02-07 19:50:47 +00:00
Jessica Clarke b8afdda360 gicv3_its: Drop a couple of redundant vm_offset_t casts
These are already vm_offset_t, no need to cast.
2024-02-07 16:24:34 +00:00
Mark Johnston f493ea650e vmm: Expose more registers to VM_GET_REGISTER
In a follow-up revision the gdb stub will support sending an XML target
description to gdb, which lets us send additional registers, including
the ones added in this patch.

Reviewed by:	jhb
MFC after:	1 month
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D43665
2024-02-07 08:52:46 -05:00
Mark Johnston e6516294f4 bhyve: Add support for the 'p' query
This lets gdb query individual registers.  It's easy to implement and is
used by gdb when attaching to a CHERI target, so let's support it.

Sponsored by:	Innovate UK
Reviewed by:	corvink, jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D43664
2024-02-07 08:46:59 -05:00
Warner Losh f1e8d3361b acpica: Fix my mismerge
I merged in the limits.h include. I should have resolved this by
deleting it (since we have no easy way to 'fix' it with compat headers).
GENERIC doesn't bring in the debugger, but LINT does...

Sponsored by:		Netflix
2024-02-06 22:47:42 -07:00
Gregory Neil Shapiro 31fbc98c94 Belatedly update version and date for sendmail 8.18.1 upgrade 2024-02-07 02:03:47 +00:00
Brooks Davis 57ddfad884 lib/libc: version auxiliary libsys.so
We need to use libsys.so.7 so that we can work without /usr and because
we're bound a specific ABI.

Reported by:	jtrc27, kib
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D43772
2024-02-07 00:47:04 +00:00
Brooks Davis 11f9745c5b libsys: fix powerpcspe build
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D43771
2024-02-07 00:47:03 +00:00
Warner Losh 11da791920 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
2024-02-06 16:12:59 -07:00
Warner Losh 472f84817d 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
2024-02-06 15:49:08 -07:00
Warner Losh 6949ce0486 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
2024-02-06 15:42:03 -07:00
Warner Losh fc2b8ee6da 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
2024-02-06 15:26:17 -07:00
Warner Losh 9d2c93c249 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
2024-02-06 15:22:01 -07:00
Michael Tuexen 1d3d30c8d2 vnic: fix compilation of an IPv6 only kernel
MFC after:	1 week
Sponsored by:	Netflix, Inc.
2024-02-06 22:47:16 +01:00
Warner Losh e1735b35e3 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 df834e06bb.

Fixes:			df834e06bb
Sponsored by:		Netflix
Reviewed by:		markj, jhb
Differential Revision:	https://reviews.freebsd.org/D43459
2024-02-06 14:16:51 -07:00
Piotr Pawel Stefaniak 12bae251fb 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
2024-02-06 20:32:46 +01:00
Kristof Provost 04c68025ea 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")
2024-02-06 18:47:07 +01:00
Konstantin Belousov 3747af1699 Revert "hier.7: add /lib/casper directory"
This reverts commit 407345752d.
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
2024-02-06 19:27:50 +02:00
Kajetan Staszkiewicz 58a2674314 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
2024-02-06 17:24:28 +01:00
Kristof Provost 8a16fd431d 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 6d4a140acf.
2024-02-06 17:22:59 +01:00
Vitaliy Gusev 7572fe89ad 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
2024-02-06 10:38:34 -05:00
Daniel Roethlisberger df64d7c8c8 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
2024-02-06 10:38:28 -05:00
Collin Funk 912b52a62c 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
2024-02-06 08:37:50 -05:00
Andriy Gapon e4ab361e53 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:		9cdf326b4f run acpi_shutdown_final later to give other handlers a chance
MFC after:	1 week
2024-02-06 10:55:13 +02:00
Bartosz Sobczak 8e1f58caf7
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
2024-02-05 18:58:20 -08:00
John Baldwin c83d83206a speaker: Use standard C bool
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43717
2024-02-05 15:45:32 -08:00
John Baldwin bf20896da4 i386: Use bool for booleans in getmemsize
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43716
2024-02-05 15:39:31 -08:00
Marius Strobl ed81a15517 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
2024-02-05 23:44:38 +01:00
Marius Strobl 069c6ac2c6 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.
2024-02-05 23:43:48 +01:00
Warner Losh a841e54703 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
2024-02-05 15:17:02 -07:00
Igor Ostapenko 6d4a140acf 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
2024-02-05 22:18:11 +01:00
Brooks Davis 8d2e8f7205 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
2024-02-05 20:34:57 +00:00
Brooks Davis f217772244 SYS.h: make _SYSCALL_BODY overridable
Reviewed by:	kib, emaste, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/908
2024-02-05 20:34:56 +00:00
Brooks Davis 0d4f7723bc 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
2024-02-05 20:34:56 +00:00
Brooks Davis ef9871c620 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
2024-02-05 20:34:56 +00:00
Brooks Davis e9d961055a 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
2024-02-05 20:34:56 +00:00
Brooks Davis 86deddfacb 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
2024-02-05 20:34:56 +00:00
Brooks Davis b71defdbd8 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
2024-02-05 20:34:56 +00:00
Brooks Davis 10f1b536ad libc: move __getosreldate to libsys
Reviewed by:	kib, emaste, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/908
2024-02-05 20:34:56 +00:00
Brooks Davis f70c5a0925 libc: move getpagesize(s) to libsys
Reviewed by:	kib, emaste, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/908
2024-02-05 20:34:56 +00:00
Brooks Davis 4c33415e4c 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
2024-02-05 20:34:56 +00:00
Brooks Davis 81245a77f0 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
2024-02-05 20:34:56 +00:00
Brooks Davis 1e2502bfca 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
2024-02-05 20:34:56 +00:00
Brooks Davis cdecda8da3 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
2024-02-05 20:34:56 +00:00
Brooks Davis 31a46e2cc8 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
2024-02-05 20:34:55 +00:00
Brooks Davis 19149b03b1 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
2024-02-05 20:34:55 +00:00
Brooks Davis 4bc66c0f9f libc: remove remaining x86 sys bits to libsys
Reviewed by:	kib, emaste, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/908
2024-02-05 20:34:55 +00:00
Brooks Davis 0d6cc87b18 libc: libc/<arch>/sys/__vdso_gettc -> libsys/<arch>/
Reviewed by:	kib, emaste, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/908
2024-02-05 20:34:55 +00:00
Brooks Davis 84dd0c080b 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
2024-02-05 20:34:55 +00:00