FreeBSD/src a4c71d0libexec/atf/atf-sh/tests Makefile

atf-sh: install kmod_test added as part of the 0.26 release

Fixes:  952231086100 ("contrib/atf: upgrade to 0.26")
DeltaFile
+1-0libexec/atf/atf-sh/tests/Makefile
+1-01 files

FreeBSD/src 2793e54sys/dev/sound/macio onyx.c tumbler.c, sys/dev/sound/pci solo.c

sound: Use uint8_t instead of legacy u_char

No functional change intended.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
DeltaFile
+30-30sys/dev/sound/macio/snapper.c
+22-22sys/dev/sound/macio/tumbler.c
+13-13sys/dev/sound/pci/solo.c
+13-13sys/dev/sound/macio/onyx.c
+10-10sys/dev/sound/pci/hda/hdaa.h
+1-1sys/dev/sound/pcm/buffer.c
+89-891 files not shown
+90-907 files

FreeBSD/src 1adbb3fsys/compat/linuxkpi/common/include/linux compiler.h

LinuxKPI: implement __UNIQUE_ID() macro

Requred by drm-kmod v6.12.103

Obtained from:  OpenBSD

Reviewed by:    bz, emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59733

(cherry picked from commit 8b05d84be9e288d201e8631750ae180b07311ba7)
DeltaFile
+4-0sys/compat/linuxkpi/common/include/linux/compiler.h
+4-01 files

FreeBSD/src fbaa247sys/compat/linuxkpi/common/include/linux string.h

Implement vmemdup_{array}_user

This is what FreeBSD now does for memdup_user and memdup_array_user
(which is wrong for memdup, but correct for vmemdup).

The amdgpu DRM driver started this in Linux ~6.12.86+

Reviewed by:    wulf
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57444

(cherry picked from commit 302c6d25da6907ec762ff8937fa86d380743b000)
DeltaFile
+26-0sys/compat/linuxkpi/common/include/linux/string.h
+26-01 files

FreeBSD/src 7710a16sys/compat/linuxkpi/common/include/linux file.h cleanup.h

linuxkpi: Define `DEFINE_CLASS()` and `CLASS()`

`DEFINE_CLASS()` is in fact named `LINUXKPI_DEFINE_CLASS()` because it
conflicts with `DEFINE_CLASS()` defined in <sys/kobj.h>.

This macro defines a type and a pair of constructor/destructor
functions.

They are to be used by `CLASS()`: this one declares a variable,
initialise it with the constructor and set the `__cleanup()` attribute
to call the destructor once the variable goes out of scope.

The DRM drivers generic code started to use `CLASS()` in Linux 6.13. It
requires the `fd` class to be defined in <linux/file.h>.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57583

(cherry picked from commit f2a2e02ae54b836d1e23648756a050406f65111e)
DeltaFile
+26-0sys/compat/linuxkpi/common/include/linux/cleanup.h
+2-0sys/compat/linuxkpi/common/include/linux/file.h
+28-02 files

FreeBSD/src 4befe50sys/compat/linuxkpi/common/include/linux file.h

linuxkpi: Add 'fd_empty()`

The DRM drivers generic code started to use it in Linux 6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57582

(cherry picked from commit 50aa145171bc88edde8cf3b7eb13dbbf88a3f8a7)
DeltaFile
+6-0sys/compat/linuxkpi/common/include/linux/file.h
+6-01 files

FreeBSD/src b85fe12sys/compat/linuxkpi/common/include/linux pci_ids.h pci.h

LinuxKPI: Add PCI_EXP_TYPE_UPSTREAM and PCI_VENDOR_ID_AMD defines

Required by drm-kmod v6.12.105

Reviewed by:    bz, emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59734

(cherry picked from commit 52d1a0c62be1b4bd8e78ee57c86288246d948046)
DeltaFile
+1-0sys/compat/linuxkpi/common/include/linux/pci_ids.h
+1-0sys/compat/linuxkpi/common/include/linux/pci.h
+2-02 files

FreeBSD/src 74d325fsys/amd64/amd64 mp_machdep.c machdep.c, sys/amd64/include md_var.h pcpu.h

amd64: cache MSR_MEMORY_CTL in pcpu

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D59815
DeltaFile
+11-0sys/amd64/amd64/initcpu.c
+3-4sys/amd64/amd64/machdep.c
+2-1sys/amd64/include/pcpu.h
+2-0sys/amd64/amd64/mp_machdep.c
+1-0sys/amd64/include/md_var.h
+19-55 files

