HardenedBSD/src 304b948sys/arm64/arm64 pmap.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+154-14sys/arm64/arm64/pmap.c
+154-141 files

HardenedBSD/src a803837sys/arm64/arm64 pmap.c

arm64 pmap: Add ATTR_CONTIGUOUS support [Part 3]

Introduce L3C promotion of base page mappings.  When the base page size
is 4KB, use ATTR_CONTIGUOUS to promote 16 aligned, contiguous base page
mappings to a 64KB mapping.  Alternatively, when the base page size is
16KB, use ATTR_CONTIGUOUS to promote 128 aligned, contiguous base page
mappings to a 2MB mapping.

Given the frequency of L3C counter updates, switch to per-CPU counters
to avoid cache line ping ponging.

Revise the L3C counter descriptions to reflect the fact that the size
of an L3C mapping varies depending on the base page size.

Co-authored-by: Eliot Solomon <ehs3 at rice.edu>
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D44983
DeltaFile
+154-14sys/arm64/arm64/pmap.c
+154-141 files

HardenedBSD/src a4ce32ccddl/lib/libzpool Makefile, sbin/nvmecontrol fabrics.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+0-24sys/sys/protosw.h
+5-8sys/netinet/tcp_subr.c
+2-2sys/netinet6/icmp6.c
+2-2sbin/nvmecontrol/fabrics.c
+2-0cddl/lib/libzpool/Makefile
+1-1sys/dev/nvme/nvme.h
+12-373 files not shown
+13-399 files

HardenedBSD/src f696311sys/netinet6 in6_rmx.c

in6_rmx: remove unnecessary socketvar.h
DeltaFile
+0-1sys/netinet6/in6_rmx.c
+0-11 files

HardenedBSD/src b6b4ac2sys/netinet tcp_hostcache.c

tcp_hostcache: remove unnecessary socketvar.h
DeltaFile
+0-1sys/netinet/tcp_hostcache.c
+0-11 files

HardenedBSD/src b925d71sys/netinet6 icmp6.c, sys/sys protosw.h

sockets: garbage collect PRCOREQUESTS and stale comment

The code deleted predates FreeBSD history.  The comment deleted is 99%
outdated.  Why KAME decided to use these constants instead of normal ones
also lost in centuries.
DeltaFile
+0-24sys/sys/protosw.h
+2-2sys/netinet6/icmp6.c
+2-262 files

HardenedBSD/src 29d7e39sys/dev/nvme nvme.h

nvme: Bump the alignment of struct nvme_health_information_page to 8

This ensures that embedded uint64_t values used for statistics
counters are aligned when allocating a structure on the stack or as
part of a containing structure.  In particular this quiets
-Waddress-of-packed-member warnings from GCC when compiling the code
in nvmfd to update the stats.

Reported by:    GCC
DeltaFile
+1-1sys/dev/nvme/nvme.h
+1-11 files

HardenedBSD/src 766c4adcddl/lib/libzpool Makefile

libzpool: Disable -Wpointer-to-int-cast warnings for GCC

This warning is already disabled for zfs.ko.
DeltaFile
+2-0cddl/lib/libzpool/Makefile
+2-01 files

HardenedBSD/src c870340sbin/nvmecontrol fabrics.c

nvmecontrol: Fix a sign compare mismatch

Even though mqes (uint16_t) and queue_size (u_int) are both unsigned,
the expression 'mqes + 1' gets promoted to int which is signed.  Keep
the value unsigned by explicitly promoting mqes to u_int before
incrementing the value.

Reported by:    GCC
DeltaFile
+2-2sbin/nvmecontrol/fabrics.c
+2-21 files

HardenedBSD/src 6ca0468lib/libcbor Makefile

libcbor: Ignore errors for unknown #pragmas

libcbor embeds clang-specific #pragmas that GCC then warns about.

Reviewed by:    emaste
DeltaFile
+1-0lib/libcbor/Makefile
+1-01 files

HardenedBSD/src d790353sys/dev/clk/starfive jh7110_clk_pll.c jh7110_clk.c, sys/dev/mmc/host dwmmc_starfive.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+386-0sys/dev/clk/starfive/jh7110_clk_pll.c
+277-0sys/dev/clk/starfive/jh7110_clk.c
+261-0sys/dev/clk/starfive/jh7110_clk_sys.c
+211-0sys/dev/clk/starfive/jh7110_clk_pll.h
+168-0sys/dev/clk/starfive/jh7110_clk_aon.c
+114-0sys/dev/mmc/host/dwmmc_starfive.c
+1,417-013 files not shown
+1,780-37119 files

