FreeBSD/src 439710cinclude assert.h

assert.h: Revert "Remove leading tabs for whitespace consistency"

This reverts commit 157c184689ea3d7b8b6bd89aff849e94f004aa0e.

As per style(9), a tab goes after #define.  This should not have been
removed.

Reported by:    kib
Fixes:          157c184689ea3d7b8b6bd89aff849e94f004aa0e.
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+13-13include/assert.h
+13-131 files

FreeBSD/src 963a92dstand/man loader.efi.8, sys/amd64/amd64 machdep.c

amd64: explain in more details why the slop is needed

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+7-0sys/amd64/amd64/machdep.c
+3-0stand/man/loader.efi.8
+10-02 files

FreeBSD/src 03c69ddsys/dev/hwpmc hwpmc_intel.c, sys/sys pmc.h

pmc: add sapphire rapids model

This commit adds the sapphire rapids CPU model to hwpmc_intel.c,
allowing hwpmc to be used on this CPU family.

Reviewed by:    mhorne
MFC after:      3 days
Sponsored by:   Stormshield
Differential Revision:  https://reviews.freebsd.org/D57263
DeltaFile
+4-0sys/dev/hwpmc/hwpmc_intel.c
+1-0sys/sys/pmc.h
+5-02 files

FreeBSD/src 510ee66sys/dev/ntsync linux_ntsync.c linux_ntsync.h, sys/modules Makefile

linux_ntsync: linux compat shim for ntsync(9)

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57038
DeltaFile
+302-0sys/dev/ntsync/linux_ntsync.c
+62-0sys/dev/ntsync/linux_ntsync.h
+6-0sys/modules/linux_ntsync/Makefile
+1-0sys/modules/Makefile
+371-04 files

FreeBSD/src d0ea3afsys/dev/ntsync ntsync.c, sys/sys user.h

ntsync: add kinfo reporting

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57038
DeltaFile
+44-3sys/dev/ntsync/ntsync.c
+24-0sys/sys/user.h
+68-32 files

FreeBSD/src 0ac9aacetc/mtree BSD.include.dist, include Makefile

ntsync: install headers for userspace consumption

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57038
DeltaFile
+2-0etc/mtree/BSD.include.dist
+1-1include/Makefile
+3-12 files

FreeBSD/src 03ca6dbsys/dev/ntsync ntsync.c ntsyncvar.h, sys/modules Makefile

ntsync(4)

The driver implements the ntsync interface as specified in the Linux
7.0-rc3 document Documentation/userspace-api/ntsync.rst.  Only the
documentation and the userspace tests (Linux'
tools/testing/selftests/drivers/ntsync/ntsync.c) were used for
reference.  When the documentation contradicted the tests, tests
behavior was implemented.

One quirk is that Linux API needs to return an error from ioctl() and to
copyout the modified ioctl() argument.  Our generic ioctl() is not flexible
enough to implement this, so the ntsync_ioctl_copyout() hack allows to
copyout the ioctl parameter directly from the ioctl method, instead of
relying on the ioctl infra.

The FreeBSD port of the tests, that can be compiled both on FreeBSD and
Linux, is available at https://github.com/kostikbel/freebsd-ntsync-test.
The Linux binary compiled with the Linux test harness, cannot be run
under linuxolator due to unimplemented syscalls, but the shims in

    [6 lines not shown]
DeltaFile
+1,379-0sys/dev/ntsync/ntsync.c
+119-0sys/dev/ntsync/ntsyncvar.h
+66-0sys/dev/ntsync/ntsync.h
+6-0sys/modules/ntsync/Makefile
+1-0sys/modules/Makefile
+1-0sys/sys/file.h
+1,572-06 files

FreeBSD/src aef014dsys/contrib/edk2/Include Base.h

Revert "edk2: enable static asserts for *INT64 alignment"

This fails when using WITH_BEARSSL. It seems like we build the EFI bits
of libsecureboot (which is really just part of libsa in this case), even
when building the BIOS loader. Revert for now to unbreak the build.

This reverts commit 2fa4bdd7f9e99698a6652db405c3165fdcd41c1d.

Reported by: freebsd at walstatt-de.de
DeltaFile
+2-0sys/contrib/edk2/Include/Base.h
+2-01 files

FreeBSD/src 23996d9stand/efi Makefile

stand/efi/Makefile: fix build order

Move liblua32efi and ficl32efi before .WAIT, otherwise there's a race
between the interpreter and the loader being built.

Reported by:    kbowling
Discussed with: kevans
Fixes:          d15cc7625dde9bcb6a63ee59cccf14f3b93b15bf
DeltaFile
+4-3stand/efi/Makefile
+4-31 files

FreeBSD/src 8809ea4sys/dev/usb/input ukbd.c

ukbd: fix SET_REPORT wValue always using report ID 0 for LED output

