FreeBSD/src b35e921 — lib/libpmc/pmu-events/arch/x86 mapfile.csv

libpmc: add more alderlake models

According to [1], the CPU models 6-{b7,ba,bf} are also alderlake-family
models. This patch adds them to the mapfile.csv.

[1] https://github.com/torvalds/linux/blob/master/tools/perf/pmu-events/arch/x86/mapfile.csv#L2

Reviewed by:    mhorne
MFC after:      3 days
Sponsored by:   Stormshield
Differential Revision:  https://reviews.freebsd.org/D49126

(cherry picked from commit 601925180df4d165f4c2c4dc91a49da7b9f3438b)
DeltaFile
+3-0lib/libpmc/pmu-events/arch/x86/mapfile.csv
+3-01 files

FreeBSD/src fde4382 — sys/dev/acpica/Osd OsdSchedule.c

acpi: Tasks: Precisely report the maximum number of slots used

To this end, store the actual number of busy slots instead of the index
of the final slot selected (off by one), and fix races when updating
'acpi_tasks_hiwater'.

The race is that it could happen that a first thread enqueued a task at
a higher index than the current maximum, followed by a second one
enqueuing at some even higher index, with the first thread updating
'acpi_tasks_hiwater' while the second was exactly after the 'if (i >
acpi_tasks_hiwater)' but just before attempting the atomic_cmpset_int()
that updates 'acpi_task_hiwater', which then would fail silently (the
return value was ignored) leading to the real maximum not being
recorded.

Fix the race by simply testing the return value of atomic_cmpset_int()
and retrying.  Use an explicit atomic_load_int() for the guard (that
compiles to a regular load, so this change is cosmetic).


    [6 lines not shown]
DeltaFile
+6-3sys/dev/acpica/Osd/OsdSchedule.c
+6-31 files

FreeBSD/src 3bc37e2 — sys/dev/dwc if_dwc.h

dwc: fix DEBUG macro name

It conflicts with the general "DEBUG" macro defined as an option in LINT
builds. Since this is actually unused, just rename it to GMAC_DEBUG.

Reviewed by:    manu
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D44102

(cherry picked from commit fae39d8da9d5ddf4239fc2143522340c941f6612)
DeltaFile
+1-1sys/dev/dwc/if_dwc.h
+1-11 files

FreeBSD/src 25a9d3c — sys/dev/hwpmc hwpmc_amd.c

hwpmc_amd: simplify counter descriptor definitions

No functional change intended.

Reviewed by:    jkoshy
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D41273

(cherry picked from commit 75780146d627ff4be978191a142da4d67be5aaa6)
DeltaFile
+30-177sys/dev/hwpmc/hwpmc_amd.c
+30-1771 files

FreeBSD/src 45fb644 — sys/dev/hwpmc hwpmc_amd.c

hpwmc_amd.c: style improvements

 - Return style
 - Explicit value checks
 - Whitespace formatting
 - Comment formatting
 - Local variable declaration order
 - __unused annotations

Reviewed by:    jkoshy
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D41272

(cherry picked from commit d9e3fe3226624c391a80b623d844bb578888cec3)
DeltaFile
+117-165sys/dev/hwpmc/hwpmc_amd.c
+117-1651 files

FreeBSD/src ad4a0d6 — sys/dev/hwpmc hwpmc_uncore.c hwpmc_core.c

hwpmc: tidy pcd_finalize methods

Make them a little bit more consistent with one another in terms of what
is done:
 - Add/reduce assertions to what is most useful: a loop to ensure
   pcpu_fini freed everything
 - Add PMCDBG trace entries

The exception is the dmc620/cmn600 classes, which behave a little
differently, so leave them untouched.

Reviewed by:    jkoshy
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D41270

