FreeBSD/src 33175a5. ObsoleteFiles.inc

Add a few missed files to ObsoleteFiles.inc

There were still some left-over files under usr/tests/gnu/usr.bin/diff,
causing the directory to not be fully removed. Add these to OLD_FILES.

Fixes:          134a4c78d070
(cherry picked from commit f72cfefae99befe47fefc4683cd6957edaaf0e86)
DeltaFile
+9-0ObsoleteFiles.inc
+9-01 files

FreeBSD/src 2e089a8. ObsoleteFiles.inc

Add a few missed files to ObsoleteFiles.inc

There were still some left-over files under usr/tests/gnu/usr.bin/diff,
causing the directory to not be fully removed. Add these to OLD_FILES.

Fixes:          134a4c78d070
(cherry picked from commit f72cfefae99befe47fefc4683cd6957edaaf0e86)
DeltaFile
+9-0ObsoleteFiles.inc
+9-01 files

FreeBSD/src 74bcb11sys/dev/ena ena.c ena_datapath.c

ena: Fix false 'missing TX completions' warnings due to timestamp race

Sporadic 'Found a Tx that wasn't completed on time' warnings appear
under sustained TX load, always reporting '1 msecs since last cleanup'
despite the 5-second timeout threshold.

The per-packet TX timestamp uses struct bintime (128 bits: two 64-bit
fields sec and frac) which is read and written non-atomically. A race
exists between the missing TX completion check
(check_missing_comp_in_tx_queue reading the timestamp) and the TX
submit path or cleanup path writing it on another CPU. Since the two
fields are not updated atomically, the check can observe a partially
written timestamp - one field from the old value and one from the new.
This can produce a timestamp with {sec=0, frac=valid}, causing the
check to compute a time offset equal to system uptime and falsely
exceeding the 5-second timeout.

Confirmed by instrumentation showing all occurrences had sec=0 with
valid frac/mbuf, cleanup_running=0, and ticks==last_cleanup_ticks.

    [22 lines not shown]
DeltaFile
+7-6sys/dev/ena/ena.c
+2-2sys/dev/ena/ena_datapath.c
+1-1sys/dev/ena/ena.h
+10-93 files

FreeBSD/src 3ba01cbsys/dev/ena ena_datapath.c

ena: Batch RX statistics updates

Move per-packet counter_enter/counter_exit pairs out of the RX
processing loop and batch them into a single update after the
loop completes.

Previously, each received packet triggered two separate
counter_enter/counter_exit blocks -- one for bytes and one for
packet count. This commit accumulates totals in local variables
and updates all four counters (ring and hw stats for both packets
and bytes) in a single counter_enter/counter_exit block after the
loop.

Also move the stats update to after the refill and LRO flush
so that the error path (goto update_stats) and the normal path
converge at the same label, avoiding code duplication.

Submitted by: David Arinzon <darinzon at amazon.com>
MFC after: 2 weeks

    [3 lines not shown]
DeltaFile
+12-11sys/dev/ena/ena_datapath.c
+12-111 files

FreeBSD/src 605e699sys/dev/ena ena.h

ena: Update driver version to v2.8.4

Bug Fixes:
* Fix false 'missing TX completions' warnings due to timestamp race
* Put taskqueues into correct NUMA domain if !RSS

Minor Changes:
* Batch RX statistics updates
* Swap RX/TX completions cleanup order

Submitted by: Arthur Kiyanovski <akiyano at amazon.com>
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D58242
DeltaFile
+1-1sys/dev/ena/ena.h
+1-11 files

FreeBSD/src f08def9sys/dev/ena ena_datapath.c

ena: Swap cleanup order

As RX processing is heavier than TX completions processing, swap the
order and process TX completions first, in order to avoid starving the
completions and causing potential missing TX completions.

Submitted by: Ofir Tabachnik <ofirt at amazon.com>
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D58239
DeltaFile
+1-1sys/dev/ena/ena_datapath.c
+1-11 files

FreeBSD/src c985e25lib/libc/stdlib memory.3, lib/libc/stdlib/malloc free_sized.3 free_aligned_sized.c

libc: Add free_sized() and free_aligned_sized() as per C23

Add C23 sized deallocation entry points as thin wrappers around free(3).
Implementations may ignore size and alignment hints, so behaviour stays
correct for existing allocations without validating caller metadata yet.

When jemalloc is updated to 5.3.1, rewire these to je_free_sized() and
je_free_aligned_sized() so deallocation can use the allocator's sized
deallocation (free_sized for fast paths and free_aligned_sized for
correct aligned hints.)