ukbd_set_leds_callback() built the SET_REPORT control request with
USETW2(req.wValue, UHID_OUTPUT_REPORT, 0) before the loop that
determines the actual HID report ID from sc_id_numlock,
sc_id_scrolllock, or sc_id_capslock.  The data payload was already
correctly prefixed with the real report ID when id != 0, but the
control request's wValue told the device to set report ID 0, which
does not exist on devices that use non-zero report IDs for LED output.

Apple Internal Keyboard / Trackpad (0x05ac:0x0274) uses report ID 1
for LED output.  The mismatch caused the device to STALL every
SET_REPORT request, so the capslock LED could never be updated.

Move the USETW2 call to after the LED-detection loop so that wValue
carries the correct report ID.

Signed-off-by:  Joshua Rogers <Joshua at Joshua.Hu>
Reviewed by:    wulf

    [2 lines not shown]
DeltaFile
+8-8sys/dev/usb/input/ukbd.c
+8-81 files

FreeBSD/src 1a346cdsys/dev/ffec if_ffec.c

if_ffec: correctly trim 2 bytes from the beginning

PR:             283315
Tested by:      tuexen

(cherry picked from commit b29842622dcb9c9c9515fc04dc5826a8717537b1)
DeltaFile
+1-1sys/dev/ffec/if_ffec.c
+1-11 files

FreeBSD/src aec9fc6sys/dev/ffec if_ffec.c

if_ffec: correctly trim 2 bytes from the beginning

PR:             283315
Tested by:      tuexen

(cherry picked from commit b29842622dcb9c9c9515fc04dc5826a8717537b1)
DeltaFile
+1-1sys/dev/ffec/if_ffec.c
+1-11 files

FreeBSD/src b53eab3sys/compat/linuxkpi/common/src linux_idr.c

LinuxKPi: idr: use macros for lock idr lock operations

Our idr implementation is using a mtx lock which in the past has
already caused problems (613723bac219c).
In order to make it easier to tackle the problem start by factoring
out all the operations related to the idr->lock into macros as we
have often done in other parts of code as well.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    wulf, emaste
Differential Revision: https://reviews.freebsd.org/D55392
DeltaFile
+37-30sys/compat/linuxkpi/common/src/linux_idr.c
+37-301 files

FreeBSD/src d07460fsys/compat/linuxkpi/common/src linuxkpi_80211_pm.c

LinuxKPI: 802.11 suspend/resume: fix the is_pci_dev check

Shortly before I committed the works from a year ago, jhb added a
function ("is_pci_device") so that the check against the devclass
does not have to be coded in every driver.  Use this instead in main
(and stable/15 in case the works get MFCed).

At the same time this fixes the check (the old one was wrong) as we
attach to the LinuxKPI 802.11 driver, e.g., iwlwifi and thus we need
to check the parent of the parent and not just the parent to be
of the devclass "pci" in the identify bus function.  The was the
first error.  The second was (and this is why it worked) that we
checked for == instead of != and so the wrong check became true again.

Discussed with: jhb
Fixes:          11d69a4558de ("LinuxKPI: 802.11: add support for s/r")
MFC after:      3 days
X-MFC after:    ffcf5e356644 ("pci: Add is_pci_device helper function")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-1sys/compat/linuxkpi/common/src/linuxkpi_80211_pm.c
+2-11 files

FreeBSD/src 49b413csys/dev/rtwn/usb rtwn_usb_attach.h, sys/dev/usb usbdevs

rtwn/usb: add ID for D-Link DWA-121 rev B1 to rtwn RTL8188EU

Add the device ID to the usbdevs table in order to be able to use
it in the rtwn/usb driver for the RTL8188EU attachment.

(I adjusted the name to B1 compared to the original submission)

PR:             291839
MFC after:      3 days
DeltaFile
+1-0sys/dev/rtwn/usb/rtwn_usb_attach.h
+1-0sys/dev/usb/usbdevs
+2-02 files

FreeBSD/src a64148esys/compat/linux linux_misc.c linux_misc.h

linux: Add support for PR_SET_VMA to prctl(2)

Implement dummy support for PR_SET_VMA with PR_SET_VMA_ANON_NAME in
prctl(2).  This prevents applications from receiving EINVAL when
attempting to name anonymous memory regions.
DeltaFile
+7-0sys/compat/linux/linux_misc.c
+2-0sys/compat/linux/linux_misc.h
+9-02 files

FreeBSD/src eda74felib/libc/stdlib rand.3

rand(3): Normalize function ordering

Align ordering between NAME & SYNOPSIS sections.

Obtained from:  https://github.com/apple-oss-distributions/libc
Sponsored by:   Klara, Inc.
DeltaFile
+5-5lib/libc/stdlib/rand.3
+5-51 files

FreeBSD/src 7f421c7share/mk bsd.sys.mk

bsd.sys.mk: also suppress gcc -Wc++1[47]-extensions warnings for >= 12

