hwpmc.4: correct stale default values and update diagnostics
The default values documented for kern.hwpmc.logbuffersize (4KB) and
kern.hwpmc.nbuffers_pcpu (64) have been incorrect since 2981a3420cb1
(2018), which updated the compiled defaults but did not update the
man page.
- Correct logbuffersize default from 4KB to 256KB, add 16MB maximum
- Correct nbuffers_pcpu default from 64 to 32, document 32MB per-CPU
product limit with kern.hwpmc.logbuffersize
- Update DIAGNOSTICS section to reflect current warning messages
Reviewed by: mhorne
MFC after: 1 week
Sponsored by: NLINK (nlink.com.br)
Differential Revision: https://reviews.freebsd.org/D56050
hwpmc: improve diagnostic messages for invalid tunables
Replace printf() with log(LOG_WARNING, ...) in pmclog_initialize()
so that tunable validation failures are visible in dmesg and
/var/log/messages rather than only on the early console.
Also improve the messages to report both the invalid value and the
default it resets to, making it easier for users to understand why
their tunable was ignored.
While here, adjust some whitespacing/style.
Reviewed by: Ali Mashtizadeh <ali at mashtizadeh.com>, mhorne
MFC after: 1 week
Sponsored by: NLINK (nlink.com.br)
Differential Revision: https://reviews.freebsd.org/D56029
libpmc: Add support for IBS qualifiers
Add support to libpmc for parsing the IBS qualifiers and computing the
ctl register value as a function of the qualifiers and the sample rate.
This includes all of the flags available up to AMD Zen 5. Along side
these user facing changes I included the documentation for AMD IBS.
Reviewed by: mhorne
Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/2081
hwpmc: Use rdtsc instead of rdtscp for timestamps
No need for a barrier here, we are inside an NMI handler and executing a
number of serializing instructions with stronger semantics. Reducing
this overhead will increase our maximum safe sampling rate.
Tested by: Paulo Fragoso <paulo at nlink.com.br>
Reviewed by: mhorne
MFC after: 1 week
Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/2076
EC2: Add clibs-lib32 pkg to small/builder images
The FreeBSD-clang package on amd64 contains libclang_rt.asan-i386.so,
which links to the 32-bit version of libgcc_s.so.1. It is not clear
if that file belongs in FreeBSD-clang or if it should be placed into
a different package.
For unknown reasons, pkg *sometimes* recognizes this and decides that
it needs to install a package to supply libgcc_s.so.1:32.
In particular, when we initially install the VM with 'pkg install
[long list of FreeBSD-* packages]', pkg does not recognize that it
wants this; but the *next* time 'pkg install' runs, it decides that
it needs libgcc_s.so.1:32 -- even though that particular library is
not needed by the particular package we're trying to install -- and
goes looking for it... and ends up picking gcc12-devel as a provider.
Later in the EC2 image building process, we run 'pkg autoremove' (which
was added during 15.0 to get rid of the "bogus dependencies" which were
[21 lines not shown]
Revert "vmimage.subr: pkg autoremove after pkg install"
This reverts commit 6a13aeac3c1f98db7cf156f24a4d6bc8d3c321f6.
The "bogus dependencies being installed" issue was traced down to pkg
confusion surrounding libclang_rt.asan-i386.so linking to a 32-bit
libgcc_s.so.1, and a more minimal workaround of "install clibs-lib32"
has been applied, so this hack is no longer required.
MFC after: 3 days
Sponsored by: Amazon
(cherry picked from commit 4b29bf721ef09c399f3e4a4ab5ca9f549c5b1550)
cross-build: Provide mempcpy when building on macOS
We could patch the tzcode config to not use it, but it's simple to
provide an implementation of it and avoid spreading cross-build
bootstrapping special cases.
Fixes: ff2c98b30b57 ("tzcode: Update to 2026a")
MFC after: 1 week
release: Remove not-NO_ROOT cases
We always use NO_ROOT for release artifact builds, so remove the
alternate code paths.
For the first step we set NO_ROOT unconditionally in cases that invoke
submakes, and turn NO_ROOT being unset into an error in lover-level
targets so that we can catch potential out-of-tree build scripts (or
missed in-tree cases) that expect to run not-NO_ROOT builds. The second
step will be to remove those entirely.
Reviewed by: cperciva
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54179
(cherry picked from commit 54e006369c9aab4f3a22f026eb6924c0f9cafda8)
release: Use make's `:H` rather than `/..`
In general we want to strip subdir components, rather than appending
`..`s.
Reviewed by: lwhsu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54373
(cherry picked from commit 3949c2b8c4691a6dff8be7b38805d56faab91187)
mlx5: postpone freeing the completed command entity to taskqueue
because cancel_delayed_work_sync() might need to sleep, which cannot be
done in the interrupt thread where the completion runs.
Sponsored by: Nvidia networking
MFC after: 1 week
queue.h: Reorder STAILQ_INSERT_TAIL
The current implementation briefly violates the tail invariant. This
is not usually an issue, but if an insert is in flight when a panic
occurs, we may then trip the invariant while dumping core.
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: obiwac, olce, jhb
Differential Revision: https://reviews.freebsd.org/D55819
(cherry picked from commit aa15df4597053c0e95a15b2a7036296999cd562a)
resolver.5: document six previously undocumented options
Document the edns0, inet6, insecure1, insecure2, no-check-names,
and rotate options which are parsed by res_init(3) but were not
described in the resolver(5) man page.
MFC after: 1 week
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D55864
(cherry picked from commit 462a1f6197fa3de63e0eca2835b1d5b0bc6a3bbb)
yes: Completely overengineer
If we're going to overengineer this, we may as well go all the way.
* If multiple arguments are given, concatenate them into a space-
separated list like GNU coreutils does.
* When duplicating the expletive, do so exponentially.
* Most importantly, don't modify the memory that argv points to.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans, allanjude
Differential Revision: https://reviews.freebsd.org/D55617
(cherry picked from commit cf74b63d61b49db848ecc20b87e7ee5f16671320)
yes: Add missing header
[8 lines not shown]
pfctl tests: test rdr-to and nat-to in one rule
OpenBSD fixed this separately (in their 6a338f3f70). We appear to not
have had this bug, but test for it anyway.
Sponsored by: Rubicon Communications, LLC ("Netgate")
pfctl: parser must not ignore error from pfctl_optimize_ruleset()
Ignoring the error may cause pfctl(8) to load inconsistent ruleset
preventing pf(4) to enforce desired policy.
Issue reported and fix suggested by berts _from_ fastmail _dot_ com
'Looks good.' @deraadt
MFC after: 1 week
Obtained from: OpenBSD, sashan <sashan at openbsd.org>, 9fd28a8cca
Sponsored by: Rubicon Communications, LLC ("Netgate")
release.sh: add chroot cleanup routine
The chroot_cleanup routine handles any cleanup needed post-chroot_setup,
etc. This consists of purely tearing down `${CHROOTDIR}/dev` today, but
might involve additional steps, as needed for custom functions. This
allows end-users to override the various chroot functions without having
to modify code in main() or replicate the unmount procedure in an
equivalent routine setup via the trap builtin.
This change modifies the /dev unmount process to use `umount -f` instead
of `umount`. The latter can result in failures if resources are still
mounted or are running post-build, whereas the former will clean up any
resources still in use by processes running in the chroot at time of
build. Moreover, the `chroot_cleanup` routine is now called when the
script is killed with `SIGINT` and `SIGTERM`, as well as at `EXIT`,
better ensuring that the script's resources are cleaned up in relatively common
scenarios that can be detected/handled.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55450 (as part of a larger change)
release.sh: document user-overriddable functions
This helps others attempting to customize the behavior of `release.sh`.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55450 (as part of a larger change)