(cherry picked from commit 90a6ea5ca0b1b578e265d2479511bd04347f9510)
DeltaFile
+4-28sys/dev/hwpmc/hwpmc_amd.c
+2-8sys/dev/hwpmc/hwpmc_tsc.c
+2-7sys/dev/hwpmc/hwpmc_soft.c
+5-0sys/dev/hwpmc/hwpmc_powerpc.c
+4-0sys/dev/hwpmc/hwpmc_uncore.c
+4-0sys/dev/hwpmc/hwpmc_core.c
+21-432 files not shown
+29-438 files

FreeBSD/src 554b97e — sys/dev/mmc mmc_fdt_helpers.c

mmc_fdt: handle broken-cd property

The documented properties [1] for card-detection are one of:
 - cd-gpios
 - non-removable
 - broken-cd

In cd_setup() we handle the first two, but not the latter, resulting in
a silently undetected card on an affected system.

To work around this, force cd_disabled when broken-cd is specified, so
that the card detect helper function gets to run. A more complete
solution would implement some kind of polling mechanism to detect the
card's presence or removal.

Some variants of the Allwinner D1, such as the Lichee Rv, specify this
property in the mmc0 device node.

[1] sys/contrib/device-tree/Bindings/mmc/mmc-controller.yaml

    [9 lines not shown]
DeltaFile
+11-0sys/dev/mmc/mmc_fdt_helpers.c
+11-01 files

FreeBSD/src 2a868fd — usr.bin/time time.1

time.1: minor cleanup (alignment/macro/spdx)

+ shorter example filename to minimize line wrap
+ standards macro clarifying posix => posix.2
+ align options + tag spdx

Reviewed by:    mhorne
MFC after:      3 days
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/1315

(cherry picked from commit cb18ba9df52df247198c0f41979090686a0f8403)
DeltaFile
+8-4usr.bin/time/time.1
+8-41 files

FreeBSD/src 456bd1f — sys/dev/hwpmc hwpmc_core.h

hwpmc_core: remove two non-existent function prototypes

Reviewed by:    jkoshy
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D41271

(cherry picked from commit 440e7cb4aca9b6f5662ab492bd016d8ed0f85da0)
DeltaFile
+0-2sys/dev/hwpmc/hwpmc_core.h
+0-21 files

FreeBSD/src 00f021e — share/man/man9 kern_reboot.9

kern_reboot(9): belatedly bump .Dd

Fixes:  4e78a766f607 ("kern_reboot(): don't clear kdb_active")
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit ae9437671a1569bb90305996416d3a40e77c2f05)
DeltaFile
+1-1share/man/man9/kern_reboot.9
+1-11 files

FreeBSD/src 7b76697 — usr.bin/lock lock.1

lock.1: align options + tag spdx

Reviewed by:    imp, mhorne
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1522

(cherry picked from commit 3ef9e138dd8b70879ba91d84ac623baa0d4b6c91)
DeltaFile
+4-1usr.bin/lock/lock.1
+4-11 files

FreeBSD/src c9e6bc3 — lib/libc/sys mq_open.2

mq_open(2): document sysctl limit EINVAL and ENFILE conditions

Document two missing error conditions for mq_open(2):

- EINVAL: returned when mq_maxmsg exceeds kern.mqueue.maxmsg or
  mq_msgsize exceeds kern.mqueue.maxmsgsize.
- ENFILE: add kern.mqueue.maxmq sysctl name to the existing entry.

PR:             243209
Reviewed by:    mhorne
MFC after:      1 week
Signed-off-by:  Kit Dallege <xaum.io at gmail.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2098

(cherry picked from commit 3e9f4fd6fc50300d052d5619d82a14d3488483d5)
DeltaFile
+22-1lib/libc/sys/mq_open.2
+22-11 files

FreeBSD/src a4d5853 — sys/amd64/amd64 pmap.c

amd64: use pc_is_full() helper function

This seems to have been missed in a few places. No functional change
intended.

Reviewed by:    kib
MFC after:      1 week
Fixes:  4d90a5afc51b ("sys: Consolidate common implementation details...")
Differential Revision:  https://reviews.freebsd.org/D45920