Please note this change satisfies the standard interface only. Both
functions should be delegated to jemalloc after the upgrade so callers
get the intended allocator behaviour; until then, hints are unused and
neither sized nor aligned-sized deallocation optimizations apply.

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2201

    [3 lines not shown]
DeltaFile
+100-0lib/libc/stdlib/malloc/free_sized.3
+21-0lib/libc/stdlib/malloc/free_aligned_sized.c
+20-0lib/libc/stdlib/malloc/free_sized.c
+16-1lib/libc/stdlib/memory.3
+9-0lib/libc/stdlib/malloc/Makefile.inc
+7-0lib/libc/stdlib/malloc/Symbol.map
+173-11 files not shown
+175-17 files

FreeBSD/src 13ba63ainclude stdalign.h

libc: Suppress <stdalign.h> content for C23 and later

C23 deprecates <stdalign.h> and specifies that the header shall
provide no content (§7.15.1).

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2223
MFC after:      1 month
Reviewed by:    imp, fuz

(cherry picked from commit 694baf88c2ae5957fdb24ed163993109987e1ef9)
DeltaFile
+4-0include/stdalign.h
+4-01 files

FreeBSD/src fc186c2libexec/rc/rc.d dumpon

rc.d/dumpon: minor hardening/tightening up

- Scope local variables properly to each function.
- Quote variables that should be treated as single words.
- Replace `${cmd}; if [ $? -eq 0 ]` with `if ${cmd}` for simplicity.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57899
DeltaFile
+8-5libexec/rc/rc.d/dumpon
+8-51 files

FreeBSD/src a2f50c4sys/amd64/amd64 efirt_machdep.c

amd64 efirt: register all runtime regions as fictitious

This is needed for VM_PHYS_TO_PAGE() to work, which is needed for
pmap_map_io_transient() to work, which is needed for uiomove_fromphys()
to work.

PR:     296348
Reported and tested by: Anton Saietskii <vsasjason at gmail.com>
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58274
DeltaFile
+3-0sys/amd64/amd64/efirt_machdep.c
+3-01 files

FreeBSD/src 7c22ddasys/netinet icmp6.h, sys/netinet6 in6_var.h nd6.h

nd6: Add router address and DHCPv6-PD flags in PIO headers

Make R-bit per RFC 6275 8.3 and P-bit per RFC 9762 7.1 in
Prefix Information option available to userland for future implementations.

RFC 9762 7.1: For each interface, the client MUST keep a list of every prefix
that was received from a PIO with the P flag set and currently has a non-zero
preferred lifetime.

Differential Revision: https://reviews.freebsd.org/D56207
DeltaFile
+5-1sys/netinet6/in6_var.h
+4-2sys/netinet/icmp6.h
+1-0sys/netinet6/nd6.h
+10-33 files

FreeBSD/src e188442sys/kern sys_procdesc.c

fget_procdesc(): change error for non-procdesc type from EBADF to EINVAL

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+1-1sys/kern/sys_procdesc.c
+1-11 files

FreeBSD/src 664ad9asys/dev/acpica acpi_cpu.c

acpi_cpu(4): Call ACPI_GET_FEATURES() on a reset 'features' variable

This is to prevent child drivers from using the features returned by
previous drivers (in an arbitrary order).  None of the existing ones do
that, so this is purely defensive.

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-1sys/dev/acpica/acpi_cpu.c
+2-11 files

FreeBSD/src fed4979sys/kern sys_process.c

kern/sys_process.c: remove extra ()

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+1-1sys/kern/sys_process.c
+1-11 files

FreeBSD/src 3abd3d3sys/netinet6 in6_pcb.c

inpcb: return ENOMEM if bind(2) fails to allocate lbgroup

This is exactly the same as the second part of IPv4's change
136c5e17b61a1/D49153.
DeltaFile
+6-4sys/netinet6/in6_pcb.c
+6-41 files

FreeBSD/src ca4eb3fsys/netinet6 in6_pcb.c

inpcb: do not set INP_ANONPORT until successful operation
DeltaFile
+2-2sys/netinet6/in6_pcb.c
+2-21 files

FreeBSD/src a48a275sys/sys proc.h

sys/proc.h: remove spurious blank lines

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+0-2sys/sys/proc.h
+0-21 files

FreeBSD/src 1f5fe8asys/kern kern_exit.c sys_procdesc.c, sys/sys procdesc.h

kern: change several int types to bools

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+3-3sys/kern/kern_exit.c
+3-3sys/kern/sys_procdesc.c
+1-1sys/sys/procdesc.h
+7-73 files