FreeBSD/src 51cea54sys/amd64/amd64 sys_machdep.c, sys/x86/include sysarch.h

amd64: add userspace control for disabling splitlocks

Thread can control it with sysarch(I386_SET_SPLITLOCK). The global
default is set with hw.splitlock_force.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D59815
DeltaFile
+26-1sys/amd64/amd64/sys_machdep.c
+2-0sys/x86/include/sysarch.h
+28-12 files

FreeBSD/src 20c09e6sys/amd64/amd64 machdep.c

amd64: use WRMSRNS immediate form to update splitlock control, when available

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D59815
DeltaFile
+34-4sys/amd64/amd64/machdep.c
+34-41 files

FreeBSD/src e318f24sys/amd64/amd64 vm_machdep.c exec_machdep.c, sys/amd64/include proc.h md_var.h

amd64: support for tracking per-thread 'disable splitlocks' state

If hw supports it, on atomic operation that requires exclusive ownership
of more than one cache line, #AC is generated.
The state is maintained as the arch-private TDF_MD_SPLITLOCK_AC flag.

The state is inherited on thread creation from the thread spawning the
new one.  It is cleared on exec.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D59815
DeltaFile
+36-0sys/amd64/amd64/machdep.c
+14-0sys/amd64/amd64/pmap.c
+10-0sys/amd64/amd64/exec_machdep.c
+5-0sys/amd64/include/md_var.h
+2-0sys/amd64/include/proc.h
+2-0sys/amd64/amd64/vm_machdep.c
+69-03 files not shown
+72-09 files

FreeBSD/src c6d7235sys/amd64/amd64 trap.c

amd64: handle #AC in kernel mode

Recover from it if PCB_ONFAULT handler is provided.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D59815
DeltaFile
+8-0sys/amd64/amd64/trap.c
+8-01 files

FreeBSD/src 71f08bfsys/x86/include x86_var.h specialreg.h, sys/x86/x86 identcpu.c

x86: add cpu_stdext_feature5

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D59815
DeltaFile
+10-0sys/x86/x86/identcpu.c
+5-0sys/x86/include/specialreg.h
+1-0sys/x86/include/x86_var.h
+16-03 files

FreeBSD/src d8c1abbsys/amd64/amd64 machdep.c initcpu.c, sys/amd64/include md_var.h

amd64: calculate if hardware supports disabling splitlocks

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D59815
DeltaFile
+18-0sys/amd64/amd64/initcpu.c
+11-0sys/amd64/amd64/machdep.c
+3-0sys/amd64/include/md_var.h
+32-03 files

FreeBSD/src 9aa031esys/x86/include specialreg.h

x86: add definitions for the CORE_CAP and MEMORY_CTL MSRs

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D59815
DeltaFile
+8-0sys/x86/include/specialreg.h
+8-01 files

FreeBSD/src dc97561sys/amd64/include proc.h

amd64: add md thread flags word

Use a hole in struct mdthread.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D59815
DeltaFile
+1-0sys/amd64/include/proc.h
+1-01 files

FreeBSD/src 4a8acccsys/amd64/include cpufunc.h

amd64 cpufunc.h: add WRMSRNS helpers

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D59815
DeltaFile
+13-0sys/amd64/include/cpufunc.h
+13-01 files

FreeBSD/src 9522310contrib/atf config.h NEWS, contrib/atf/atf-c++/detail auto_array.hpp auto_array_test.cpp

contrib/atf: upgrade to 0.26

This new version gets contrib/atf in line with the published version of
the package up on [GitHub][github].

Please note that this release is a major update: it contains several
bugfixes and feature enhancements. Most were already present in the
FreeBSD src repo, but there were a large number of changes made in
addition to what was already present.

MFC after:      1 month

Merge commit '9c78088348bcf1059d82a62bb57a0746309d4312'

Conflicts:
        contrib/atf/.cirrus.yml
        contrib/atf/Makefile.am
        contrib/atf/Makefile.in
        contrib/atf/aclocal.m4

    [47 lines not shown]