(cherry picked from commit e7f849e25bbca9a74c9d3a5b633f9cd01ba95a55)
DeltaFile
+3-5sys/amd64/amd64/pmap.c
+3-51 files

FreeBSD/src 067161c — sys/dev/acpica/Osd OsdSchedule.c

acpi: Tasks: Ensure sane values for number of tasks and threads

Make sure that these are set to sane values even on silly tunables:
- There must be at least one thread to process the 'acpi_taskq'.
- Use the ACPI_MAX_TASKS default when a negative number of tasks was
  specified. This avoids common pilot errors causing a bogus huge memory
  allocation for acpi_tasks[].

Reviewed by:    obiwac (older version)
Differential Revision:  https://reviews.freebsd.org/D60373
DeltaFile
+10-0sys/dev/acpica/Osd/OsdSchedule.c
+10-01 files

FreeBSD/src ee417f9 — sys/dev/acpica/Osd OsdSchedule.c

acpi: Tasks: Use M_WAITOK to allocate the taskqueue

Memory failure at this point normally does not happen except if the
kernel is running on a machine with a too tiny amount of memory, in
which case it is likely to panic or to be unusable anyway.  However,
letting it panic here with a NULL pointer dereference is not very
helpful.  Instead, use M_WAITOK, hoping the memory allocator itself will
indicate the low memory condition if it cannot succeed (if it does not,
it should be changed to).

Reviewed by:    obiwac
Differential revision:  https://reviews.freebsd.org/D60379
DeltaFile
+1-1sys/dev/acpica/Osd/OsdSchedule.c
+1-11 files

FreeBSD/src 67f3eac — share/man/man9 callout.9, sys/kern kern_timeout.c

callout: optionally spread callouts to all CPUs

By default, if the caller has not used one of the _on() or _cpucpu()
variants of the callout API, the system assigns the callout to CPU0.

Having most callouts running on CPU0 can be problematic in terms of
the amount of CPU time spent executing callouts can have an unfair
impact to CPU0, and a critical callout (like lacp_tick) is certain
to land on the same CPU as everything else, so it is more likely
to be delayed.

This change introduces a change to callout_init* where if
kern.callout_spread is non-zero, callouts initialized after SMP startup
are distributed among CPUs.

This is left as disabled by default, as it may reveal any latent
synchronization bugs that were previously hidden, e.g., two callout handlers
which were always accidentally serialized against each other before may now
run concurrently.  It also may cause a slight increase in power consumption

    [6 lines not shown]
DeltaFile
+8-2share/man/man9/callout.9
+7-2sys/kern/kern_timeout.c
+15-42 files

FreeBSD/src d03e991 — sys/dev/virtio/network if_vtnet.c

vtnet: honor the advertised MTU limit on attach

When VIRTIO_NET_F_MTU is negotiated, virtio_net_config.mtu specifies
the maximum MTU the driver may use. vtnet_ioctl_mtu() enforces this
limit for subsequent MTU changes, but ether_ifattach() unconditionally
initializes the interface MTU to ETHERMTU (1500).

So a device advertising a maximum below 1500 starts with an MTU above
its limit. So make sure to set the initial MTU no larger than
vtnet_max_mtu. That is, for vtnet_max_mtu less than 1500
interface MTU will be set to this value, otherwise the current behaviour
is preserved, MTU will be set to 1500.

Reviewed by:    kfv, tuexen
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60980

(cherry picked from commit 0974ef03b43f279f16289ad4d5be3a03923983ea)
DeltaFile
+2-0sys/dev/virtio/network/if_vtnet.c
+2-01 files

FreeBSD/src 3d88ee6 — sys/netinet6 ip6_forward.c

ip6_forward: Free the ICMPv6 copy on all error paths

