Upstream tarball included config.h~.
This was previously manually removed from vendor where in fact it
should not have been as it would have caused a merge conflict.
Reported by: "Herbert J. Skuhra" <herbert@gojira.at>
MFC: 2 weeks
Ensure that ldconfig-managed elf and elf32 hints always include
the standard library paths that are known independently to rtld.
PR: 275031
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Saltant Solutions LLC
Differential Revision: https://reviews.freebsd.org/D42557
This is required e.g. for nullfs to ensure liveness of the lower mount
points.
Reviewed by: jah, rmacklem, Olivier Certner <olce.freebsd@certner.fr>
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42554
The option was added to parallel the CLANG_IS_CC which was removed in
commit 20a66ab4bf.
Reviewed by: imp, dim, emaste
Differential Revision: https://reviews.freebsd.org/D42575
The get operations change the data pointed to by the structure, but do
not update the contents of the struct.
Mark the struct mac arguments of mac_[gs]etsockopt_*label() and
mac_check_structmac_consistent() const to prevent this from changing
in the future.
Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14488
All of these used the 'immediately at beginning' variation of the
BSD-2-Clause license. This wasn't intentional, just what I copied from
from a random file in the tree back in 2005. It was not an intentional
decision.
The different arch bus.h files are a mix of BSD-2-Clause and
BSD-4-Clause that have various copyright holders (Charles M. Hannum,
Christopher G. Demetriou, The NetBSD Foundation and KATO Takenori), and
some of the content of these files were likely copied from there.
However, apart from the uncopyrightable interface lines, there are very
few comments. It's unclear if these comments are 'original material'
here to copyright, but to the extent that there is, license it under the
standard BSD-2-Clause copyright that's the norm for the project today.
In any event, the standard BSD-2-Clause is also closer to those
originals.
In addition, FreeBSD uses different type definitions than the original
NetBSD code in part. The comments that were copied have been copied a
lot, but appear in NetBSD's bus.h files in NetBSD 1.3.
While I'm here, assign the copyright, to the extent any exists from me,
to the FreeBSD Foundation. I just cut and pasted these into _bus.h from
the different machine files and those files have a rich history of
modification from the original imports from NetBSD over more than 25
years so it's tricky to say who, exactly, wrote each bit. Given the size
of the files, this seems like the best compromise. Also add an
acknowledgement to the NetBSD 1.3 bus.h files and their authors (there
were no additional FreeBSD authors listed in the various
sys/*/include/bus.h files). Finally, use the SPDX identifier instead of
multiple copies of the text.
Differential Revision: https://reviews.freebsd.org/D42532
Sponsored by: Netflix
The tty_rubchar() code handling backspaces for UTF-8 characters didn't
properly check whether the beginning of the current line was reached.
This resulted in a kernel panic in ttyinq_unputchar() when prodded with
certain malformed UTF-8 sequences.
Fixes: PR 275009
Reviewed by: christos
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42564
When KMSAN is configured, the instrumentation inserts calls to
__msan_get_context_state() into all function prologues. The
implementation dereferences curthread and thus assumes that x18 points
to the PCPU area. This applies in particular to init_secondary(), which
currently is responsible for initializing x18 for APs.
Move initialization into locore to avoid this problem. No functional
change intended.
Reviewed by: kib, andrew
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D42533
This is consistent with version numbers used in releng/13.2.
PR: 275051
Reviewed by: bapt
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D42562
Measure the total deferred time (from the time we decide to defer until
we try again) for busdma_load requests. On systems that don't ever
defer, there is no performnce change. Add new sysctl
hw.busdma.zoneX.total_deferred_time to report this (in
microseconds).
Normally, deferrals don't happen in modern hardware... Except there's a
lot of buggy hardware that can't cope with memory > 4GB or that can't
cross a 4GB boundary (or even more restrictive values), necessitating
bouncing. This will measure the effect on the I/Os of this deferral.
Sponsored by: Netflix
Reviewed by: gallatin, mav
Differential Revision: https://reviews.freebsd.org/D42550
Add sshd and local_unbound to the oom protected services.
syslogd is protected by default already, document it.
This was discussed on arch@, see
https://lists.freebsd.org/archives/freebsd-arch/2023-November/000543.html
sshd is protected to be able to investigate and fix oom issues on systems
which don't have out-of-band console access.
local_unbound is protected as it may be enabled for local use and without
DNS a lot grinds to a halt (including sshd).
Relnotes: yes
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D42544
The -p option does not imply -x, it is merely a different mode that ps
uses. Remove that statement from the -p option, effectively rolling back
d6ae056e9d.
pstef@ introduced the -D option in 5c0a1c15ff
which also turns ps into a similar mode. List the -D option along with
the others in the first sentence of the second paragraph of the
DESCRIPTION section for completeness and correctness sake.
Pointed out by: pstef@
Differential Revision: https://reviews.freebsd.org/D42552
These devmethods were not defined, leading to the surprising result
of using bus_set_resource(), and then immediately turning around
and getting zeros back from bus_get_resource(). These are now
simply passed through to the generic definitions, since there
is no need for them to be arm64 specific.
Note that jhb plans to replace most of the devmethods with
the generic versions.
Suggested by: jhb
Sponsored by: Netflix
In function 'wg_aip_add()', the error path of returning ENOMEM when
(node == NULL) is forgetting to unlock the radix tree, and thus may lead
to a deadlock.
PR: 275001
Reviewed by: kp
MFC after: 1 week
On D40102 we implemented support for transport over IPv6 but the
documentation was not updated to reflect the new feature.
Clarify what is available and how it can be used.
MFC after: 1 week
Sponsored by: InnoGames GmbH
Differential Revision: https://reviews.freebsd.org/D42505
As SMCCC depends on PSCI check if the latter is present before calling
the former. This fixes an issue where we may call into SMCCC when there
is no PSCI in the system causing a smccc_version assert to fail.
Reported by: stevek
Reviewed by: emaste, imp, stevek
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42404
Update the HWCAP2 values to align with Linux v6.6-rc7
Reviewed by: manu, imp, emaste
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42379
There are more than 32 arm64 HWCAP2 values. Expand the macros to
include leading zeros and mark them as unsigned long.
Reviewed by: manu, imp, emaste
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42378
When adding support for new hardware extensions we may not want to
enable support for the FreeBSD and Linux ABIs at the same time. To
support this split the Linux ID register and hwcaps so they can be
configured separately.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42372
To allow for a different Linux hwcap value store the hwcap ID rather
than a pointer to elf{32,}_hwcap{2,}. This will be needed when creating
a different view of the ID registers for FreeBSD and Linux.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42371
To tell if a register is for 32 or 64 bit userspace add a flag to the
user reg struct. This will be used later to rework how the hwcaps are
generated.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42370
To allow for architecture specific protections add sv_protect to struct
sysent. This can be used to apply these after the executable is loaded
into the new address space.
Reviewed by: kib
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42440
This is useful to check if a note is present and contains an expected
value, e.g. to read NT_GNU_PROPERTY_TYPE_0 on arm64 to see if we should
enable BTI.
Reviewed by: kib, markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42439
Move the definition of GNU_ABI_VENDOR to a common location so it can
be used in multiple files.
Reviewed by: emaste, kib, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42442
In bsd.opts.mk we check MACHINE_ARCH and may want to check MACHINE to
decide which options to enable. Unfortunately this is included too
early via bsd.compiler.mk.
Move including bsd.compiler.mk until after we can set MACHINE and
MACHINE_ARCH.
Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42448
When building with kernel.bin enabled we need to set KERNEL_EXTRA and
KERNEL_EXTRA_INSTALL before they are used otherwise kernel.bin isn't
built.
Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42531
We only need to link against libz and libzstd when linking against the
fill libllvm, libllvmminimal doesn't use either library. Move adding
libz and libzstd to the list of libraries to link against to where
we decide to use the full libllvm.
Reported by: Cristian Marussi <Cristian.Marussi@arm.com>
Reported by: Colin S. Gordon <csgordon@fastmail.com>
Reviewed by: dim
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42528
"keep" currently adds a leading underscore, which hasn't been useful or
accurate since a.out days. Preserve the symbol name as it's given
rather than mangle it to match ELF-style symbol names.
This was partially fixed back in
6cd35234a0 ("Assume ELF-style symbol names now.") for crunchgen, but
the keeplist wasn't changed to match it.
While we're here, break it out to bsd.crunchgen.mk for later use in
bsdbox.
Reviewed by: adrian, imp
Differential Revision: https://reviews.freebsd.org/D42499
- Pass zone pointer to trash_ctor() and report zone name in the panic
message. It may be difficult to figyre out zone just by the item size.
- Do not pass user arguments to internal trash calls, pass thezone.
- Report malloc type name in the same unified panic message.
- Report corruption offset from the beginning of the items instead of
the full pointer. It makes panic message shorter and more readable.
In case of a remote rpcbind connection timeout,
the NFS kernel lock manager emits an error message
along the lines of:
NLM: failed to contact remote rpcbind, stat = 5, port = 28416
In the Bugzilla PR, Garrett Wollman identified the following problems
with that error message:
- The error is in decimal, which can only be deciphered by reading the
source code.
- The port number is byte-swapped.
- The error message does not identify the client the NLM is trying to
communicate with.
Fix the shortcomings of the current error message by:
- Printing out the port number correctly.
- Mentioning the remote client.
The low-level decimal error remains an outstanding issue though.
It seems like the error strings describing the error codes live outside
of the kernel code currently.
PR: 244698
Reported by: wollman
Approved by: allanjude
Sponsored by: National Bureau of Economic Research
Sponsored by: Klara, Inc.
Co-authored-by: Mateusz Piotrowski <0mp@FreeBSD.org>
We need to vfs_op_enter()/vn_seqc_write_start() before jumping to
cleanup.
PR: 274992
Reported by: trasz
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Fixes: 9ef7a491a4