DeltaFile
+0-336contrib/atf/doc/atf-test-case.4
+328-0contrib/atf/doc/atf-test-case.7
+0-302contrib/atf/atf-c++/detail/auto_array_test.cpp
+147-53contrib/atf/NEWS
+0-175contrib/atf/atf-c++/detail/auto_array.hpp
+115-17contrib/atf/config.h
+590-88370 files not shown
+1,264-1,53476 files

FreeBSD/src 6d9f435sys/dev/hwpmc hwpmc_amd.c hwpmc_ibs.c

hwpmc: fix leak of IBS per-CPU array on unload

pmc_ibs_initialize() allocates the ibs_pcpu[] pointer array, and
pmc_ibs_finalize() exists to free it, but pmc_ibs_finalize() is
never called.  Every hwpmc unload on a CPU with IBS therefore leaks
one pmc_cpu_max()-sized pointer array.

Call pmc_ibs_finalize() from pmc_amd_finalize(), alongside the RAPL,
TSC and perf classes.  IBS is only initialized on CPUs that support
it, so make pmc_ibs_finalize() return early when ibs_pcpu is NULL,
making it safe to call when the class was skipped at initialize
time, as pmc_rapl_finalize() already is.

Tested on an AMD Ryzen 5 5600X (Zen 3, 12 threads) with INVARIANTS.
Before the change, each kldload/kldunload cycle leaked one 96-byte
M_PMC allocation, and DTrace showed the ibs_pcpu[] allocation from
pmc_ibs_initialize() as the only one never freed.  After the change,
50 load/unload cycles leave M_PMC InUse and MemUse unchanged, and
every allocation made at load is freed at unload.

    [5 lines not shown]
DeltaFile
+4-0sys/dev/hwpmc/hwpmc_ibs.c
+2-0sys/dev/hwpmc/hwpmc_amd.c
+6-02 files

FreeBSD/src 34c4012tests/sys/fs/tarfs tarfs_test.sh

tarfs_test: split large file test into independent cases

This avoids globally set timeouts for the group of
tarfs_large tests on slower emulated architectures.

While here, lower each testcase's timeout to reflect
the reduction of work. On QEMU aarch64, the largest case
runs in ~500s on a modern desktop, so double that for a
conservative estimate.

Discussed with:         des
MFC after:              3 days
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59033
DeltaFile
+78-19tests/sys/fs/tarfs/tarfs_test.sh
+78-191 files

FreeBSD/src fa28edesys/dev/clk/starfive jh7110_clk_sys.c, sys/riscv/starfive files.starfive jh7110_temp.c

jh7110_temp: CPU temperature sensor for JH7110

This patch adds a driver for the CPU temperature sensor on the jh7110
SoC.

The calibration numbers come from the OpenBSD driver but are reworked to
produce a result in K rather than C.

The temperature is exposed as a sysctl, dev.jh7110_temp.0.temperature
but I have also exposed it as dev.cpu.0.temperature because that's where
you find it on a RaspberryPi and amdtemp(4), so it's a lot more obvious.

(mhorne: Added 'starfive,jh7100-temp' compatible.)

Reviewed by:    mhorne, bnovkov
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59478
DeltaFile
+269-0sys/riscv/starfive/jh7110_temp.c
+16-0sys/dev/clk/starfive/jh7110_clk_sys.c
+1-0sys/riscv/starfive/files.starfive
+286-03 files

FreeBSD/src ad0a85f. Makefile.in, lib internal.h xmltok.c

Vendor import of expat 2.8.5
DeltaFile
+349-5tests/basic_tests.c
+100-123lib/xmlparse.c
+139-64lib/xmltok.c
+67-100lib/internal.h
+105-56Makefile.in
+157-0tests/hash_tests.c
+917-34852 files not shown
+1,609-85458 files

FreeBSD/src 82007cesys/dev/ntb/test ntb_tool.c

ntb_tool: Bound memory window option strings

parse_mw_buf() copies option names from privileged sysctl input into
eight-byte stack buffers.  Unbounded %s conversions permit option tokens
longer than seven bytes to write past those buffers before the parser
validates them.

Limit each conversion to seven characters, leaving space for the
terminating NUL.

Signed-off-by: Yudi Yang <yudi.yang at rice.edu>

Fixes:          96f556f5044a ("NTB Tool: Test driver for NTB hardware drivers.")
Reviewed by:    markj
MFC after:      1 week