ip6_forward() keeps a copy of the start of the packet in case it has
to send an ICMPv6 error.  Every exit must either pass the copy to
icmp6_error() or icmp6_redirect_output(), or free it.  Three exits did
neither and leaked the copy:

 - the destination scope check, when a packet would leave the zone of
   its destination address;
 - a packet that a pfil hook redirected to a local address, which is
   queued for local input;
 - a packet whose checksum has to be computed here and whose last
   header offset is not valid.

Free the copy in these three cases.

Reviewed by:            tuexen, pouria
Fixes:                  8a006adb2441 ("Add support for IPv6 to ipfw fwd...")
Fixes:                  bcb298fa9e23 ("sctp, tcp, udp: improve deferred computation...")

    [3 lines not shown]
DeltaFile
+6-2sys/netinet6/ip6_forward.c
+6-21 files

FreeBSD/src 503ecf5 — sys/net if_geneve.c

if_geneve: Read the outer IP header from the start of the packet

The offset passed to geneve_udp_input() points at the UDP header,
which for IPv6 comes after any extension headers.
The outer header is always at the start of the mbuf.

Reported by:    llm-postcr
Fixes:          e44d2e941e8e ("if_geneve: Add Support for Geneve (RFC8926)")
DeltaFile
+2-2sys/net/if_geneve.c
+2-21 files

FreeBSD/src 4aa3a5e — sys/amd64/vmm vmm.c

vmm: Route MMIO-to-MMIO MOVS by GPA

emulate_movs() uses the memread and memwrite callbacks selected from
the faulting GPA for both operands of an MMIO-to-MMIO MOVS.  A guest
can therefore make the local APIC handler write to a GPA outside the
APIC page, which trips the offset assertion in vlapic_write() on
INVARIANTS kernels.

Dispatch each MMIO read and write according to its GPA.  This allows
MOVS between in-kernel devices.  During in-kernel emulation, return
EINVAL if an MMIO operand lies outside those devices' ranges.

Reported by:    llm-postcr
Reviewed by:    markj
MFC after:      1 week
Sponsored by:   Alchemilla Ventures Private Limited
Differential Revision:  https://reviews.freebsd.org/D61495
DeltaFile
+62-14sys/amd64/vmm/vmm.c
+62-141 files

FreeBSD/src 83067a2 — sys/dev/usb/net if_ure.c

ure: Initialize ifm_active in ure_ifmedia_sts

Most ure(4) devices use mii; 8156 and 8156B do not and have special
cases throughout the driver.

ifmedia_ioctl() sets ifmr->ifm_active to ifm_cur->ifm_media before
calling the status callback.  The 8156 case in ure_ifmedia_sts ORs in
the subtype and duplex flags to the existing value, which may result in
garbage values.

Instead, start by setting ifm_active to just IFM_ETHER before ORing in
other bits.

Reported by:    llm-postcr
Reviewed by:    kbowling, pouria
Fixes: d4cf41a99b40 ("Add support for RTL8153B, RTL8156 and RTL8156B to if_ure(4).")
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61158
DeltaFile
+3-0sys/dev/usb/net/if_ure.c
+3-01 files

FreeBSD/src d9fa601 — libexec/nuageinit nuageinit

nuageinit; Skip SSH keys and doas/sudo if adduser fails

Previously we would still try to add SSH keys after a failed adduser,
which would result in an uncaught Lua error, causing the remainder of
the setup to be skipped.

Reported by:    llm-postcr
Reviewed by:    dtxdf, bapt
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61441
DeltaFile
+4-0libexec/nuageinit/nuageinit
+4-01 files

FreeBSD/src 1947932 — tests/sys/capsicum capmode.cc

capsicum: Add tests for sched_* and rtprio*

Commit 70d08c69f4d0 ("p1003_1b: Add capability mode checks") added
missing capability mode checks to sched_* syscalls, and commit
9b6ea599c955 ("rtprio*: Add capability mode checks") added them to
rtprio*.

Reviewed by: olce, emaste
Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif at amd.com>
Differential Revision: https://reviews.freebsd.org/D61412
DeltaFile
+45-0tests/sys/capsicum/capmode.cc
+45-01 files

