The new STAILQ_ASSERT_EMPTY() macro allows callers to assert that some
STAILQ is empty. It leverages the new QMD_STAILQ_CHECK_EMPTY() internal
macro.
QMD_STAILQ_CHECK_EMPTY() is a check for empty STAILQ, where heads's
'stqh_last' field must point to the 'stqh_first' one. Use it in
STAILQ_ASSERT_EMPTY().
QMD_STAILQ_CHECK_TAIL() checks that the tail pointed by 'head' does not
have a next element. It is similar to the already existing
QMD_TAILQ_CHECK_TAIL(), but without the superfluous 'field' argument and
clearer documentation. Use it in STAILQ_INSERT_TAIL().
Approved by: markj (mentor)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46889
In order to match reality, allow using these functions with pointers on
const objects, and bring us closer to C11.
Remove the '+' modifier in the atomic_load_acq_64_i586()'s inline asm
statement's constraint for '*p' (the value to load). CMPXCHG8B always
writes back some value, even when the value exchange does not happen in
which case what was read is written back. atomic_load_acq_64_i586()
further takes care of the operation atomically writing back the same
value that was read in any case. All in all, this makes the inline
asm's write back undetectable by any other code, whether executing on
other CPUs or code on the same CPU before and after the call to
atomic_load_acq_64_i586(), except for the fact that CMPXCHG8B will
trigger a #GP(0) if the memory address is part of a read-only mapping.
This unfortunate property is however out of scope of the C abstract
machine, and in particular independent of whether the 'uint64_t' pointed
to is declared 'const' or not.
Approved by: markj (mentor)
MFC after: 5 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46887
This makes it clear that 'methods' (if not NULL) points to an array that
won't be modified. Internally, this array is indeed copied into the
given OSD type's larger array of all methods for all slots.
Reviewed by: jamie
Approved by: markj (mentor)
MFC after: 5 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46886
Since we can load raw firmware start shipping them as is.
This also remove the uuencode format that don't add any value and garbage
collect old firmwares version.
For pkgbase users they are now in the FreeBSD-firmware-iwm package.
Sponsored by: Beckhoff Automation GmbH & Co. KG
For now we don't ship anything in /boot/firmware, but some up coming commit
will ship wifi drivers in it and we want them to be in their own package.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Change POOL_NEXT_SIZE define value from 0 to BIT(30), since this define
is used to request the available maximum sized flow table, and zero doesn't
make sense for it, whereas many places in the driver use zero explicitly
expecting the smallest table size possible but instead due to this
define they end up allocating the biggest table size unawarely.
Sponsored by: NVidia networking
Align the code of fdb steering with flow steering core
and add missing parts in namespace initialization and
in prio logic
PR: 281714
Sponsored by: NVidia networking
This reverts commit 7bcf5319c1.
Turns out this is needed for gcc, at least through gcc 14. This wasn't
documented it the import when it came in, so revert with this note.
Sponsored by: Netflix
Register the PCINT handler using the nmi_{register, remove}_handler
interfaces (introduced in D46421) in preparation for hwt(4)'s
Intel Processor Trace backend. No functional change intended.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D47989
This patch adds several routines that track and expose information
about various XSAVE-related features. More specifically, it adds the
ability to check whether a given XFEATURE is supported and which XSAVE
extensions are supported. Furthermore, it adds several routines for
calculating the size and offsets within a save area given a XSAVE
feature bitmap.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D47394
This patch adds definitions for Intel PT-related MSRs and
several PT feature bits.
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D46419
This patch refactors the Performance Counter interrupt setup code to
allow sharing the interrupt line between multiple drivers.
More specifically, Performance Counter interrupts are used by both
hwpmc(4) and hwt(4)'s upcoming Intel Processor Trace backend.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D46420
This refactor aims to add the ability to share performance counter
interrupts by refactoring the kernel-mode NMI handler. The handler now
allows multiple drivers to service the same interrupt (e.g. hwpmc(4)
and hwt(4)'s Intel Processor Trace backend).
Reviewed by: kib, avg
Differential Revision: https://reviews.freebsd.org/D46421
Note in the manpage that the 2024 edition finally added ppoll(), and
also add the appropriate declarations for the correct versions of
_POSIX_C_SOURCE (via __POSIX_VISIBLE).
Differential Revision: https://reviews.freebsd.org/D48043
Use dmesg(8) instead rather than relying on a particular syslogd
configuration, and just skip the test if we can't access the msgbuf.
While we're here, remove some debugging output that we don't actually
need.
-e follows the symlink to see if the file exists. I tested on the wrong
tree, so it appeared to work for me. Change to -h which see if the link
is there or not. The file will never not be a link if present.
Fixes: 42ee30f19c
Noticed by: Herbert Skuhra
Sponsored by: Netflix
We don't bother tweaking the sysctl in these tests, we'll just try with
it forced both on and off via proccontrol(1). This could be problematic
in the face of pid wrapping if we got really unfortunate, but the
potential solutions need careful consideration- you probably don't want
to assume a certain velocity of messages into syslog, so just checking
the last N lines is probably similarly flakey.
I added a third value for kern.logsigexit to mean 'auto' as an abundance
of caution, but I don't know how much it matters -- that can be easily
consolidated back to boolean-ish.
This is primarily targeted towards people running test suites under CI
(e.g. buildbot, jenkins). Oftentimes tests entail segfaults that are
expected, and logs get spammed -- this can be particularly high volume
depending on the application. Per-process control of this behavior is
desirable because they may still want to be logging legitimate
segfaults, so the system-wide atomic bomb kern.logsigexit=0 is not a
great option.
This adds a process flag to disable it, controllable via
procctl(2)/proccontrol(1); the latter knows it as "sigexitlog" due to
its length, but it's referred to almost everywhere else as
"sigexit_log."
Reviewed by: kib (earlier version), pstef
Differential Revision: https://reviews.freebsd.org/D21903
The error may be due to an error while writing, but it's more helpful to
report what we were trying to from rather than "stdout" for these
errors. Noticed because of what happens now when `cat` gets an EISDIR
for reading from a dirfd:
kevans@ifrit:~$ cat /etc
cat: stdout: Is a directory
which, after this change, becomes:
kevans@aarch64-dev:~$ cat /etc
cat: /etc: Is a directory
Reviewed by: allanjude, des, mm
Differential Revision: https://reviews.freebsd.org/D41784
Safe mode may be enabled because of some problem discovered with a kmod,
thus wanting to avoid devmatch. Honor it and let the user deal with
the fallout of not autoloading modules. We've at least made it to
userland and the user demonstrably has a local console as they selected
safe mode in the first place, so this shouldn't be fatal if we don't,
e.g., load a necessary NIC driver.
This may be used to disable or limit functionality of some services
when safe mode is selected. The particular value of boot_safe should not
be considered significant, only its presence in the environment.
Reviewed by: imp, tsoome
Differential Revision: https://reviews.freebsd.org/D32172
Note in the manpage that the 2024 edition finally added ppoll(), and
also add the appropriate declarations for the correct versions of
_POSIX_C_SOURCE.
Differential Revision: https://reviews.freebsd.org/D48043
* add a register value for the R92C_FPGA0_POWER_SAVE register
* add the field names and mask
* add a mask for the 40MHz upper/lower bits in R92C_RMRR; I think
I need to debug and overhaul the 20/40MHz config path to get 40MHz
working right.
Local testing:
* rtl8188eu, sta mode
* rtl8192cu, sta mode
* RX frames with short-GI can be either HT or VHT
* Add placeholders for RX VHT rate, PHY type, etc
Differential Revision: https://reviews.freebsd.org/D47902
ELF_BSDF_VMNOOVERCOMMIT was introduced in time for stable/13 (but not
stable/12), so is now in all supported branches. We're highly unlikely
to merge future versions to stable/13 let alone anything earlier.
Sponsored by: Netflix
In the import of 5.2.1 (c5ad81420c), JEMALLOC_FALLTHROUGH was changed
to break (judging by the tagged upstream sources). This changes it back
to upstream. No functional change: this is just a textual change (though
the fallthrough macro doesn't expand to break).
Sponsored by: Netflix
Make it easire to update jemalloc by moving the FreeBSD specific files
and the generated files into lib/libc. This allows us to regenerate them
more easily, and emphasizes a bit that we may have to regenerate stuff
from upstream.
This is necessary to also unthin the import from the vendor branch as
well (which will be needed to simplify the imports in the future since
we are trying to use contrib/jemalloc for two different things).
No functional change.
Sponsored by: Netflix
With the jemalloc.3 move into the tree (it's a generated file that we
don't/can't generate as part of the build), we need to remove it from
the .OBJDIR or make gets confused about how to build it (honestly for
reasons unknown).
Sponsored by: Netflix
The more generated things that are in contrib/jemalloc tree, the more
chances for interference goes way up. So, move this file into our
lib/libc tree. I didn't add a 'generated file' line / info, but this is
funky enough I don't think we need that. We do add things to the man
page, and that should be tracked in the contrib/jemalloc tree to allow
better importing experience.
Sponsored by: Netflix
Summary: Export the kernel API pgrp_calc_jobc for use by other modules or functions.
Reviewed By: kib
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D47539
We used to have two different code paths for generating release media
dist sets, one which expected to run as root, and one which did not.
It was possible that the two different paths could generate different
results.
We can use the path that does not *require* root also when running as
root, so use it always. We'll want to do eventually do the same for all
release targets, but these ones are an easy place to start.
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48041
This ensures a blank line between the end of the struct timeval
definition and the following paragraph. Formatting change only.
Sponsored by: Chelsio Communications
distributeworld is the target used to stage world for building dist sets
for release targets, and is not really intended for end-user use. If
DISTDIR is not set we would attempt to write to the root directory.
Error out in this case, serving as an assertion that an internal target
is not being used incorrectly.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48030
Unusually, the FUSE_NOTIFY_INVAL_INODE and FUSE_NOTIFY_INVAL_ENTRY
messages are fully asynchronous. The server sends them to the kernel
unsolicited. That means that unlike every other fuse message coming
from the server, these two arrive to a potentially unbusied mountpoint.
So they must explicitly busy it. Otherwise a page fault could result if
the mountpoint were being unmounted.
Reported by: JSML4ThWwBID69YC@protonmail.com
MFC after: 2 weeks
Re-ordering the fields suppresses the trailing padding which was causing
the structure to overflow 'struct fid'.
While here, re-indent in a more visually pleasing way.
Reviewed by: rmacklem, emaste, markj
Approved by: markj (mentor)
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D47955
As the 'gen' field in 'struct tarfs_node' (and then 'struct tarfs_fid')
is filled with arc4random() which returns an unsigned int, change its
type in both structures. This allows reordering fields in 'struct
tarfs_fid' to reduce its size, finally avoiding the use of '__packed' to
ensure it fits into 'struct fid'.
While here, remove the 'data0' field which wasn't necessary from the
start.
Reviewed by: markj, rmacklem, des
Approved by: markj (mentor)
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D47954