Commit Graph

295164 Commits

Author SHA1 Message Date
Mark Johnston
b5149b2653 linker: Handle a truncated hints file properly
If vattr.va_size is 0, we will end up accessing invalid memory.  This is
mostly harmless (because malloc(0) still allocates some memory), but it
triggers a KASAN report.

PR:		282268
Reviewed by:	christos, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47240
2024-10-23 22:12:45 +00:00
Li-Wen Hsu
dab59af3bc
Canonicalize the name of the FreeBSD Foundation
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2024-10-24 05:03:07 +08:00
SHENG-YI HONG
514f4e89ac
ncurses: Fix codegen for key names and codes
Adding back arguments, which were missed during the import of ncurses version
6.5, to the code gen awk script.

This is modified from lib_keyname.c and keys.list targets in
contrib/ncurses/ncurses/Makefile.in of
21817992b3

PR:		280697
Reported by:	np
Reviewed by:	bapt
Tested by:	scf
Fixes:		21817992b3 ncurses: vendor import version 6.5
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D47153
2024-10-24 04:39:36 +08:00
Konstantin Belousov
41b95006f2 acpidump(8): add const qualifier to the known tables array
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
2024-10-23 23:00:10 +03:00
Konstantin Belousov
705090cba4 DMAR: handle affinity for in-memory data structures
Reviewed and tested by:	markj
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D47254
2024-10-23 23:00:10 +03:00
Andrew Gallatin
49597c3e84 mlx5e: Use M_WAITOK when allocating TLS tags
Now that it is clear we're in a sleepable context, use
M_WAITOK when allocating TLS tags.

Suggested by: kib
Sponsored by: Netflix
2024-10-23 15:56:14 -04:00
Andrew Gallatin
81dbc22ce8 mlx5e: Immediately initialize TLS send tags
Under massive connection thrashing (web server restarting), we see
long periods where the web server blocks when enabling ktls offload
when NIC ktls offload is enabled.

It turns out the driver uses a single-threaded linux work queue to
serialize the commands that must be sent to the nic to allocate and
free tls resources. When freeing sessions, this work is handled
asynchronously. However, when allocating sessions, the work is handled
synchronously and the driver waits for the work to complete before
returning. When under massive connection thrashing, the work queue is
first filled by TLS sessions closing. Then when new sessions arrive,
the web server enables kTLS and blocks while the tens or hundreds of
thousands of sessions closes queued up are processed by the NIC.

Rather than using the work queue to open a TLS session on the NIC,
switch to doing the open directly. This allows use to cut in front of
all those sessions that are waiting to close, and minimize the amount
of time the web server blocks. The risk is that the NIC may be out of
resources because it has not processed all of those session frees. So
if we fail to open a session directly, we fall back to using the work
queue.

Differential Revision: https://reviews.freebsd.org/D47260
Sponsored by: Netflix
Reviewed by: kib
2024-10-23 15:16:19 -04:00
Dimitry Andric
f3dbef1082 Bump __FreeBSD_version for llvm 19.1.2 merge
PR:		280562
MFC after:	1 month
2024-10-23 20:27:43 +02:00
Dimitry Andric
5deeebd8c6 Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6,
a.k.a. 19.1.2 release.

PR:		280562
MFC after:	1 month
2024-10-23 20:27:38 +02:00
Dimitry Andric
6e516c87b6 Merge llvm-project release/19.x llvmorg-19.1.1-0-gd401987fe349
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.1-0-gd401987fe349,
a.k.a. 19.1.1 release.

PR:		280562
MFC after:	1 month
2024-10-23 20:27:28 +02:00
Dimitry Andric
c80e69b00d Merge llvm-project release/19.x llvmorg-19.1.0-0-ga4bf6cd7cfb1
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.0-0-ga4bf6cd7cfb1,
a.k.a. 19.1.0 release.

