FreeBSD/src 0d3cd54sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: add function to update some rate related fields

Add lkpi_sta_supp_rates() which serves multiple purposes:
(a) build (and update) the supp_rates field on a sta link (deflink only
    in our case still),
(b) build and update basic_rates on the vif->bss_conf and print a
    warning in case we end up without any basic rate (should not happen
    anymore, not even on initial startup sync),
(c) if HT or VHT are supported, then update the relevant br_mask fields
    for the current band.

Deal with the various flags which trigger different updates by returning
them so the caller can act upon.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+150-2sys/compat/linuxkpi/common/src/linux_80211.c
+150-21 files

FreeBSD/src 038489esys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: make lkpi_sta_sync_from_ni() return bss_changes

This is a preparatory change with no functional changes.

Sponosred by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+9-4sys/compat/linuxkpi/common/src/linux_80211.c
+9-41 files

FreeBSD/src 42cf279sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: add/change rate related tracing

Make use of the TRACE_RATES() macro and add various tracing events.
Also adjust some events formerly under TRACEOK to TRACE_RATES().

Ignoring the tracing, no other functional changes.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+29-4sys/compat/linuxkpi/common/src/linux_80211.c
+29-41 files

FreeBSD/src cff565asys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: consider emulate_chanctx in lkpi_sync_chanctx_cw_from_rx_bw()

Only return early if the bandwidth has not changed and we are not
using emulate_chanctx or the chandef.width already matches the new
bandwidth.  Otherwise we have to continue to get all the values
updated.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+4-1sys/compat/linuxkpi/common/src/linux_80211.c
+4-11 files

FreeBSD/src 75aadc9sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: adjust timing of sync_from_ni in lkpi_sta_assoc_to_run()

We used to call the (*sta_state) downcall into the driver to set the
sta state to ASSOC.  After that we did a lot of sync operations incl.
the lkpi_sta_sync_from_ni() which does a lot of rate and bandwith
adjustments.   This sync call needs to happen before we set the sta
to assoc as drivers rely on some of this information, e.g., ht_cap and
vht_cap (and equivalents for later standards) at that point.  Moving
this will make, e.g., mt7921 transmit at higher rates than just
basic_rates.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+10-2sys/compat/linuxkpi/common/src/linux_80211.c
+10-21 files

FreeBSD/src 53d9c14sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: track bandwidth/rx_nss change in lkpi_sta_sync_from_ni()

In lkpi_sta_sync_from_ni() track the bandwidth and rx_nss at the
beginning so at the end we can diff if they changed in order to generate
the appropriate RC*CHNAGED flags for the (*link_sta_rc_update) downcall.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+13-0sys/compat/linuxkpi/common/src/linux_80211.c
+13-01 files

FreeBSD/src 7bf2eecsys/compat/linuxkpi/common/src linux_80211.c linux_80211.h

LinuxKPI: 802.11: initalize br_mask and basic_rates for each vap

During vap creating we inialize most [l]vif related variables.
Add a br_mask (bit rate mask) to the lvif and setup the legacy component
as it seems to be static.
Given we are looping over the bands, also initialize the bss_conf
basic_rates. At this point we only have all bitrates for the band
or the mandatory bitrates for the band available.  In order to not
hint usage of possibly unsupported bit rates set it up with the
manadatory bit rates only, which should get us through the mgmt
frames, etc. to get to assoc state.  By then we will do updates.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+44-1sys/compat/linuxkpi/common/src/linux_80211.c
+1-0sys/compat/linuxkpi/common/src/linux_80211.h
+45-12 files

FreeBSD/src d4a529asys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: add 11g check to lkpi_ic_getradiocaps()

Replace an early comment with code and add a (simplified) 11g check.
We make use of the annotated bitrate flags we added (see
lkpi_wiphy_band_annotate()) and check if on the 2GHz band there are
any bitrates which are 11g.  Upon the first one found we do set the
IEEE80211_MODE_11G to announce to net80211 that the 2.4Ghz channels
may operate on 11g as well.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+13-3sys/compat/linuxkpi/common/src/linux_80211.c
+13-31 files

FreeBSD/src 08a78a2sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: add/improve/correct comments

Adjust/add comments to clarify certain situations.

No functional changes.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+3-2sys/compat/linuxkpi/common/src/linux_80211.c
+3-21 files

FreeBSD/src 557eed6sys/compat/linuxkpi/common/include/net mac80211.h

LinuxKPI: 802.11: leave a comment for sta->rates (mt7615, ?)

While we currently try to fill most rates places (e.g., basic_rates,
supp_rates, (*set_bitrate_mask)), sta->rates are not populated.

They are likely managed by the 802.11 rate control code (given no
ieee80211_hw_check HAS_RATE_CONTROL), which for use would be net80211,
which will require some extra code just to manage that.

At least Mediatek mt76 (mt7615) driver seems to fall into the category
of this need.  See about that once/if we get to it.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+1-1sys/compat/linuxkpi/common/include/net/mac80211.h
+1-11 files

FreeBSD/src 482fda9sys/contrib/dev/mediatek/mt76/mt7925 pci.c