This is a direct commit to stable/14, which does not yet default to
C++17 for most in-tree programs. In some cases, this would trigger gcc
-Wc++1[47]-extensions warnings with libc++ 21.
DeltaFile
+2-0share/mk/bsd.sys.mk
+2-01 files

FreeBSD/src c115aadshare/man/man3 assert.3

assert.3: Update as per C23

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+61-15share/man/man3/assert.3
+61-151 files

FreeBSD/src 0fe73dcinclude assert.h

libc: Add <assert.h> C23 feature test macro

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+3-3include/assert.h
+3-31 files

FreeBSD/src 157c184include assert.h

assert.h: Remove leading tabs for whitespace consistency

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+9-9include/assert.h
+9-91 files

FreeBSD/src 6450212sbin/mdmfs mdmfs.c

mdmfs: Use standard bool definition

Include `<stdbool.h>` instead of defining a local bool enum.
This avoids duplicating a standard type name and keeps the
source compatible with headers that provide bool as a macro,
or in case of C23 that compilers provide it as keyword.

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+1-2sbin/mdmfs/mdmfs.c
+1-21 files

FreeBSD/src c5c7d18include assert.h

libc: Restrict the static_assert macro to pre-C23 modes

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+4-1include/assert.h
+4-11 files

FreeBSD/src 867b514include assert.h

libc: Add variadic assert in accordance with C23

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+35-7include/assert.h
+35-71 files

FreeBSD/src 60c11e7include/rpcsvc yp_prot.h

rpcsvc: Remove obsolete bool definition from yp_prot.h

`yp_prot.h` has carried a SunRPC-era typedef of `bool` guarded by
`BOOL_DEFINED`, but the header itself does not use it. The YP/RPC
interfaces use `bool_t` for protocol booleans.

Defining `bool` in a public header collides with modern C headers
that provide `bool` as a macro or keyword, such as `<stdbool.h>`
and C23-aware assert handling. Drop the compatibility typedef and
leave `bool` definition to the consumer's language mode.

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+0-5include/rpcsvc/yp_prot.h
+0-51 files

FreeBSD/src 2010906sys/kern imgact_elf.c

imgact_elf: add sysctl kern.elfXX.phnums for the number of program headers

that are accepted in the activated image or interpreter.

Requested by:   jhb
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57328
DeltaFile
+12-10sys/kern/imgact_elf.c
+12-101 files

FreeBSD/src 2fa4bddsys/contrib/edk2/Include Base.h

edk2: enable static asserts for *INT64 alignment

The ia32 loader is now built with -malign-double, so these should pass.

Differential Revision:  https://reviews.freebsd.org/D55386
DeltaFile
+0-2sys/contrib/edk2/Include/Base.h
+0-21 files

FreeBSD/src d15cc76stand loader.mk defs.mk, stand/efi Makefile Makefile.inc

stand: compile ia32 EFI loader with -malign-double

The UEFI spec says:
> Structures are aligned on boundaries equal to the largest internal
> datum of the structure and internal data are implicitly padded to
> achieve natural alignment.

Unlike the old Intel EFI toolkit, the EDK2 headers expect ia32 builds to
use -malign-double to achive this.

Make EFI versions of libsa32, liblua32, and ficl32. With the difference
being that they are compiled with -malign-double.

Differential Revision:  https://reviews.freebsd.org/D55385
DeltaFile
+7-1stand/efi/Makefile
+5-0stand/efi/Makefile.inc
+2-2stand/loader.mk
+3-0stand/efi/liblua32efi/Makefile
+3-0stand/efi/ficl32efi/Makefile
+1-1stand/defs.mk
+21-41 files not shown
+22-47 files

FreeBSD/src f048a1atests/sys/netipsec/tunnel Makefile

tests/ipsec: Run in parallel

Use execenv=jail to enable this.

MFC after:      1 week
DeltaFile
+2-2tests/sys/netipsec/tunnel/Makefile
+2-21 files

FreeBSD/src e492ad0sys/netlink/route rt.c

netlink/route: extend pre-2.6.19 Linux compat shim to del/getroute

Commit f34aca55adef ("netlink/route: provide pre-2.6.19 Linux compat shim",
2024-06) fixed the partial fix for net/bird2 on the netlink path by mapping the
legacy 8-bit struct rtmsg::rtm_table field onto the modern 32-bit RTA_TABLE
attribute when the latter is absent.

That fix, however, was only applied to rtnl_handle_newroute. The two sibling
handlers: rtnl_handle_delroute and rtnl_handle_getroute were left looking at
attrs.rta_table directly. They are reachable from exactly the same client
(bird, in its netlink scan path), so any FIB number that fits in 8 bits
silently maps to RT_TABLE_UNSPEC in those handlers.

Reviewed by:    melifaro (previous version)
Approved by:    emaste
MFC after:      1 week
Sponsored by:   Netflix
DeltaFile
+11-3sys/netlink/route/rt.c
+11-31 files