PR:		280562
MFC after:	1 month
2024-10-23 20:27:22 +02:00
Dimitry Andric
835c3a3e69 Merge commit 6dbdb8430b49 from llvm git (by Nikolas Klauser):
[Clang] Fix crash due to invalid source location in __is_trivially_equality_comparable (#107815)

  Fixes #107777

This fixes an assertion failure building www/qt5-webengine:

  Assertion failed: (Loc.isValid() && "point of instantiation must be valid!"), function setPointOfInstantiation, file contrib/llvm-project/clang/include/clang/AST/DeclTemplate.h, line 1938.

PR:		280562
MFC after:	1 month
2024-10-23 20:27:19 +02:00
Dimitry Andric
6c4b055cfb Merge llvm-project release/19.x llvmorg-19.1.0-rc4-0-g0c641568515a
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.0-rc4-0-g0c641568515a.

PR:		280562
MFC after:	1 month
2024-10-23 20:27:14 +02:00
Dimitry Andric
6298728806 Merge llvm-project release/19.x llvmorg-19.1.0-rc3-0-g437434df21d8
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.0-rc3-0-g437434df21d8.

PR:		280562
MFC after:	1 month
2024-10-23 20:27:07 +02:00
Dimitry Andric
52418fc2be Merge llvm-project release/19.x llvmorg-19.1.0-rc2-0-gd033ae172d1c
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.0-rc2-0-gd033ae172d1c.

PR:		280562
MFC after:	1 month
2024-10-23 20:26:53 +02:00
Dimitry Andric
ff6c844784 libcxx-compat: update libcxx.imp for headers that were reintroduced by reverts
PR:		280562
MFC after:	1 month
2024-10-23 20:26:50 +02:00
Dimitry Andric
2e861daab9 libcxx-compat: install headers that were reintroduced by reverts
PR:		280562
MFC after:	1 month
2024-10-23 20:26:49 +02:00
Dimitry Andric
b60301d8b5 libcxx-compat: don't remove headers that were reintroduced by reverts
PR:		280562
MFC after:	1 month
2024-10-23 20:26:48 +02:00
Dimitry Andric
072b5fb698 libcxx-compat: revert llvmorg-19-init-4003-g55357160d0e1:
[libc++] Use GCC type traits builtins for remove_cv and remove_cvref (#81386)

  They have been added recently to GCC without support for mangling. This
  patch uses them in structs and adds aliases to these structs instead of
  the builtins directly.

PR:		280562
MFC after:	1 month
2024-10-23 20:26:47 +02:00
Dimitry Andric
f3859a1a13 libcxx-compat: revert llvmorg-19-init-4504-g937a5396cf3e:
[libc++] Remove unused includes from __type_traits/is_convertible.h (#83747)

PR:		280562
MFC after:	1 month
2024-10-23 20:26:46 +02:00
Dimitry Andric
a7b2d7f261 libcxx-compat: revert llvmorg-19-init-5639-ga10aa4485e83:
[libc++] Simplify the implementation of remove_reference (#85207)

  GCC 13 introduced the type trait `__remove_reference`. We can simplify
  the implementation of `remove_reference` a bit by using it.

PR:		280562
MFC after:	1 month
2024-10-23 20:26:45 +02:00
Dimitry Andric
1199d38d8e libcxx-compat: revert llvmorg-19-init-8667-g472b612ccbed:
[libc++][NFC] Remove unused includes from <__type_traits/remove_cv.h> (#88752)

PR:		280562
MFC after:	1 month
2024-10-23 20:26:45 +02:00
Dimitry Andric
2f2ebe758b libcxx-compat: revert llvmorg-19-init-17473-g69fecaa1a455:
[libc++] Clean up some now dead code with the upgrade to GCC 14 (#97746)

PR:		280562
MFC after:	1 month
2024-10-23 20:26:44 +02:00
Dimitry Andric
e8847079df libcxx-compat: revert llvmorg-19-init-17727-g0eebb48fcfbc:
[libc++] Merge is_member{,_object,_function}_pointer.h (#98727)

  The implementations for these traits have been simplified quite a bit,
  since we have builtins available for them now.

PR:		280562
MFC after:	1 month
2024-10-23 20:26:43 +02:00
Dimitry Andric
0bec0529b1 libcxx-compat: revert llvmorg-19-init-17728-g30cc12cd818d:
[libc++] Simplify the implementation of is_null_pointer a bit (#98728)

PR:		280562
MFC after:	1 month
2024-10-23 20:26:42 +02:00
Dimitry Andric
e8054e44f4 libcxx-compat: revert llvmorg-19-init-17853-g578c6191eff7:
[libc++] Simplify std::is_void (#99033)

PR:		280562
MFC after:	1 month
2024-10-23 20:26:41 +02:00
Dimitry Andric
04f5b79cfa libcxx-compat: revert llvmorg-19-init-18062-g4dfa75c663e5:
[libc++] Merge is_scoped_enum.h into is_enum.h (#99458)

PR:		280562
MFC after:	1 month
2024-10-23 20:26:40 +02:00
Dimitry Andric
2f6d6eaf2d libcxx-compat: revert llvmorg-19-init-18063-g561246e90282:
[libc++][NFC] Remove wrong #endif comment

PR:		280562
MFC after:	1 month
2024-10-23 20:26:39 +02:00
Dimitry Andric
6b4981df60 libcxx cstdlib, cwchar: avoid using long long functions if not
supported, even for older compilers that do not support the
using_if_exists attribute.

PR:		280562
MFC after:	1 month
2024-10-23 20:26:38 +02:00
Dimitry Andric
81e300df5e libcxx atomic_ref.h: add typename keyword for difference_type
declarations, otherwise older clang versions cannot compile this header.

PR:		280562
MFC after:	1 month
2024-10-23 20:26:37 +02:00
Dimitry Andric
6846ab2fb6 libcxx simd_utils.h: only enable _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS for
clang >= 15, since older versions do not support the required builtins.

PR:		280562
MFC after:	1 month
2024-10-23 20:26:36 +02:00
Dimitry Andric
36d486cc2e Fix enum warning in ath_hal's ar9002
This fixes a clang 19 warning:

    sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c:57:32: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_ANT_SETTING') [-Werror,-Wenum-compare]
       57 |             (AH5212(ah)->ah_diversity != HAL_ANT_VARIABLE)) {
          |              ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~

The `ah_diversity` field of `struct ath_hal_5212` is of type `HAL_BOOL`,
not the enum type `HAL_ANT_SETTING`. In other code, `ah_diversity` is
set to `AH_TRUE` whenever the related field `ah_antControl` is set to
`HAL_ANT_VARIABLE`.

It is not entirely clear to me what the intended statement is here: the
test as it is written now compares the enum value 0 to `ah_diversity`,
so in effect it enables the following block whenever `ah_diversity` is
`AH_TRUE`. Write it like that, to avoid the compiler warning.

MFC after:	3 days
2024-10-23 20:26:35 +02:00
Dimitry Andric
d575077527 bsd.sys.mk: for clang >= 19, similar to gcc >= 8.1, turn off -Werror for
-Wcast-function-type-mismatch.

PR:		280562
MFC after:	1 month
2024-10-23 20:26:34 +02:00
Dimitry Andric
3f157662c0 Tentatively apply https://github.com/llvm/llvm-project/pull/101403
PR:		280562
MFC after:	1 month
2024-10-23 20:26:33 +02:00
Dimitry Andric
36b606ae6a Merge llvm-project release/19.x llvmorg-19.1.0-rc1-0-ga4902a36d5c2
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.0-rc1-0-ga4902a36d5c2.

PR:		280562
MFC after:	1 month
2024-10-23 20:26:26 +02:00
Dimitry Andric
0fca6ea1d4 Merge llvm-project main llvmorg-19-init-18630-gf2ccf80136a0
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-19-init-18630-gf2ccf80136a0, the
last commit before the upstream release/19.x branch was created.

PR:		280562
MFC after:	1 month
2024-10-23 20:26:01 +02:00
Ed Maste
6b9f7133ab libc: Add one more check in new fmemopen test
Reported by:	jrtc27
Fixes: 0953460ce1 ("libc: fix access mode tests in fmemopen(3)")
2024-10-23 13:29:34 -04:00
Ed Maste
0953460ce1 libc: fix access mode tests in fmemopen(3)
Previously a stream opened as read-only could be written to.  Add a test
case for the fix.

Also correct another incorrect access mode check that worked by
accident, and improve the tests for that.

PR:		281953
Reported by:	Erkki Moorits, fuz
Reviewed by:	fuz, khng (earlier)
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47265
2024-10-23 13:11:14 -04:00
Li-Wen Hsu
419249c1ca
Revert "LINT: Add mac_do"
This reverts commit 91b7b225b2.
2024-10-23 15:40:14 +08:00
Li-Wen Hsu
91b7b225b2
LINT: Add mac_do
Sponsored by:	The FreeBSD Foundation
2024-10-23 14:21:55 +08:00
Li-Wen Hsu
6fa91acca4
conf/NOTES: Remove trailing whitespace
Sponsored by:	The FreeBSD Foundation
2024-10-23 14:21:25 +08:00
Bjoern A. Zeeb
5c92f84bb6 LinuxKPI: update rcu_dereference_*() and lockdep_is_held()
Update rcu_dereference_{check,protected}() to call the check and log
once if it fails and if the RCU debug sysctl is turned on.
Also add proper checks for conditions passed in to these functions.
For that implement linux_rcu_read_lock_held() (lots of help from wulf).

(While here also remove extraneous extern for function prototypes).

Update lockdep_is_held() to always be an inline function with argument
annotation so that we do no longer have unused variables
in callers which only call lockdep_is_held().

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	wulf
Differential Revision:  https://reviews.freebsd.org/D46842
2024-10-23 01:43:09 +00:00
Ed Maste
d55d5dd9f7 style.9: clarify FALLTHROUGH
FALLTHROUGH is intended for a block of code that cascades to the next
case block.  Multiple case statements sharing a single block of code do
not need a FALLTHROUGH comment.

Reviewed by:	imp, markj, jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47242
2024-10-22 19:48:25 -04:00
Ed Maste
13da1af1cd libcxxrt: Update to upstream 698997bfde1f
Interesting fixes:

045c52c Mark __cxa_allocate_exception, __cxa_free_exception and
        __cxa_init_primary_exception noexcept.
8a2f123 Define _LIBCXXRT_NOEXCEPT in cxxabi.h and use it instead of
        throw()
9529236 Fix memory corruption in cpp_demangle_read_sname()
8f5c74e Add test cases, fix more bugs, and improve perf
391a3dc Add a simple implementation of __cxa_call_terminate
40e4fa2 mark std::terminate as noreturn and noexcept
5eede09 Print diagnostics in default std::terminate handler

Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47238
2024-10-22 19:43:54 -04:00
Doug Moore
e2414d91d3 vfs_subr: maintain sorted tailq
Pctries are based on unsigned index values. Type daddr_t is
signed. Using daddr_t as an index type for a pctrie works, except that
the pctrie considers negative values greater than nonnegative
ones. Building a sorted tailq of bufs, based on pctrie results, sorts
negative daddr_ts larger than nonnegative ones, and makes code that
depends on the tailq being actually sorted broken.

Write wrappers for the functions that do pctrie operations that depend
on index ordering that fix the order problem, and use them in place of
direct pctrie operations.

PR:		282134
Reported by:	pho
Reviewed by:	kib, markj
Tested by:	pho
Fixes: 2c8caa4b39 vfs_subr: optimize inval_buf_range
Differential Revision:	https://reviews.freebsd.org/D47200
2024-10-22 16:54:34 -05:00
Konstantin Belousov
5a6e19cac0 acpidump: use acpica definitions for devscope types in DMAR decoding
and add missed acpi namespace device type entry decoding.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-10-22 22:34:34 +03:00
Konstantin Belousov
8f553746b4 acpidump: correct memcmp() result check
Fixes:	e9ab827df9
Sponsored by:	The FreeBSD Foundation
2024-10-22 22:34:33 +03:00
Brooks Davis
8ae9921f2e sys_capability.c: update the source of CAPENABLED
System calls allowed in capability mode have been specified by the
CAPENABLED flag in syscalls.master since 2021.
2024-10-22 19:44:41 +01:00
Brooks Davis
3dd490e800 DS3231: converstion -> conversion 2024-10-22 19:23:45 +01:00
Brooks Davis
76ab72e828 sysent: regen for typo fix 2024-10-22 19:21:26 +01:00