HardenedBSD/src c45215dcontrib/llvm-project/clang/lib/CodeGen CGObjCGNU.cpp CGBuiltin.cpp, contrib/llvm-project/clang/lib/Format UnwrappedLineParser.cpp

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+28-20contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
+23-17contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp
+20-14contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp
+16-13contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp
+14-11contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp
+16-4contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
+117-7932 files not shown
+215-15938 files

HardenedBSD/src 95fee60contrib/llvm-project/clang/lib/CodeGen CGObjCGNU.cpp CGBuiltin.cpp, contrib/llvm-project/clang/lib/Format UnwrappedLineParser.cpp

Merge branch 'freebsd/13-stable/main' into hardened/13-stable/master
DeltaFile
+28-20contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
+23-17contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp
+20-14contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp
+16-13contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp
+14-11contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp
+16-4contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
+117-7932 files not shown
+215-15938 files

HardenedBSD/src e5e6242lib/clang/include/llvm/Config llvm-config.h Disassemblers.def

lib/clang: clean out old llvm/clang Sparc target remnants

The WITH_LLVM_TARGET_ENABLE_SPARC option was removed a long time ago,
but some ifdefs were still laying around, so clean them up.

PR:             276104
MFC after:      3 days

(cherry picked from commit 6f444019009a55aac18d18054d154155fbf606c9)
DeltaFile
+0-4lib/clang/include/llvm/Config/llvm-config.h
+0-3lib/clang/include/llvm/Config/Disassemblers.def
+0-3lib/clang/include/llvm/Config/AsmParsers.def
+0-3lib/clang/include/llvm/Config/AsmPrinters.def
+0-3lib/clang/include/llvm/Config/Targets.def
+0-165 files

HardenedBSD/src 3c6fe83lib/clang/include VCSVersion.inc, lib/clang/include/clang/Basic Version.inc

Fixup: Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9

Update version numbers, config headers, etc. Git tricked me into losing
these before pushing.

PR:             276104
Fixes:          d67fc74b9249
MFC after:      3 days

(cherry picked from commit 894cb08f0d3656fdb81f4d89085bedc4235f3cb6)
DeltaFile
+3-3lib/clang/include/lldb/Version/Version.inc
+3-3lib/clang/include/clang/Basic/Version.inc
+3-3lib/clang/include/VCSVersion.inc
+2-2lib/clang/include/llvm/Config/config.h
+2-2lib/clang/include/llvm/Config/llvm-config.h
+1-1lib/clang/include/llvm/Support/VCSRevision.h
+14-141 files not shown
+15-157 files

HardenedBSD/src 67df63fcontrib/llvm-project/clang/lib/CodeGen CGObjCGNU.cpp CGBuiltin.cpp, contrib/llvm-project/clang/lib/Format UnwrappedLineParser.cpp

Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9.

PR:             276104
MFC after:      3 days

(cherry picked from commit 5678d1d98a348f315453555377ccb28821a2ffcd)
DeltaFile
+28-20contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
+23-17contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp
+20-14contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp
+16-13contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp
+14-11contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp
+16-4contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
+117-7921 files not shown
+200-12827 files

HardenedBSD/src 0b8cdaclib/clang/include/llvm/Config llvm-config.h AsmPrinters.def

lib/clang: clean out old llvm/clang Sparc target remnants

The WITH_LLVM_TARGET_ENABLE_SPARC option was removed a long time ago,
but some ifdefs were still laying around, so clean them up.

PR:             276104
MFC after:      3 days

(cherry picked from commit 6f444019009a55aac18d18054d154155fbf606c9)
DeltaFile
+0-4lib/clang/include/llvm/Config/llvm-config.h
+0-3lib/clang/include/llvm/Config/AsmPrinters.def
+0-3lib/clang/include/llvm/Config/Disassemblers.def
+0-3lib/clang/include/llvm/Config/Targets.def
+0-3lib/clang/include/llvm/Config/AsmParsers.def
+0-165 files

HardenedBSD/src a17c251lib/clang/include VCSVersion.inc, lib/clang/include/clang/Basic Version.inc