(cherry picked from commit 602d1b994a22949fff7e4a87cb6e54d6fbad13b6)
DeltaFile
+1-1sys/dev/ntb/test/ntb_tool.c
+1-11 files

FreeBSD/src 9d9063esys/amd64/amd64 pmap.c

amd64/pmap: Return la57 in amd nested page

AMD doesn't encode page depth in eptp. As a result, the page level is
decided by the host la57 value. Without this, it uses 4 level page and
therefore cause machine enable la57 have garbage page translation.

PR:             291768
Reviewed by:    kib
Tested by:      Antranig Vartanian <antranigv at freebsd.am>
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57978

(cherry picked from commit ef26f64c11220ea303de16d088c585f9d2908b0f)
DeltaFile
+13-1sys/amd64/amd64/pmap.c
+13-11 files

FreeBSD/src 65a5b32sys/kern vfs_bio.c

buf: Avoid calling bufdomain() on newly initialized bufs

bufinit() inserts newly initialized bufs into the QUEUE_EMPTY queue, at
which point they haven't yet been assigned a domain.  Thus, bufdomain()
returns &bdomain[-1], which trips the array-bounds sanitizer.

This is harmless since we don't use the result in that case, but let's
avoid the invalid access to begin with.  This is sufficient to let an
amd64 kernel boot to a login prompt with -fsanitize=array-bounds
configured.

Reported by:    Andrew Griffiths <andrew at calif.io>
Reviewed by:    rlibby, kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59381

(cherry picked from commit e1d903bbfaf91060c43209b35b78a9992fbffe5e)
DeltaFile
+4-4sys/kern/vfs_bio.c
+4-41 files

FreeBSD/src 36f268eshare/man/man4 dtrace_pid.4

dtrace_pid.4: Add example "Listing Program's Function Entries"

Reviewed by:    bcr
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57515

(cherry picked from commit 7008192726a30d2d5f8ed912554cc53d7bcf9fba)
DeltaFile
+22-2share/man/man4/dtrace_pid.4
+22-21 files

FreeBSD/src 9b4b68esbin/ipfw ipfw2.c

ipfw: fix gcc warning

We use first loop only for possible needed realloc, so it is not
required to restrict end condition.

Also check realloc() return value before accessing.

This is direct commit to stable/14.

Reported by:    dim
Differential Revision:  https://reviews.freebsd.org/D56616
DeltaFile
+2-2sbin/ipfw/ipfw2.c
+2-21 files

FreeBSD/src 9c78088. README.md NEWS

atf: import atf-0.26

This change imports 0.26 release content from [upstream][1].

The atf-0.26 artifact was been verified by [SHA256 checksum][2].

This update pulls in a large number of memory management fixes, polished upstreamed
content from contrib/atf in FreeBSD (proper), etc.

Please note that this new version requires a C++-20 compatible toolchain
to build.

More information about the release (from a high level) can be found in
the [release notes][3].

Updated via [`update_atf.sh`][4] using `update_atf.sh 0.26 atf-0.26`.

1: https://github.com/freebsd/atf/releases/download/atf-0.26/atf-0.26.tar.gz
2: https://github.com/freebsd/atf/releases/download/atf-0.26/atf-0.26.tar.gz.sha256

    [2 lines not shown]
DeltaFile
+12-3NEWS
+1-1README.md
+13-42 files

FreeBSD/src 9def2eatests/sys/kern unix_stream.c

tests/sys/kern/unix_stream: fix bad assertion

kqueue returns a value != -1 on error. Test for that instead of any
non-zero value to confirm that success was achieved when calling
`kqueue`.

This issue exists with ATF 0.22+ [1].

MFC after:      2 weeks
Reported by:    clang (-Wparenthesis)

[1]: https://github.com/freebsd/atf/pull/72

(cherry picked from commit 4881c7a650571eeb4cd89b5af4c1d3e922a67706)
DeltaFile
+2-1tests/sys/kern/unix_stream.c
+2-11 files

FreeBSD/src c68b38flib/libarchive/tests Makefile

lib/libarchive/tests/Makefile: minor fixes

- Remove trailing whitespace
- Fix typo with variable referenced adding sources for `test_fuzz`.

MFC after:      2 weeks

(cherry picked from commit edbb2e9d7a9aba7194dd0f37cede7aea51408f74)
DeltaFile
+18-17lib/libarchive/tests/Makefile
+18-171 files