mt76: mt7925: prevent PM from scheduling another delayed work on detach

This duplicates 009d92b25f7c from mt7921 which has the full description.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+5-0sys/contrib/dev/mediatek/mt76/mt7925/pci.c
+5-01 files

FreeBSD/src b58d8dfsys/compat/linuxkpi/common/src linux_80211.h

LinuxKPI: 802.11: introduce TRACE_RATES()

Add a tracing bit for tracing rates related changes introduced in
followup commits.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+7-0sys/compat/linuxkpi/common/src/linux_80211.h
+7-01 files

FreeBSD/src f4cd991sys/x86/x86 ucode.c

x86/ucode.c: supposedly fix i386 compilation

Fixes:      16f21c5af350 ("amd64: there is no reason to copy ucode around in ucode_load_bsp()")
PR:     295926
Submitted by:   Martin Birgmeier <d8zNeCFG at aon.at>
MFC after:      3 days
DeltaFile
+1-1sys/x86/x86/ucode.c
+1-11 files

FreeBSD/src 3ffd2basys/net if_fwsubr.c

if_fwsubr: remove ARP target hardware address trimming

Per RFC 2734 section 5, the 1394 ARP packet is a fixed 32-octet structure
with no target hardware address field.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57617
DeltaFile
+0-7sys/net/if_fwsubr.c
+0-71 files

FreeBSD/src 51f4e90sys/dev/firewire firewire.c

firewire: NULL check on malloc in fw_busreset()

fw_busreset() allocates newrom with M_NOWAIT from interrupt context.
If the allocation fails, crom_load() dereferences a NULL pointer.

Skip the config ROM comparison on allocation failure so the next bus
reset will retry.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57728
DeltaFile
+3-0sys/dev/firewire/firewire.c
+3-01 files

FreeBSD/src 455c354sys/kgssapi gss_impl.c, usr.sbin/gssd gssd.c

gss_impl.c: Fix a nfsd hang when the kgssapi.ko is loaded, but no gssd

After the conversion to using netlink, the kgssapi had
no way of knowing if the gssd daemon was running.
As such, a boot where the kgssapi is loaded, but the
gssd is not enabled would hang the nfsd for a very
long time. (Many timeouts at 300sec each.)

This patch adds a Null RPC upcall with a 200msec
timeout to check to see if the gssd is running.
If the gssd is not running, the nfsd starts up
(without Kerberos support) with only a 200msec
delay.)

Also, move the svc_svc_nl_create() and svc_reg() calls in gssd.c
to before the daemon() call, so they are guaranteed to have
been done before the nfsd(8) daemon is started by
the rc scripts.


    [4 lines not shown]
DeltaFile
+40-2sys/kgssapi/gss_impl.c
+5-17usr.sbin/gssd/gssd.c
+45-192 files

FreeBSD/src b3249edsys/powerpc/booke trap_subr.S

powerpc/booke: Save watchdog context to "critical" save area

Watchdog interrupt is a "critical" interrupt, so save the correct
registers (CSSRn, into critical save area).
DeltaFile
+2-2sys/powerpc/booke/trap_subr.S
+2-21 files

FreeBSD/src 9faeaacsys/powerpc/booke pmap.c, sys/powerpc/include spr.h

powerpc/pmap: Use variable-sized TID

e6500 core supports 14-bit TIDs (16384), while all earlier cores support
only 8 bit TIDs.  Dynamically allocate the tidbusy array at bootstrap
time so that it stays in the TLB1, but is sized appropriately for the
core.  With MAXCPU of 32, a e6500 tidbusy would be (8 * 32 * 16384), or
4MB for this array, while e5500 would use (8 * 32 * 256), or 64kB.
DeltaFile
+45-7sys/powerpc/booke/pmap.c
+2-0sys/powerpc/include/spr.h
+47-72 files

FreeBSD/src 9006774sys/powerpc/booke trap_subr.S, sys/powerpc/include tlb.h

powerpc/booke: Extend TID register bits to the max

Some Book-E cores (at least e6500) can have much larger PID fields, up
to 14 bits.  Extend the PID mask space to the full space, and future
changes may take advantage of this extended space.
DeltaFile
+1-1sys/powerpc/booke/trap_subr.S
+1-1sys/powerpc/include/tlb.h
+2-22 files

FreeBSD/src 4c860dbsys/sys stdatomic.h

libc: Fix ATOMIC_VAR_INIT visibility

Fixes:          28cecfe27964 ("libc: Restrict ATOMIC_VAR_INIT for C23 conformance")
Reviewed by:    fuz, imp
Differential Revision:  https://reviews.freebsd.org/D57724
DeltaFile
+1-1sys/sys/stdatomic.h
+1-11 files

FreeBSD/src c37839dshare/mk gendirdeps.mk meta.autodep.mk

meta.autodep.mk remove extra }

remove extra } from GENDIRDEPS_ENV

more debug output for gendirdeps.mk

