If people like me having multiple cards in the same system
creating the debugfs dirctory leads to a panic upon attaching
the 2nd card due to the duplicate name.
Rather than using the hard coded driver name, use the device name
(e.g., rtw880, rtw881, rtw882).
This solves two issues: it avoids the duplicate name and we get
individual debugging/statistic information for each card.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
X-Note: ath1[01]k and mt76 likely will need a similar change
Implement the combination of all four functions, the *_vif versions
from mac80211.h as a wrapper to the non-*_vif ones in cfg80211.h.
Put the function pairs next to each other and in the right files
and harmonize argument naming, etc.
Both of them have shown up too often in the todo-tracing to bother
enough to implement them now for a time in the future when we will
support HE/EHT.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Given the channel struct has an extra bool we cannot assign the
information 1:1 to net80211. While the caps where assigned the
suppoerted mcs sets were not. Fix that.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
A tcpcb in TCPS_LISTEN has always socket in SO_ACCEPTCONN. One block
above there is an assertion that proves that this never happens. We
stopped ever clearing SO_ACCEPTCONN back in 779f106aa1.
This reverts commit 982c1675ff.
Reviewed by: cc, markj
Differential Revision: https://reviews.freebsd.org/D48710
If a Fabrics host is connected, use the discovery log entry from the
reconnect parameters to output the transport type and address.
Reviewed by: chuck
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48731
If a Fabrics host is disconnected, use the cached controller data
instead of reading the cdata via a pass-through command. In addition,
annotate disconnected hosts including the amount of time since the
connection was lost.
Reviewed by: chuck
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48220
This returns an nvlist indicating if a Fabrics host is connected and
the time of the most recent disconnection.
Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48219
Both nvme and nvmf cache a copy of the controller's identify data in
the softc. Add an ioctl to fetch this copy of the cdata. This is
primarily useful for allowing commands like 'nvmecontrol devlist' to
work against a disconnected Fabrics host.
Reviewed by: dab, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48218
This MD function is invoked before dumping register set notes when
writing out a core dump to ensure that the PCB for a given thread is
up to date. This provides a centralized place to update the PCB with
values of the current thread for each arch rather than doing this work
in each register set's get method.
Discussed with: jrtc27
Reviewed by: kib, markj
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D44910
This is generally harmless but can trigger spurious warnings on the
console due to duplicate attempts to disable LUNs.
Sponsored by: Chelsio Communications
Firstly, pagecount is a u_long so we should ensure j is the same for the
sake of 64-bit systems. Secondly, ptoa is just a macro, and does not
cast its argument, so in order to handle PAE systems correctly we need
to cast j to vm_paddr_t (the type of startp).
Fixes: 0078df5f02 ("vm_phys: reduce touching of page->pool fields")
[Why]
The mutex initialized in `xa_init_flags()` is not destroyed here on
purpose. The reason is that on Linux, the xarray remains usable after a
call to `xa_destroy()`. For instance the i915 DRM driver relies on that
during the initialixation of its GuC. Basically, `xa_destroy()` "resets"
the structure to zero but doesn't really destroy it.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48762
[Why]
This function is used by hhe DRM generic code starting with Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48761
[Why]
The i915 DRM driver relies on this chain of includes to access the
definition of `struct tasklet_struct` in `<linux/interrupt.h>`.
Reviewed by: imp, manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48760
[Why]
This is used by the amdgpu DRM driver starting with Linux 6.7.
[How]
The function just returns 0 for now.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48759
[Why]
This is used by the amdgpy DRM driver starting from Linux 6.7.
[How]
The function always returns false, like `pci_is_thunderbolt_attached()`
because we don't have an API for this in FreeBSD yet.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48758
[Why]
This is used by the i915 DRM driver starting from Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48757
[Why]
In Linux 6.7, the signature of `get_file_rcu()` changed significantly,
going from:
bool get_file_rcu(struct linux_file *f);
... to:
struct linux_file * get_file_rcu(struct linux_file **f);
I.e., both the argument and the return value changed in an incompatible
way.
This is used by the i915 DRM driver.
[How]
This patch introduces the variant and hide the new prototype behind
`LINUXKPI_VERSION >= 60700`.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48756
[Why]
The i915 DRM driver started to access the `xa_lock` field in Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48754
[Why]
This function is used by the i915 DRM driver starting with Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48753
[Why]
This function is used by the i915 DRM driver in Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48752
[Why]
Some files in the i915 DRM driver in Linux 6.7 depend on these implicit
inclusions.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48751
[Why]
It is already defined in <asm-generic/io.h> to use the FreeBSD versions.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48750
[Why]
This is used by the amdkfd DRM driver in Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48749
[Why]
This field is used by the i915 DRM driver in Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48748
[Why]
This new API is used by the amdgpu DRM driver is Linux 6.7.
[How]
This is the same as `pci_get_class()` except that it searches a PCI
device matching the base class only; the subclass is ignored.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48746
[Why]
linuxkpi needs to export `pci_get_base_class()` for DRM drivers from
Linux 6.7.
[How]
This new function searches a PCI device with the given base class and
returns it, regardless of its subclass.
The behavior is the same as `pci_find_class_from()` but the subclass is
ignored.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48745
[Why]
This is used by the amdgpu DRM driver in Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48744
[Why]
DRM drivers in Linux 6.7 already use this constant.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48742
[Why]
Some files in DRM rely on namespace pollution: they use the
<linux/rcupdate.h> API without including it explicitly.
[How]
Reproduce the Linux chain of includes even if it means nothing on
FreeBSD. This allows consumers of <linux/idr.h> to "inherit"
<linux/rcupdate.h> API.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48741
Run sysctl -a during the test suite so that KASAN/KMSAN have a chance to
catch something.
Inspired by https://jprx.io/cve-2024-54507/
Reviewed by: jhb, emaste
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D48659
Limit the use of stack clash protection and zeroregs based upon
compiler features:
- switch unconditional use of stack clash protection into a compiler
feature
- limit the use of stack clash protection on unsupported architectures
(I did not wade into the source of each compiler to determine when
support arrived for each architecture, I used the compiler version
when it was introduced with what is supported currently)
- add a safeguard for stack clash protection in places where we have no
SSP provisions (we may not need it, but better safe than sorry when
something changes or is overridden by the user)
- limit the use of zeroregs the same way, so that even specifying it
will not lead to build failures (useful for universe builds when
WITH_ZEROREGS is specified in src.conf)
Differential Revision: https://reviews.freebsd.org/D48724
In 4cc5d081d8, a change was introduced that manipulated
drv_ioctl_data->reqcap using IFCAP2 bits. This was noticed
when creating a mixed lagg with mce0 and ixl0 caused the
interfaces' txcsum caps to be disabled.
Fixes: 4cc5d081d8
Reviewed by: glebius
Sponsored by: Netflix
MFC After: 7 days
UFS1 uses a signed 32-bit value for its times. Zero is
January 1, 1970 UTC. Negative values of 32-bit time predate
January 1, 1970 back to December 13, 1901. The maximum positive
value for 32-bit time is on January 19, 2038 (my 84th birthday).
On that date, time will go negative and start registering from
December 13, 1901. Note that this issue only affects UFS1 filesystems
since UFS2 has 64-bit times. This fix changes UFS1 times from
signed to unsigned 32-bit values. With this change it will no longer
be possible to represent time from before January 1, 1970, but it
will accurately track time until February 7, 2106. Hopefully there
will not be any FreeBSD systems using UFS1 still in existence by
that time (and by then I will have been dead long enough that no-one
will know at whom to yell :-).
It is possible that some existing UFS1 systems will have set times
predating January 1, 1970. With this commit they will appear as
later than the current time. This commit checks inode times when
they are read into memory and if they are greater than the current
time resets them to the current time. By default this reset happens
silently, but setting the sysctl vfs.ffs.prttimechgs=1 will cause
console messages to be printed whenever a future time is changed.
Reviewed-by: kib
Tested-by: Peter Holm
MFC-after: 1 week
Differential Revision: https://reviews.freebsd.org/D48472
Intersting/relevant changes since bmake-20240711
ChangeLog since bmake-20240711
2025-01-25 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20250125
Merge with NetBSD make, sync up below change.
* unit-tests/Makefile: remove $TMPDIR via .END
to avoid failure in test on NFS - since the temp file for the
target script is open and thus gets renamed by the server rather
than removed.
2025-01-20 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20250120
Merge with NetBSD make, pick up
o use FORK_FUNCTION so it can be forced to fork when doing coverage.
o main.c: avoid memory allocation in error path after exec failure.
2025-01-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20250116
Merge with NetBSD make, pick up
o clarify that undefined expressions are allowed in dependencies
o simplify code for evaluating the '!=' variable assignment
2025-01-11 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20250111
Merge with NetBSD make, pick up
o replace "Malformed conditional" with "Variable is undefined"
when appropriate
2025-01-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20250110
Merge with NetBSD make, pick up
o job.c: remove some unnecessary layers in job handling
o unit-tests: test expressions based on undefined variables
2025-01-01 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20250101
Merge with NetBSD make, pick up
o var.c: reduce pointer indirections when unexporting a variable
2024-12-12 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20241212
* mk/ updates
2024-11-24 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20241124
Merge with NetBSD make, pick up
o var.c: fix confusing error message when overriding a read-only
variable
2024-11-22 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20241122
Merge with NetBSD make, pick up
o unit-tests/Makefile: optimize running of tests skip extra cat
in 99% of cases.
2024-11-15 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20241114
Merge with NetBSD make, pick up
o make.1: note that MAKEOBJPREFIX should be absolute path
also that it can be set via makefile if suitable care taken.
2024-11-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20241110
Merge with NetBSD make, pick up
o make: allow .../ (search here and above) in
.MAKE.MAKEFILE_PREFERENCE and -f argument.
2024-11-03 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20241101
Merge with NetBSD make, pick up
o parse.c: report filename:linenumber in parse debug output
2024-09-21 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240921
Merge with NetBSD make, pick up
o make.1: Only list the defaults for MAKEFILE_PREFERENCE once.
* Makefile: use genfiles.mk to generate ${MAN}
so that it can be tuned for local site.
Ensure MAN is defined before including Makefile.inc
* Makefile: use MK_GEN_MAN to make it easier to control whether we
generate ${MAN}
2024-09-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240909
* arch.c: fix NetBSD PR 58597
2024-09-01 Simon J Gerraty <sjg@beast.crufty.net>
* Makefile: use SUBDIR.${MK_TESTS} so that we skip
unit-tests for obj and clean when FreeBSD is building WITHOUT_TESTS
* VERSION (_MAKE_VERSION): 20240901
Merge with NetBSD make, pick up
o reduce line length in error messages
o var.c: simplify printing of an evaluation stack element
2024-08-29 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240828
Merge with NetBSD make, pick up
o add more context to error message about recursive variables
o treat recursive variables non-fatally - continue parsing to end
of makefile
2024-08-12 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240808
Merge with NetBSD make, pick up
o improve some error messages for better clarify and readability
2024-07-22 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240722
Merge with NetBSD make, pick up
o job.c: remove dead code
2024-07-21 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20240720
Merge with NetBSD make, pick up
o compat.c: do not run commands that have parse or evaluation errors.
o var.c: remove wrong error message about an undefined variable
mk/ChangeLog since bmake-20240711
2025-01-10 Simon J Gerraty <sjg@beast.crufty.net>
* rust.mk: use RUST_LIBS and RUST_PROGS
2025-01-01 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20250101
* use W flag to :S and :C rather than :tW
2024-12-16 Simon J Gerraty <sjg@beast.crufty.net>
* rust.mk: add RUSTFLAGS if needed
2024-12-12 Simon J Gerraty <sjg@beast.crufty.net>
* init.mk (OBJS_SRCS_FILTER): apply this as
${OBJS_SRCS_FILTER:ts:} as we do in FreeBSD.
2024-12-03 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20241202
* setopts.sh: needed by newlog.sh
2024-11-22 Simon J Gerraty <sjg@beast.crufty.net>
* meta.sys.mk: add META_MODE_XTRAS to META_MODE to make it
easier to add things like 'env' when debugging.
* install-mk (MK_VERSION): 20241122
* rust.mk: rename CARGO* to RUST_CARGO* so I don't feel
like this makefile should be renamed to cargo.mk
2024-11-11 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: add DIRDEPS_CACHED_ENV to dirdeps-cached and
DIRDEP_USE_EPILOGUE to _DIRDEP_USE
2024-10-30 Simon J Gerraty <sjg@beast.crufty.net>
* meta.sys.mk: if MK_META_ERROR_TARGET is yes and NEWLOG_SH is
set, and ERROR_LOGDIR already exists, hook _rotateErrorLog to
.BEGIN target.
2024-10-27 Simon J Gerraty <sjg@beast.crufty.net>
* options.mk: add support for DEBUG_OPTIONS (similar to
DEBUG_DIRDEPS) to allow us to see where options get set.
Eg. DEBUG_OPTIONS="STAGING*" gives:
bmake[1]: "mk/options.mk" line 89: sys.mk: MK_STAGING=yes (MK_DIRDEPS_BUILD=no)
bmake[1]: "mk/options.mk" line 66: local.init.mk: MK_STAGING=yes
bmake[1]: "mk/options.mk" line 66: local.init.mk: MK_STAGING_PROG=no
bmake[1]: "mk/options.mk" line 89: own.mk: MK_STAGING_MAN=yes (MK_STAGING=yes)
bmake[1]: "mk/options.mk" line 89: own.mk: MK_STAGING_PROG=no (MK_STAGING=yes)
bmake[1]: "mk/options.mk" line 89: own.mk: MK_STAGING_RUST=no (MK_STAGING_PROG=no)
* own.mk: fix setting of STAGE_OBJTOP (normally set by sys.dirdeps.mk)
2024-10-26 Simon J Gerraty <sjg@beast.crufty.net>
* rust.mk: add some documentation and support for staging
2024-10-25 Simon J Gerraty <sjg@beast.crufty.net>
* rust.mk: a means of integrating Rust projects into a larger build.
2024-10-18 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps-targets.mk: if DEBUG_DIRDEPS_TARGETS and we found
STATIC_DIRDEPS_CACHE, report its relative path.
2024-09-30 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: tweak the debug message for "Loading" a
Makefile.depend file, always report what the actual makefile is
with the DIRDEP it is for.
Remove the redundant "Looking" message.
2024-09-26 Simon J Gerraty <sjg@beast.crufty.net>
* meta2deps.py: when raising AssertionError include meta file name
with $SB trimmed if possible.
2024-09-23 Simon J Gerraty <sjg@beast.crufty.net>
* meta2deps.py: replace assert() with raise AssertionError when we
detect missing eXits, to ensure a meaningful message gets into
log.
2024-09-21 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240921
* FILES: add genfiles.mk
2024-09-20 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240920
* cython.mk: Get PYTHON_VERSION from PYTHON
2024-08-31 Simon J Gerraty <sjg@beast.crufty.net>
* subdir.mk: add ${SUBDIR.yes} - allows for SUBDIR.${MK_*}
and handle subdir with '-' in its name.
2024-08-23 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240820
* links.mk: Allow a filter to be applied to SYMLINKS etc.
It is up to [BUILD_][SYM]LINKS_FILTER to do something sane.
Also only claim we are making a symlink if the value changed.
The input for the hash_comment test case was damaged in a cleanup sweep.
Restore the original input and tweak it slightly so it no longer matches
the regex used in said sweep.
Sponsored by: Klara, Inc.
Fixes: 5e3934b15a
findsym() is intended for use while parsing input, so it should not be
called from addsym2() or indirectsym(), which are called before any
input is processed.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D48733
While we're here, send the etcupdate log from generating base.txz
to stdout instead of /dev/null (see e972e408d1) as well.
Reviewed by: emaste, gordon, jrtc27
MFC after: 1 week
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D48719
This allows the parent jail to retrieve or set kernel state when child
does not have sysctl(8) installed (e.g. light weighted OCI containers
or slim jails).
This is especially useful when manipulating jail prison or vnet sysctls.
For example, `sysctl -j foo -Ja` or `sysctl -j foo net.fibs=2`.
Reviewed by: dfr (previous version), markj
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D48618
Let the caller open the file and pass in the file handler. This can
benefit an upcoming change so that we will have cleaner logic.
No functional change intended.
Suggested by: markj
MFC after: 1 week
Reuse the addrinfo structure from the admin queue to establish
connections to I/O queues for the TCP transport.
Reviewed by: dab, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48456
Zero the I/O queue array earlier so that disconnect_nvm_queues() can
be safely used for earlier failures.
Suggested by: dab
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48654