Fixup: Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9

Update version numbers, config headers, etc. Git tricked me into losing
these before pushing.

PR:             276104
Fixes:          d67fc74b9249
MFC after:      3 days

(cherry picked from commit 894cb08f0d3656fdb81f4d89085bedc4235f3cb6)
DeltaFile
+3-3lib/clang/include/VCSVersion.inc
+3-3lib/clang/include/lldb/Version/Version.inc
+3-3lib/clang/include/clang/Basic/Version.inc
+2-2lib/clang/include/llvm/Config/llvm-config.h
+2-2lib/clang/include/llvm/Config/config.h
+1-1lib/clang/include/lld/Common/Version.inc
+14-141 files not shown
+15-157 files

HardenedBSD/src fe72d8econtrib/llvm-project/clang/lib/CodeGen CGObjCGNU.cpp CGBuiltin.cpp, contrib/llvm-project/clang/lib/Format UnwrappedLineParser.cpp

Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9.

PR:             276104
MFC after:      3 days

(cherry picked from commit 5678d1d98a348f315453555377ccb28821a2ffcd)
DeltaFile
+28-20contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
+23-17contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp
+20-14contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp
+16-13contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp
+14-11contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp
+16-4contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
+117-7921 files not shown
+200-12827 files

HardenedBSD/src 0612538sys/dev/clk/starfive jh7110_clk_pll.c jh7110_clk.c

jh7110: Add StarFive JH7110 clock/reset generator drivers

Implement a core clknode driver for the JH7110 (StarFive VisionFive v2)
platform.

Add clock/reset generator drivers for the PLL, SYS, and AON clock
groupings.