Reviewed by:    stevek
Differential Revision:  https://reviews.freebsd.org/D57727
DeltaFile
+11-3share/mk/gendirdeps.mk
+3-3share/mk/meta.autodep.mk
+14-62 files

FreeBSD/src 704db3f. UPDATING Makefile, share/man/man7 build.7

Source upgrade doc: etcupdate no longer needs -B

Note: We confusingly have the instructions to build the system in the
build manual, the UPDATING file, and the Makefile. These will get out
of sync and will be harmful when they do.

Fixes:  ddf6fad0295a ("etcupdate: Make nobuild the default")
Reviewed by:            jhb
Differential Revision:  https://reviews.freebsd.org/D57644
DeltaFile
+2-2UPDATING
+2-2share/man/man7/build.7
+1-1Makefile
+5-53 files

FreeBSD/src 015b890lib/libc/string memccpy.3 bcopy.3

mem*.3: stop refering to strings

POSIX and the C standard now refer to objects and sequences rather
than confusingly revering to strings.

Also update bcopy(3) and bzero(3).

Reviewed by:    emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57680
DeltaFile
+6-6lib/libc/string/memccpy.3
+5-5lib/libc/string/bcopy.3
+5-5lib/libc/string/memmove.3
+4-4lib/libc/string/memcpy.3
+4-4lib/libc/string/memmem.3
+3-3lib/libc/string/bzero.3
+27-271 files not shown
+30-307 files

FreeBSD/src 8b47939sys/kern uipc_socket.c

uipc_socket: prefer memcpy to bcopy

Reviewed by:    kib, emaste
Suggested by:   emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57689
DeltaFile
+5-5sys/kern/uipc_socket.c
+5-51 files

FreeBSD/src fc9b288sys/amd64/amd64 uio_machdep.c, sys/arm/arm uio_machdep.c

uiomove_*: centralize the copy function selection

Add a uiomove_step() for the central set of switch statements which
choose between userspace and kernel and if data is going to or from the
iovec.

Refactor uiomove_fromphys loops to unconditionally free per-iteration
resources and drop gotos.

While here, switch from bcopy to memcpy.

Reviewed by:    kib
Suggested by:   emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57688
DeltaFile
+37-28sys/kern/subr_uio.c
+3-33sys/riscv/riscv/uio_machdep.c
+3-33sys/arm64/arm64/uio_machdep.c
+3-31sys/amd64/amd64/uio_machdep.c
+3-30sys/i386/i386/uio_machdep.c
+3-30sys/arm/arm/uio_machdep.c
+52-1852 files not shown
+56-2158 files

FreeBSD/src 2ee2ef6sys/amd64/amd64 pmap.c, sys/arm/arm pmap-v6.c

pmap: prefer memcpy over bcopy

Alter pmap_copy_page(s) to use memcpy rather than the deprecated bcopy.
We'll be adding non-provenance preserving versions for CHERI support and
would like to avoid introducing variants of deprecated APIs just to
maintain symmetry.

Reviewed by:    kib
Suggested by:   emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57687
DeltaFile
+5-5sys/arm/arm/pmap-v6.c
+2-2sys/arm64/arm64/pmap.c
+2-2sys/riscv/riscv/pmap.c
+1-1sys/amd64/amd64/pmap.c
+10-104 files

FreeBSD/src c57fab6sys/fs/nfsserver nfs_nfsdstate.c

nfs_nfsdstate.c: Another unnecessary initialization for gcc

This code hasn't changed in a long time, so I don't know why
this showed up now?
DeltaFile
+1-1sys/fs/nfsserver/nfs_nfsdstate.c
+1-11 files

FreeBSD/src f5fce0bsys/kern kern_exec.c

kern_exec.c: explicitly include sys/limits.h for UINT_MAX

While there, remove unneeded manual inclusion of sys/cdefs.h.

Fixes:  e1a84b7708c2 ("execve_block(): a mechanism for mutual exclusion with execve() on the process")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+1-1sys/kern/kern_exec.c
+1-11 files

FreeBSD/src f6b3bd1tests/sys/sound mmap.c

sound tests: Remove trailing PROT_EXEC

Fixes:          730eaf466493 ("sound tests: Add PROT_EXEC rejection test")
Reported by:    Oliver Pinter <oliver.pntr at gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      6 days
DeltaFile
+1-1tests/sys/sound/mmap.c
+1-11 files

FreeBSD/src c7e5802sys/amd64/amd64 exception.S

amd64: do not restore fsbase/gsbase for 32bit processes

There is no WRFSBASE and WRGSBASE 32bit variants at all. As such, the
fsbase and gsbase must always be equal to the bases in the corresponding
segment descriptor, same as on real i386.

If a 32bit program reloads either %fs or %gs using setcontext(9) or
sigreturn(9), restoring bases from the syscall entry time is wrong.
In all other cases, hardware already does the right action when the
segment register is loaded, and the bases for the ufssel/ugssel in GDT
are updated on the context switch.

Reviewed by:    markj (previous version)
Tested by:      terehovv at mail.ru
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57611
DeltaFile
+31-0sys/amd64/amd64/exception.S
+31-01 files