bridge: Allow BRDGSIFVLANSET without IFBRF_VLANFILTER
Currently, we disallow BRDGSIFVLANSET when IFBRF_VLANFILTER is disabled.
There's no particular reason to do this, and it causes some undesirable
behaviour such as not being able to remove the tagged config on a member
after disabling vlanfilter on the bridge.
Remove the restriction so BRDGSIFVLANSET is always accepted.
PR: 292019
MFC after: 1 week
Reviewed by: zlei, p.mousavizadeh_protonmail.com
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D54435
hwpstate: add CPPC support for pstate driver on AMD
Implement CPPC interface for AMD Pstate Driver.
This feature is only enabled when the CPUID shows it support CPPC.
The CPPC is implemneted by the following steps:
1. Write MSR to enable it.
2. Read capability registert which indicates binary value of levels
about lowest, best energy efficient, guarantee, and max performance.
3. Write request register with epp in energy balanced mode. And let
CPU and firmware to enter autonomous mode.
Also, create a sysctl handler to allow userspace to change epp value.
In intel's hwpstate, The epp value can be in package level and core level.
However, in AMD's one, there is only core level. Thus, to sync with the
intel's code, we implement package level control in software and provide
another sysctl (machdep.hwpstate_pkg_ctrl) to control it.
[5 lines not shown]
crypto: avoid warnings about too-long initializer strings
Mark `sigma` and `tau` as `__non_string`, to avoid warnings from clang
21 similar to:
sys/crypto/chacha20/chacha.c:53:31: error: initializer-string for character array is too long, array size is 16 but initializer has size 17 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
53 | static const char sigma[16] = "expand 32-byte k";
| ^~~~~~~~~~~~~~~~~~
sys/crypto/chacha20/chacha.c:54:29: error: initializer-string for character array is too long, array size is 16 but initializer has size 17 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
54 | static const char tau[16] = "expand 16-byte k";
| ^~~~~~~~~~~~~~~~~~
MFC after: 3 days
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D54364
(cherry picked from commit 710ec409dffed3306ced253bba85dbdc7758510b)
ncurses: avoid warnings about too-long initializer strings
Increase the size of `assoc::from` to 8 bytes, to avoid warnings from
clang 21 similar to:
contrib/ncurses/progs/infocmp.c:702:10: error: initializer-string for character array is too long, array size is 4 but initializer has size 5 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
702 | DATA("\033[2J", "ED2"), /* clear page */
| ^~~~~~~~~
contrib/ncurses/progs/infocmp.c:716:10: error: initializer-string for character array is too long, array size is 4 but initializer has size 5 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
716 | DATA("\033[!p", "DECSTR"), /* soft reset */
| ^~~~~~~~~
Reviewed by: markj
Obtained from: https://invisible-island.net/archives/ncurses/6.5/ncurses-6.5-20241207.patch.gz
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D54371
(cherry picked from commit 667259b392ec0a86d066ccc6ba0f4025b3d2a083)
compat: linux: use appropriate variables for copying out old timers
We copyout &l_oval but do the conversions into &l_val, leaving us with
stack garbage. A build with an LLVM21 cross-toolchain seems to catch
this.
Reported by: Florian Limberger <flo purplekraken com>
Reviewed by: markj
Fixes: a1fd2911ddb06 ("linux(4): Implement timer_settime64 syscall.")
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D52985
(cherry picked from commit 541a98d7e28a8e4697ac2fa78dd4c4203c2c3a9c)
bsd.sys.mk: suppress some new clang 21 warnings for C++
Otherwise, these lead to many -Werror warnings in libc++ headers, due to
our use of -Wsystem-headers, which is not officially supported upstream:
Suppress -Wc++20-extensions, due to:
/usr/include/c++/v1/__algorithm/simd_utils.h:96:50: error: explicit template parameter list for lambdas is a C++20 extension [-Werror,-Wc++20-extensions]
96 | inline constexpr size_t __simd_vector_size_v = []<bool _False = false>() -> size_t {
| ^
Suppress -Wc++23-lambda-attributes, due to:
/usr/include/c++/v1/__format/format_functions.h:462:32: error: an attribute specifier sequence in this position is a C++23 extension [-Werror,-Wc++23-lambda-attributes]
462 | if (bool __is_identity = [&] [[__gnu__::__pure__]] // Make sure the compiler knows this call can be eliminated
| ^
Suppress -Wnullability-completeness, due to:
[7 lines not shown]
sh: avoid warnings about too-long initializer strings
Mark `optletter` and `t_op::op_text` as `__non_string`, to avoid
warnings from clang 21 similar to:
bin/sh/options.h:77:36: error: initializer-string for character array is too long, array size is 19 but initializer has size 20 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
77 | const char optletter[NSHORTOPTS] = "efIimnsxvVECabupTPh";
| ^~~~~~~~~~~~~~~~~~~~~
bin/test/test.c:153:3: error: initializer-string for character array is too long, array size is 2 but initializer has size 3 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
153 | {"==", STREQ},
| ^~~~
MFC after: 3 days
Reviewed by: jilles
Differential Revision: https://reviews.freebsd.org/D54362
(cherry picked from commit e6546807f4c1a8a6a6fa53fceab7b8c80e3ed802)
OptionalObsoleteFiles.inc: fix up WITH_LLVM_LINK_STATIC_LIBRARIES cases
In commit cf1eaaf41cef I added the WITH_LLVM_LINK_STATIC_LIBRARIES
src.conf(5) build knob, which also affects OptionalObsoleteFiles.inc.
However, the checks were incorrect: when WITH_LLVM_LINK_STATIC_LIBRARIES
is active, the OLD_LIBS libprivatellvm.so.19, libprivateclang.so.19 and
libprivatelldb.so.19 should always be cleaned up.
Fixes: cf1eaaf41cef
MFC after: 1 week
(cherry picked from commit 160077a4d75186a979f28f0778259c66d8cac8be)
src.conf: Add WITH_LLVM_LINK_STATIC_LIBRARIES build knob
In commit 2e47f35be5dc libllvm, libclang and liblldb were converted into
private shared libraries. This allowed clang, lld, lldb, and other llvm
tools to be linked against these shared libraries, which makes them
smaller and avoids duplication.
However, this also comes at the cost of some performance, since the
dynamic libraries are quite large, and contain lots of long symbols
(mangled C++ identifiers).
Add a WITH_LLVM_LINK_STATIC_LIBRARIES build knob that can be used to go
back to the previous behavior: libllvm, libclang and liblldb are built
as internal static libraries, i.e. only available during buildworld, and
fully linked into the various executables such as clang, lld, etc.
PR: 287447
Reviewed by: emaste
MFC after: 1 week
[3 lines not shown]
zfs: rename several printf attribute declarations to __printf__
For kernel builds, we redefine `__printf__` to `__freebsd_kprintf__`, to
support FreeBSD kernel printf(9) extensions with clang.
In OpenZFS various printf related functions are declared with
__attribute__((format(printf, X, Y))), so these won't work with the
above redefinition. With clang 21 and higher, this leads to errors
similar to:
sys/contrib/openzfs/module/zfs/spa_misc.c:414:38: error: passing 'printf' format string where 'freebsd_kprintf' format string is expected [-Werror,-Wformat]
414 | (void) vsnprintf(buf, sizeof (buf), fmt, adx);
| ^
Since attribute names can always be spelled with leading and trailing
double underscores, rename these instances.
Note that in FreeBSD proper we usually use `__printflike` from
<sys/cdefs.h>, but that does not apply to OpenZFS.
[6 lines not shown]
crypto: avoid warnings about too-long initializer strings
Mark `sigma` and `tau` as `__non_string`, to avoid warnings from clang
21 similar to:
sys/crypto/chacha20/chacha.c:53:31: error: initializer-string for character array is too long, array size is 16 but initializer has size 17 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
53 | static const char sigma[16] = "expand 32-byte k";
| ^~~~~~~~~~~~~~~~~~
sys/crypto/chacha20/chacha.c:54:29: error: initializer-string for character array is too long, array size is 16 but initializer has size 17 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
54 | static const char tau[16] = "expand 16-byte k";
| ^~~~~~~~~~~~~~~~~~
MFC after: 3 days
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D54364
(cherry picked from commit 710ec409dffed3306ced253bba85dbdc7758510b)
ncurses: avoid warnings about too-long initializer strings
Increase the size of `assoc::from` to 8 bytes, to avoid warnings from
clang 21 similar to:
contrib/ncurses/progs/infocmp.c:702:10: error: initializer-string for character array is too long, array size is 4 but initializer has size 5 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
702 | DATA("\033[2J", "ED2"), /* clear page */
| ^~~~~~~~~
contrib/ncurses/progs/infocmp.c:716:10: error: initializer-string for character array is too long, array size is 4 but initializer has size 5 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
716 | DATA("\033[!p", "DECSTR"), /* soft reset */
| ^~~~~~~~~
Reviewed by: markj
Obtained from: https://invisible-island.net/archives/ncurses/6.5/ncurses-6.5-20241207.patch.gz
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D54371
(cherry picked from commit 667259b392ec0a86d066ccc6ba0f4025b3d2a083)
compat: linux: use appropriate variables for copying out old timers
We copyout &l_oval but do the conversions into &l_val, leaving us with
stack garbage. A build with an LLVM21 cross-toolchain seems to catch
this.
Reported by: Florian Limberger <flo purplekraken com>
Reviewed by: markj
Fixes: a1fd2911ddb06 ("linux(4): Implement timer_settime64 syscall.")
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D52985
(cherry picked from commit 541a98d7e28a8e4697ac2fa78dd4c4203c2c3a9c)
bsd.sys.mk: suppress some new clang 21 warnings for C++
Otherwise, these lead to many -Werror warnings in libc++ headers, due to
our use of -Wsystem-headers, which is not officially supported upstream:
Suppress -Wc++20-extensions, due to:
/usr/include/c++/v1/__algorithm/simd_utils.h:96:50: error: explicit template parameter list for lambdas is a C++20 extension [-Werror,-Wc++20-extensions]
96 | inline constexpr size_t __simd_vector_size_v = []<bool _False = false>() -> size_t {
| ^
Suppress -Wc++23-lambda-attributes, due to:
/usr/include/c++/v1/__format/format_functions.h:462:32: error: an attribute specifier sequence in this position is a C++23 extension [-Werror,-Wc++23-lambda-attributes]
462 | if (bool __is_identity = [&] [[__gnu__::__pure__]] // Make sure the compiler knows this call can be eliminated
| ^
Suppress -Wnullability-completeness, due to:
[7 lines not shown]
sh: avoid warnings about too-long initializer strings
Mark `optletter` and `t_op::op_text` as `__non_string`, to avoid
warnings from clang 21 similar to:
bin/sh/options.h:77:36: error: initializer-string for character array is too long, array size is 19 but initializer has size 20 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
77 | const char optletter[NSHORTOPTS] = "efIimnsxvVECabupTPh";
| ^~~~~~~~~~~~~~~~~~~~~
bin/test/test.c:153:3: error: initializer-string for character array is too long, array size is 2 but initializer has size 3 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
153 | {"==", STREQ},
| ^~~~
MFC after: 3 days
Reviewed by: jilles
Differential Revision: https://reviews.freebsd.org/D54362
(cherry picked from commit e6546807f4c1a8a6a6fa53fceab7b8c80e3ed802)
OptionalObsoleteFiles.inc: fix up WITH_LLVM_LINK_STATIC_LIBRARIES cases
In commit cf1eaaf41cef I added the WITH_LLVM_LINK_STATIC_LIBRARIES
src.conf(5) build knob, which also affects OptionalObsoleteFiles.inc.
However, the checks were incorrect: when WITH_LLVM_LINK_STATIC_LIBRARIES
is active, the OLD_LIBS libprivatellvm.so.19, libprivateclang.so.19 and
libprivatelldb.so.19 should always be cleaned up.
Fixes: cf1eaaf41cef
MFC after: 1 week
(cherry picked from commit 160077a4d75186a979f28f0778259c66d8cac8be)
src.conf: Add WITH_LLVM_LINK_STATIC_LIBRARIES build knob
In commit 2e47f35be5dc libllvm, libclang and liblldb were converted into
private shared libraries. This allowed clang, lld, lldb, and other llvm
tools to be linked against these shared libraries, which makes them
smaller and avoids duplication.
However, this also comes at the cost of some performance, since the
dynamic libraries are quite large, and contain lots of long symbols
(mangled C++ identifiers).
Add a WITH_LLVM_LINK_STATIC_LIBRARIES build knob that can be used to go
back to the previous behavior: libllvm, libclang and liblldb are built
as internal static libraries, i.e. only available during buildworld, and
fully linked into the various executables such as clang, lld, etc.
PR: 287447
Reviewed by: emaste
MFC after: 1 week
[3 lines not shown]
zfs: rename several printf attribute declarations to __printf__
For kernel builds, we redefine `__printf__` to `__freebsd_kprintf__`, to
support FreeBSD kernel printf(9) extensions with clang.
In OpenZFS various printf related functions are declared with
__attribute__((format(printf, X, Y))), so these won't work with the
above redefinition. With clang 21 and higher, this leads to errors
similar to:
sys/contrib/openzfs/module/zfs/spa_misc.c:414:38: error: passing 'printf' format string where 'freebsd_kprintf' format string is expected [-Werror,-Wformat]
414 | (void) vsnprintf(buf, sizeof (buf), fmt, adx);
| ^
Since attribute names can always be spelled with leading and trailing
double underscores, rename these instances.
Note that in FreeBSD proper we usually use `__printflike` from
<sys/cdefs.h>, but that does not apply to OpenZFS.
[6 lines not shown]
crypto: avoid warnings about too-long initializer strings
Mark `sigma` and `tau` as `__non_string`, to avoid warnings from clang
21 similar to:
sys/crypto/chacha20/chacha.c:53:31: error: initializer-string for character array is too long, array size is 16 but initializer has size 17 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
53 | static const char sigma[16] = "expand 32-byte k";
| ^~~~~~~~~~~~~~~~~~
sys/crypto/chacha20/chacha.c:54:29: error: initializer-string for character array is too long, array size is 16 but initializer has size 17 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
54 | static const char tau[16] = "expand 16-byte k";
| ^~~~~~~~~~~~~~~~~~
MFC after: 3 days
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D54364
(cherry picked from commit 710ec409dffed3306ced253bba85dbdc7758510b)
ncurses: avoid warnings about too-long initializer strings
Increase the size of `assoc::from` to 8 bytes, to avoid warnings from
clang 21 similar to:
contrib/ncurses/progs/infocmp.c:702:10: error: initializer-string for character array is too long, array size is 4 but initializer has size 5 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
702 | DATA("\033[2J", "ED2"), /* clear page */
| ^~~~~~~~~
contrib/ncurses/progs/infocmp.c:716:10: error: initializer-string for character array is too long, array size is 4 but initializer has size 5 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
716 | DATA("\033[!p", "DECSTR"), /* soft reset */
| ^~~~~~~~~
Reviewed by: markj
Obtained from: https://invisible-island.net/archives/ncurses/6.5/ncurses-6.5-20241207.patch.gz
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D54371
(cherry picked from commit 667259b392ec0a86d066ccc6ba0f4025b3d2a083)
compat: linux: use appropriate variables for copying out old timers
We copyout &l_oval but do the conversions into &l_val, leaving us with
stack garbage. A build with an LLVM21 cross-toolchain seems to catch
this.
Reported by: Florian Limberger <flo purplekraken com>
Reviewed by: markj
Fixes: a1fd2911ddb06 ("linux(4): Implement timer_settime64 syscall.")
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D52985
(cherry picked from commit 541a98d7e28a8e4697ac2fa78dd4c4203c2c3a9c)
bsd.sys.mk: suppress some new clang 21 warnings for C++
Otherwise, these lead to many -Werror warnings in libc++ headers, due to
our use of -Wsystem-headers, which is not officially supported upstream:
Suppress -Wc++20-extensions, due to:
/usr/include/c++/v1/__algorithm/simd_utils.h:96:50: error: explicit template parameter list for lambdas is a C++20 extension [-Werror,-Wc++20-extensions]
96 | inline constexpr size_t __simd_vector_size_v = []<bool _False = false>() -> size_t {
| ^
Suppress -Wc++23-lambda-attributes, due to:
/usr/include/c++/v1/__format/format_functions.h:462:32: error: an attribute specifier sequence in this position is a C++23 extension [-Werror,-Wc++23-lambda-attributes]
462 | if (bool __is_identity = [&] [[__gnu__::__pure__]] // Make sure the compiler knows this call can be eliminated
| ^
Suppress -Wnullability-completeness, due to:
[7 lines not shown]
sh: avoid warnings about too-long initializer strings
Mark `optletter` and `t_op::op_text` as `__non_string`, to avoid
warnings from clang 21 similar to:
bin/sh/options.h:77:36: error: initializer-string for character array is too long, array size is 19 but initializer has size 20 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
77 | const char optletter[NSHORTOPTS] = "efIimnsxvVECabupTPh";
| ^~~~~~~~~~~~~~~~~~~~~
bin/test/test.c:153:3: error: initializer-string for character array is too long, array size is 2 but initializer has size 3 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
153 | {"==", STREQ},
| ^~~~
MFC after: 3 days
Reviewed by: jilles
Differential Revision: https://reviews.freebsd.org/D54362
(cherry picked from commit e6546807f4c1a8a6a6fa53fceab7b8c80e3ed802)
OptionalObsoleteFiles.inc: fix up WITH_LLVM_LINK_STATIC_LIBRARIES cases
In commit cf1eaaf41cef I added the WITH_LLVM_LINK_STATIC_LIBRARIES
src.conf(5) build knob, which also affects OptionalObsoleteFiles.inc.
However, the checks were incorrect: when WITH_LLVM_LINK_STATIC_LIBRARIES
is active, the OLD_LIBS libprivatellvm.so.19, libprivateclang.so.19 and
libprivatelldb.so.19 should always be cleaned up.
Fixes: cf1eaaf41cef
MFC after: 1 week
(cherry picked from commit 160077a4d75186a979f28f0778259c66d8cac8be)
src.conf: Add WITH_LLVM_LINK_STATIC_LIBRARIES build knob
In commit 2e47f35be5dc libllvm, libclang and liblldb were converted into
private shared libraries. This allowed clang, lld, lldb, and other llvm
tools to be linked against these shared libraries, which makes them
smaller and avoids duplication.
However, this also comes at the cost of some performance, since the
dynamic libraries are quite large, and contain lots of long symbols
(mangled C++ identifiers).
Add a WITH_LLVM_LINK_STATIC_LIBRARIES build knob that can be used to go
back to the previous behavior: libllvm, libclang and liblldb are built
as internal static libraries, i.e. only available during buildworld, and
fully linked into the various executables such as clang, lld, etc.
PR: 287447
Reviewed by: emaste
MFC after: 1 week
[3 lines not shown]
bsd.sys.mk: suppress another gcc warning for libc++
Similar to base 63d1c3c43690, suppress -Wc++20-extensions for gcc.
Otherwise libc++ headers will lead to many -Werror warnings, due to our
use of -Wsystem-headers, which is not officially supported upstream.
MFC after: 3 days