FreeBSD/src 143da26 — sys/kern vfs_syscalls.c, sys/sys syscallsubr.h

kern_revoke: remove always UIO_USERSPACE pathseg argument

In FreeBSD and CheriBSD pathseg was always UIO_USERSPACE and when I
extracted the patch for FreeBSD, I failed to propogate it to NAMEI.
Since it's always the same, remove it as needless generality.

Reported by:    netchild
Sponsored by:   Innovate UK
Fixes:          7273d80ba18c ("vfs_syscalls.c: add kern_ and user_ implementations")
DeltaFile
+2-2sys/kern/vfs_syscalls.c
+1-1sys/sys/syscallsubr.h
+3-32 files

FreeBSD/src 973698a — sys/kern kern_time.c

clock_gettime: Add capability mode check

clock_gettime is permitted in capability mode, and it calls get_cputime
if clock_id is negative.  get_cputime did not check the target pid in
capability mode.

Reported by:    llm-postcr
Reviewed by:    markj, Osvaldo Janeri Filho <ojanerif at amd.com>
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61469
DeltaFile
+3-0sys/kern/kern_time.c
+3-01 files

FreeBSD/src 1bb8b1d — sys/kern kern_fork.c

hwpmc: switch in process PMCs on a thread's first run

A new thread starts in fork_exit(), not mi_switch(), so its PMCs are
not loaded until its next context switch.  Call the switch-in hook
there.

Reviewed by:    kib, Osvaldo Janeri Filho <ojanerif at amd.com>, mhorne
MFC after:      1 week
Sponsored by:   Advanced Micro Devices, Inc.
Differential Revision:  https://reviews.freebsd.org/D60565
DeltaFile
+10-0sys/kern/kern_fork.c
+10-01 files

FreeBSD/src 57e8edd — sys/dev/mii lan867xphy.c

lan867xphy: Add silicon rev D0 configuration

Apply hardware revision D0 configuration from Microchip AN1699
(Revision G).  The LSCTL (0x0012) write is deferred until link state
reporting is implemented.

Sponsored by:   The FreeBSD Foundation
Sponsored by:   Microchip (Hardware)
Differential Revision: https://reviews.freebsd.org/D61269
DeltaFile
+31-1sys/dev/mii/lan867xphy.c
+31-11 files

FreeBSD/src e003392 — contrib/blocklist/bin blacklistd.8

blocklist: blacklist: Chase recent upstream changes

MFC after:      3 days
DeltaFile
+19-11contrib/blocklist/bin/blacklistd.8
+19-111 files

FreeBSD/src ea9a38e — contrib/blocklist/bin blocklistd.8, contrib/blocklist/diff named.diff

MFV: Import blocklist 2026-11-12 (590e95e)

Merge commit 'b0788c28c7bc6631129bc366bad491cf5698b2dc'

Changes:

https://github.com/zoulasc/blocklist/compare/10a907f...590e95e

MFC after:      3 days
DeltaFile
+140-195contrib/blocklist/diff/named.diff
+19-11contrib/blocklist/bin/blocklistd.8
+1-1contrib/blocklist/etc/blocklistd.conf
+160-2073 files

FreeBSD/src 76e6737 — contrib/libucl/src ucl_util.c ucl_parser.c, contrib/libucl/tests test_cbor_vectors.c test_empty_chunks.c

libucl: Import libucl 0.10.0

Tested by:      ivy
Approved by:    bapt, ivy
Differential Revision:  https://reviews.freebsd.org/D61099
DeltaFile
+1,437-0contrib/libucl/src/ucl_cbor.c
+992-262contrib/libucl/src/ucl_parser.c
+1,112-0contrib/libucl/tests/test_limits.c
+846-254contrib/libucl/src/ucl_util.c
+964-0contrib/libucl/tests/test_empty_chunks.c
+872-0contrib/libucl/tests/test_cbor_vectors.c
+6,223-51665 files not shown
+13,988-88671 files