FreeBSD/src fc09c7fsys/net iflib.c

iflib: Remove an unused field from struct iflib_rxq

Reported by:    Alexander Sideropoulos <Alexander.Sideropoulos at netapp.com>
MFC after:      1 week
DeltaFile
+0-1sys/net/iflib.c
+0-11 files

FreeBSD/src 8318199sys/kern link_elf.c

linker: Recognize SHT_INIT_ARRAY sections as constructor sections

We do this already for ET_REL files, but it was missed here.  Note that
this function operates only on dynamically loaded files, not on
preloaded files.

Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58245
DeltaFile
+3-2sys/kern/link_elf.c
+3-21 files

FreeBSD/src 4b0ae7estand/common load_elf.c

stand: Recognize SHT_INIT_ARRAY sections as constructor sections

Pass such a section to the kernel using modinfo, otherwise link_elf.c
won't execute constructors for the file.  This is required for KASAN,
otherwise redzones for global buffers are not poisoned during boot.

Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58244
DeltaFile
+2-1stand/common/load_elf.c
+2-11 files

FreeBSD/src 00e8808lib/libc/locale localeconv.c

libc locale/localeconv.c: use release semantic when clearing locale_changed

PR:     296410

(cherry picked from commit 4efbcf36a0d49ab142023a767871532f515f1381)
DeltaFile
+2-2lib/libc/locale/localeconv.c
+2-21 files

FreeBSD/src 40c611dsbin/pfctl pfctl_table.c

pfctl: fix incorrect errno checks

These calls return an error value, they do not set errno. Check their
return values.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+15-4sbin/pfctl/pfctl_table.c
+15-41 files

FreeBSD/src f2202absys/kern uipc_mbuf.c

mbuf: make m_unshare() allow unmapped mbufs

m_unshare() had crashed if unmapped mbufs exist in the mbuf chain.
This was because memcpy() with mtod() was used without making sure that
the mbuf was mapped. Use m_copydata() that cares unmapped mbufs instead.

Reviewed by:    gallatin
Differential Revision:  https://reviews.freebsd.org/D58189
DeltaFile
+7-5sys/kern/uipc_mbuf.c
+7-51 files

FreeBSD/src ddbf892sbin/pfctl pfctl_table.c

pfctl: fix CREATE_TABLE error handling

pfr_add_table() does not set errno, it returns an error (now).
Read the error code from the return value so we display the correct
error message to the user.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+4-3sbin/pfctl/pfctl_table.c
+4-31 files

FreeBSD/src 8440093sys/sys _uexterror.h exterrvar.h

exterr: allow exterr to fit pointers on CHERI targets

Switch to uint64ptr_t which is a uint64_t on traditional architectures
and a uintptr_t on CHERI architectures.  This has no ABI impact on
non-CHERI kernels.

Fix truncation of 64-bit values on 32-bit kernels.

Reviewed by:    kib
Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D58056
DeltaFile
+3-3sys/sys/_uexterror.h
+3-3sys/sys/exterrvar.h
+2-2sys/sys/_exterr.h
+8-83 files

FreeBSD/src db3eca2sys/kern sys_generic.c, sys/sys syscallsubr.h

exterrctl(2): add kern_exterrctl

Reviewed by:    kib
Effort:         CHERI upstreaming
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D58055
DeltaFile
+11-5sys/kern/sys_generic.c
+1-0sys/sys/syscallsubr.h
+12-52 files

FreeBSD/src b3b4763sys/sys exterrvar.h

sys/exterrvar.h: forward declare struct thread

Remove dependency on sys/proc.h.

Reviewed by:    imp
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D58235
DeltaFile
+2-0sys/sys/exterrvar.h
+2-01 files

FreeBSD/src 896f9basys/dev/sound/pcm channel.c buffer.c

sound: Pass format and speed as arguments to sndbuf_create()

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week

(cherry picked from commit 815dc35b7b5ed694fc1986d054149e375b8a17bd)
DeltaFile
+2-6sys/dev/sound/pcm/channel.c
+4-1sys/dev/sound/pcm/buffer.c
+1-1sys/dev/sound/pcm/buffer.h
+7-83 files

FreeBSD/src 6d66485sys/dev/sound/pcm dsp.c

sound: Remove dead code in dsp_ioctl()

Sponsored by;   The FreeBSD Foundation
MFC after:      1 week

(cherry picked from commit 69c4e2b68a588272de6ab86e302d87188bfef2a6)
DeltaFile
+0-8sys/dev/sound/pcm/dsp.c
+0-81 files