Co-authored-by: mhorne
Reviewed by:    mhorne
Sponsored by:   The FreeBSD Foundation (mhorne's contributions)
Differential Revision:  https://reviews.freebsd.org/D43037
DeltaFile
+386-0sys/dev/clk/starfive/jh7110_clk_pll.c
+277-0sys/dev/clk/starfive/jh7110_clk.c
+261-0sys/dev/clk/starfive/jh7110_clk_sys.c
+211-0sys/dev/clk/starfive/jh7110_clk_pll.h
+168-0sys/dev/clk/starfive/jh7110_clk_aon.c
+72-0sys/dev/clk/starfive/jh7110_clk.h
+1,375-01 files not shown
+1,379-07 files

HardenedBSD/src 6ea05fcsys/dev/clk/starfive jh7110_clk_pll.c jh7110_clk.c

Revert "jh7110: Add StarFive JH7110 clock/reset generator drivers"

I did not set the author field properly; revert to fix this.

This reverts commit 5d6d6278979b9eab598a23c804d23e930d2f7268.
DeltaFile
+0-386sys/dev/clk/starfive/jh7110_clk_pll.c
+0-277sys/dev/clk/starfive/jh7110_clk.c
+0-261sys/dev/clk/starfive/jh7110_clk_sys.c
+0-211sys/dev/clk/starfive/jh7110_clk_pll.h
+0-168sys/dev/clk/starfive/jh7110_clk_aon.c
+0-72sys/dev/clk/starfive/jh7110_clk.h
+0-1,3751 files not shown
+0-1,3797 files

HardenedBSD/src c8b472asys/dev/mmc/host dwmmc_starfive.c, sys/riscv/conf std.starfive

jh7110: enable MMC driver

Add a variant of the existing dwmmc driver, and enable it in the GENERIC
kernel.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D44026
DeltaFile
+114-0sys/dev/mmc/host/dwmmc_starfive.c
+4-0sys/riscv/conf/std.starfive
+1-0sys/riscv/starfive/files.starfive
+119-03 files

HardenedBSD/src a77e1f0sys/arm/arm busdma_machdep.c, sys/arm64/arm64 busdma_bounce.c

busdma: better handling of small segment bouncing

Typically, when a DMA transaction requires bouncing, we will break up
the request into segments that are, at maximum, page-sized.

However, in the atypical case of a driver whose maximum segment size is
smaller than PAGE_SIZE, we end up inefficiently assigning each segment
its own bounce page. For example, the dwmmc driver has a maximum segment
size of 2048 (PAGE_SIZE / 2); a 4-page transfer ends up requiring 8
bounce pages in the current scheme.

We should attempt to batch segments into bounce pages more efficiently.
This is achieved by pushing all considerations of the maximum segment
size into the new _bus_dmamap_addsegs() function, which wraps
_bus_dmamap_addseg(). Thus we allocate the minimal number of bounce
pages required to complete the entire transfer, while still performing
the transfer with smaller-sized transactions.

For most drivers with a segment size >= PAGE_SIZE, this will have no

    [8 lines not shown]
DeltaFile
+17-29sys/x86/x86/busdma_bounce.c
+10-17sys/riscv/riscv/busdma_bounce.c
+9-17sys/powerpc/powerpc/busdma_machdep.c
+10-14sys/arm64/arm64/busdma_bounce.c
+22-0sys/kern/subr_busdma_bounce.c
+7-14sys/arm/arm/busdma_machdep.c
+75-916 files

HardenedBSD/src 5604069sys/arm/arm busdma_machdep.c, sys/arm64/arm64 busdma_bounce.c

busdma: deduplicate _bus_dmamap_addseg() function

It is functionally identical in all implementations, so move the
function to subr_busdma_bounce.c. The KASSERT present in the x86 version
is now enabled for all architectures. It should be universally
applicable.

Reviewed by:    jhb
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D45047
DeltaFile
+4-48sys/x86/x86/busdma_bounce.c
+48-0sys/kern/subr_busdma_bounce.c
+4-41sys/arm64/arm64/busdma_bounce.c
+4-41sys/powerpc/powerpc/busdma_machdep.c
+4-41sys/riscv/riscv/busdma_bounce.c
+4-41sys/arm/arm/busdma_machdep.c
+68-2126 files

HardenedBSD/src 5d6d627sys/dev/clk/starfive jh7110_clk_pll.c jh7110_clk.c

jh7110: Add StarFive JH7110 clock/reset generator drivers

Implement a core clknode driver for the JH7110 (StarFive VisionFive v2)
platform.

Add clock/reset generator drivers for the PLL, SYS, and AON clock
groupings.

Co-authored-by: mhorne
Reviewed by:    mhorne
Sponsored by:   The FreeBSD Foundation (mhorne's contributions)
Differential Revision:  https://reviews.freebsd.org/D43037
DeltaFile
+386-0sys/dev/clk/starfive/jh7110_clk_pll.c
+277-0sys/dev/clk/starfive/jh7110_clk.c
+261-0sys/dev/clk/starfive/jh7110_clk_sys.c
+211-0sys/dev/clk/starfive/jh7110_clk_pll.h
+168-0sys/dev/clk/starfive/jh7110_clk_aon.c
+72-0sys/dev/clk/starfive/jh7110_clk.h
+1,375-01 files not shown
+1,380-07 files

HardenedBSD/src cf08768sys/riscv/starfive starfive_syscon.c files.starfive

starfive: add a syscon driver

It serves the purpose of attaching syscon devices as early as possible;
this is required for early attachment of the PLL clock driver.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D44270
DeltaFile
+87-0sys/riscv/starfive/starfive_syscon.c
+1-0sys/riscv/starfive/files.starfive
+88-02 files

HardenedBSD/src b24e353sys/netinet in_fib_dxr.c

fib_dxr: set fib_data field in struct dxr_aux early enough

Previously it was possible for dxr_build() to return with da->fd
unset in case of range_tbl or x_tbl malloc() failures.  This
may have led to NULL ptr dereferencing in dxr_change_rib_batch().

MFC after:      1 week

PR:             278422
DeltaFile
+1-1sys/netinet/in_fib_dxr.c
+1-11 files

HardenedBSD/src 4aa275fsys/netinet in_fib_dxr.c

fib_dxr: s/KASSERT/MPASS/

MFC after:      1 week
DeltaFile
+13-20sys/netinet/in_fib_dxr.c
+13-201 files

HardenedBSD/src 7a5de1dsys/netinet in_fib_dxr.c

fib_dxr: KASSERTs for chasing NULL ptr and runaway refcount suspects

MFC after:      1 week
DeltaFile
+3-0sys/netinet/in_fib_dxr.c
+3-01 files

HardenedBSD/src ed541e2sys/netinet in_fib_dxr.c

fib_dxr: move the bulko of malloc() failure logging into dxr_build()
DeltaFile
+30-47sys/netinet/in_fib_dxr.c
+30-471 files