FreeBSD/src 6edecf5 — sys/dev/iwx if_iwxreg.h

iwx: drop #pragma directives

Differential Revision:  https://reviews.freebsd.org/D61822
DeltaFile
+1-4sys/dev/iwx/if_iwxreg.h
+1-41 files

FreeBSD/src aa38b28 — sys/dev/iwx if_iwx.c

add iwx_update_promisc()

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61824
DeltaFile
+7-0sys/dev/iwx/if_iwx.c
+7-01 files

FreeBSD/src b28bab9 — sys/dev/iwx if_iwx.c

iwx: unbreak monitor mode support

A bunch of changes that turns it into a working mode (at least for me)

1) Call iwx_auth instead of iwx_run on -> RUN transition in monitor mode.
   That's how it is intended to work because we never transition to the
   AUTH state in this mode and current implementation of iwx_run just
   results in endless 'firmware error' -> 'restart' loop.
2) Use ic_curchan instead of ic_bsschan while initializing NIC state;
   the last one contains ANYC channel in monitor mode.
3) Do not print 'input_all returned -1' message - ieee80211_input_mimo_all
   always returns -1 in monitor mode.
4) Always set IEEE80211_RADIOTAP_F_FCS in radiotap flags while in monitor mode.
   While header documentation states it is controlled by IWX_MAC_FILTER_IN_CRC32
   flag in practice IWX_MAC_FILTER_IN_PROMISC appends it as well - and it is
   required since this is the only flag that allows to receive data and
   control frames. While it alone is enough I left other flags in place for
   smaller diff with other drivers.


    [6 lines not shown]
DeltaFile
+11-5sys/dev/iwx/if_iwx.c
+11-51 files

FreeBSD/src b6273b2 — share/misc organization.dot

organization.dot: update doceng

Checked in with ziaee@ about this.

Differential Revision: https://reviews.freebsd.org/D61820
DeltaFile
+1-1share/misc/organization.dot
+1-11 files

FreeBSD/src 28631ce — share/misc organization.dot

organization.dot: update postmaster

Checked in with zi@ for the update.

Differential Revision:  https://reviews.freebsd.org/D61819
Reviewed by: zi
DeltaFile
+1-1share/misc/organization.dot
+1-11 files

FreeBSD/src 01149c1 — share/misc organization.dot

organization.dot: update mirroradmin

Mirroradmin is now just clusteradm.

Differential Revision:  https://reviews.freebsd.org/D61817
Reviewed by: zi
DeltaFile
+1-1share/misc/organization.dot
+1-11 files

FreeBSD/src e03a08f — share/misc organization.dot

organization.dot: update clusteradm

I checked with zi@ and others in clusteradm.

Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D61816
DeltaFile
+1-1share/misc/organization.dot
+1-11 files

FreeBSD/src 4f1fda6 — share/misc organization.dot

organization.dot: update core secretary

I'm it for the time being.

Reviewed by:    jrm, olivier, imp, glebius
Differential Revision:  https://reviews.freebsd.org/D61815
DeltaFile
+1-1share/misc/organization.dot
+1-11 files

FreeBSD/src cef5a74 — share/misc organization.dot

organization.dot: update bugmeister

checked in with linimon@ about what this should say.

Reviewed by:    ziaee
Differential Revision:  https://reviews.freebsd.org/D61814
DeltaFile
+1-1share/misc/organization.dot
+1-11 files

FreeBSD/src 7dfe3d0 — share/misc organization.dot

organization.dot: update core to core.14 members

Update this to core.14 members.

Reviewed by:    ziaee, jrm, olivier, imp, glebius, allanjude, bcr
Differential Revision:  https://reviews.freebsd.org/D61813
DeltaFile
+1-2share/misc/organization.dot
+1-21 files

FreeBSD/src 3795cef — sys/powerpc/powerpc altivec.c

powerpc: fix the VSCR save and restore on little endian

VSCR was saved and restored through stvewx/lvewx at byte 12 of a
16 byte slot. Which element those instructions move at a given address
depends on the byte order, so on little-endian kernels they touched VR
bits 0-31 instead of the 96-127 where mfvscr/mtvscr keep VSCR: every
context switch and signal reset VSCR to 0, losing NJ and SAT.
Replicate the word into all four elements first so that the element
choice no longer matters.

VSCR[NJ] set with mtvscr read back as 0 after a usleep on a
little-endian kernel; it is preserved now.

Reviewed by:    adrian, jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61525

(cherry picked from commit 27b4bb447eababd60da777065a813d2379050850)
DeltaFile
+20-2sys/powerpc/powerpc/altivec.c
+20-21 files

FreeBSD/src 76eb059 — sys/powerpc/powerpc exec_machdep.c

powerpc: don't drop FPU and VMX ownership in grab_mcontext()

grab_mcontext() saved the FP and vector registers with save_fpu() and
save_vec(), which drop ownership: PCPU(fputhread) becomes NULL while
PCB_FPU stays set and the thread keeps using the unit. A later
cpu_update_pcb(), at fork(2) or thr_new(2), then skipped the save,
since save_fpu_nodrop() only saves for the thread that owns the unit,
and the child got the registers as they were at the getcontext() or
signal rather than at the fork. Use the nodrop variants.

A child forked after getcontext() saw the parent's f14 as it was at
the getcontext(); it sees the current value now.

Reviewed by:    adrian, jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60837

(cherry picked from commit 8a79b6398f06f31947a2dada576c5f489c69d498)
DeltaFile
+2-2sys/powerpc/powerpc/exec_machdep.c
+2-21 files

FreeBSD/src 8103f9c — sys/powerpc/powerpc exec_machdep.c

powerpc64: don't reserve the red zone on the alternate signal stack

A 64-bit signal frame is 1552 bytes; rounded up and with the 512 byte
red zone added it needs 2096 bytes, more than MINSIGSTKSZ (2048), so a
handler on a minimum size alternate stack had its frame start 48 bytes
below the stack. The red zone only exists below the interrupted code's
stack pointer, so skip it only when the frame goes on that stack.

A handler on a MINSIGSTKSZ alternate stack overwrote the 48 bytes below
it; the frame stays within the stack now.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61519

(cherry picked from commit 34005cb7d5caeee3f3073cbc2adc3b2841ef54d7)
DeltaFile
+9-5sys/powerpc/powerpc/exec_machdep.c
+9-51 files

FreeBSD/src e40785b — contrib/netbsd-tests/lib/libpthread t_name.c, lib/libthr/tests Makefile

libthr: Enable the thread name test

Adapt NetBSD's thread naming tests to run it on FreeBSD.
Account for differences in `pthread_setname_np()` and the absence
of thread naming attributes on FreeBSD.

MFC after:      1 week
Reviewed by:    ngie, kib
Differential Revision:  https://reviews.freebsd.org/D61609
DeltaFile
+31-0contrib/netbsd-tests/lib/libpthread/t_name.c
+1-1lib/libthr/tests/Makefile
+32-12 files

FreeBSD/src 1b3698a — sys/arm64/arm64 pmap.c

arm64/pmap: Fix invalidate_icache condition in stage2 fault

pmap_stage2_fault is supposed to invalidate the icache if it is
accessing an executable page. Instead, the condition currently checks
whether execution is disallowed at any EL. Make it check whether
execution is allowed at any EL to match the intended behaviour.

Signed-off-by: Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2416
(cherry picked from commit 728d9f322935905c09236e8312b3268b6ff8691b)
DeltaFile
+1-1sys/arm64/arm64/pmap.c
+1-11 files

FreeBSD/src 374d678 — sys/amd64/amd64 pmap.c, sys/arm64/arm64 pmap.c

amd64/arm64 pmap: Remove KASSERTs that can never fail

In pmap_enter_largepage(), arm64's L1 block case twice asserts that
pmap_l0_to_l1() didn't return NULL, and amd64's 1G case asserts that
pmap_pml4e_to_pdpe() didn't.  Neither function ever returns NULL, so
these assertions can never fail.
DeltaFile
+0-2sys/arm64/arm64/pmap.c
+0-1sys/amd64/amd64/pmap.c
+0-32 files

FreeBSD/src bae776b — sys/kern uipc_shm.c

shm: Fix a shm object refcount leak in shm_rename(SHM_RENAME_EXCHANGE)

With RENAME_EXCHANGE we acquire an extra ref on the destination object
so that shm_remove() doesn't free it.  However, we failed to release
that ref if the rename fails.

Reported by:    Laam Alif at Ibteda Digital Library
Fixes:          9afb12bab41f ("Add an shm_rename syscall")
Reviewed by:    kib
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61806
DeltaFile
+2-0sys/kern/uipc_shm.c
+2-01 files

FreeBSD/src 795fc5b — sys/fs/tmpfs tmpfs_subr.c, sys/kern uipc_shm.c

vm_object: Fix synchronization between reinit and global list walks

Checking for OBJT_DEAD in vm_object_list_handler() is racy since pagers
may set the object type to OBJT_DEAD after having dropped and reacquired
the object lock.  dev_pager_dealloc() does this, for instance.  Check
for the OBJ_DEAD flag as well, as that is set earlier.  Fix one rare
case in the vnode pager where we freed an object without setting
OBJ_DEAD, and add an assertion to the zone destructor.

Try to minimize accesses of the object after dropping the object lock in
vm_object_list_handler().
Add a comment to warn others to think carefully before adding more
cases.

Fix shm_get_path() to reject dead objects.  Fix tmpfs to finish
initialization of the object under its lock; we cannot claim that the
object is thread-private since it lives on a global list.

Try to close races with _vm_object_allocate().  Update object->flags,

    [20 lines not shown]
DeltaFile
+30-22sys/vm/vm_object.c
+7-15sys/vm/swap_pager.c
+14-6sys/fs/tmpfs/tmpfs_subr.c
+13-2sys/vm/device_pager.c
+2-2sys/vm/vm_object.h
+1-1sys/kern/uipc_shm.c
+67-481 files not shown
+68-487 files

FreeBSD/src 2aa874b — sys/compat/linux linux_file.c

linux: Pass a valid thread pointer to linux_msg()

linux_msg() will dereference that pointer if a debugging flag is set.

Reported by:    Tianyi Chen <hi at tychen.cc>
Fixes:          3965de642c29 ("linux: Add inotify support")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
DeltaFile
+4-5sys/compat/linux/linux_file.c
+4-51 files

FreeBSD/src 6186fe5 — sys/compat/freebsd32 freebsd32_misc.c

freebsd32: Fix the ffclock estimate conversions

The CP() arguments were reversed in both directions, so
ffclock_getestimate() copied out uninitialized stack memory and
ffclock_setestimate() installed it as the system estimate.

Add helper functions to do the conversion, implemented so as to make
such mistakes harder to make.

Fixes:          e3e811a3f824 ("freebsd32: add feed foward clock syscalls")
Reviewed by:    brooks
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61774
DeltaFile
+38-20sys/compat/freebsd32/freebsd32_misc.c
+38-201 files

FreeBSD/src d222889 — sys/arm64/arm64 pmap.c

arm64 pmap: Sync the icache in pmap_enter_largepage()

Unlike pmap_enter(), don't test PGA_ICACHE_SYNCED, because large pages
are unmanaged.

While here, assert that va is aligned to the page size, as amd64 does,
and that the pmap is stage 1, which the new code assumes.

Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D61897
DeltaFile
+29-8sys/arm64/arm64/pmap.c
+29-81 files

FreeBSD/src 1d16286 — lib/libc/gen fnmatch.c

libc/fnmatch/rangematch: fix incorrect arguments to memset

strmbs variable is already a pointer, so calling memset on its address
was equivalent to setting the pointer, but the intent was to set the
pointed object.

This was found while debugging an unrelated issue in the same function.

Fixes:          af79566b9315
MFC after:      1 week
DeltaFile
+2-2lib/libc/gen/fnmatch.c
+2-21 files

FreeBSD/src 11a3bc0 — lib/libc/gen fnmatch.c, lib/libc/tests/gen fnmatch_test.c

libc/fnmatch/rangematch: fix uninitialized variable read in a condition

The condition was logically incorrect and could also result in access to
an uninitialized variable.  The bug happened because of misplaced
parentheses in the complex condition.  There is another very similar
condition in the code and it has the correct placement, so it does not
have the bug.  I used it as an example for the fix.  Both conditions
came from the same commit af79566b9315.

For me, the bug appeared as a random failure to match a simple pattern
with '[0-9]' in it.  The value of the uninitialized variable depended on
the value left on the stack by other code, so the bug appeared only
under very specific conditions.

FWIW, gcc catches and reports the uninitialized variable problem.
clang does it only with -Wconditional-uninitialized but that flag leads
to too many false positives.

I also found a pattern that deterministically reveals the bug in a

    [14 lines not shown]
DeltaFile
+2-2lib/libc/gen/fnmatch.c
+3-0lib/libc/tests/gen/fnmatch_test.c
+5-22 files

FreeBSD/src 8054051 — sys/dev/hwpmc hwpmc_core.c

hwpmc: claim stray PMI NMIs on Intel

core2_intr() claims an NMI only when IA_GLOBAL_STATUS shows an
overflow. It re-enables the LAPIC PMC vector before acking the
status bits, so a PMI raised while the handler runs can latch a
second NMI that finds the status already clear. That NMI goes
unclaimed and, with the default machdep.panic_on_nmi, panics the
machine. hwpmc_amd.c already absorbs such NMIs with a per-CPU
nmi_counter.

Give core2_intr() one credit per serviced PMI and spend it on the
next NMI on that CPU that finds no overflow.

Reproduced on a Xeon D-1518 (Broadwell-DE) running system-wide
CPU_CYCLES sampling: the unpatched kernel panicked with "NMI" after
about 47k PMIs. With this change it ran 12.5 hours (485k PMIs),
absorbed 6 empty NMIs, and did not panic.

Sponsored by: Netflix

    [2 lines not shown]
DeltaFile
+16-0sys/dev/hwpmc/hwpmc_core.c
+16-01 files

FreeBSD/src 835c11c — sys/powerpc/powerpc altivec.c

powerpc: fix the VSCR save and restore on little endian

VSCR was saved and restored through stvewx/lvewx at byte 12 of a
16 byte slot. Which element those instructions move at a given address
depends on the byte order, so on little-endian kernels they touched VR
bits 0-31 instead of the 96-127 where mfvscr/mtvscr keep VSCR: every
context switch and signal reset VSCR to 0, losing NJ and SAT.
Replicate the word into all four elements first so that the element
choice no longer matters.

VSCR[NJ] set with mtvscr read back as 0 after a usleep on a
little-endian kernel; it is preserved now.

Reviewed by:    adrian, jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61525

(cherry picked from commit 27b4bb447eababd60da777065a813d2379050850)
DeltaFile
+20-2sys/powerpc/powerpc/altivec.c
+20-21 files

FreeBSD/src ce3c2b4 — sys/powerpc/powerpc exec_machdep.c

powerpc64: don't reserve the red zone on the alternate signal stack

A 64-bit signal frame is 1552 bytes; rounded up and with the 512 byte
red zone added it needs 2096 bytes, more than MINSIGSTKSZ (2048), so a
handler on a minimum size alternate stack had its frame start 48 bytes
below the stack. The red zone only exists below the interrupted code's
stack pointer, so skip it only when the frame goes on that stack.

A handler on a MINSIGSTKSZ alternate stack overwrote the 48 bytes below
it; the frame stays within the stack now.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61519

(cherry picked from commit 34005cb7d5caeee3f3073cbc2adc3b2841ef54d7)
DeltaFile
+9-5sys/powerpc/powerpc/exec_machdep.c
+9-51 files

FreeBSD/src c7b5351 — sys/powerpc/powerpc exec_machdep.c

powerpc: don't drop FPU and VMX ownership in grab_mcontext()

grab_mcontext() saved the FP and vector registers with save_fpu() and
save_vec(), which drop ownership: PCPU(fputhread) becomes NULL while
PCB_FPU stays set and the thread keeps using the unit. A later
cpu_update_pcb(), at fork(2) or thr_new(2), then skipped the save,
since save_fpu_nodrop() only saves for the thread that owns the unit,
and the child got the registers as they were at the getcontext() or
signal rather than at the fork. Use the nodrop variants.

A child forked after getcontext() saw the parent's f14 as it was at
the getcontext(); it sees the current value now.

Reviewed by:    adrian, jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60837

(cherry picked from commit 8a79b6398f06f31947a2dada576c5f489c69d498)
DeltaFile
+2-2sys/powerpc/powerpc/exec_machdep.c
+2-21 files

FreeBSD/src 02e1b1c — usr.sbin/bluetooth/iwmbtfw iwmbt_fw.c

iwmbtfw(8): Load firmware from filesystem with mmap()

rather than with read() to simplify the code and alleviate concerns
about partial reads.
DeltaFile
+5-23usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c
+5-231 files

FreeBSD/src 2cc3f14 — sys/kern kern_rmlock.c

rms: tidy up

No functional changes.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+13-14sys/kern/kern_rmlock.c
+13-141 files

FreeBSD/src c6e1457 — sys/x86/include specialreg.h, sys/x86/x86 mp_x86.c

x86: Do not take a CPUID leaf 1Fh module for the package

Each level of CPUID leaf 0Bh or 1Fh reports the shift that addresses
the next level up.  Leaf 0Bh has only the SMT and core levels, so the
core level's shift identifies the package.  Leaf 1Fh may enumerate
module, tile, die and die group levels above the core level, and then
the core level's shift identifies one of those instead.

topo_probe_intel_0xb() used the core level's shift for the package in
both cases.  On a processor that enumerates a module level, every
module became a package, and the L3 cache was cut down to the module
with "WARNING: L3 data cache covers more APIC IDs than a package", so
the scheduler did not see that the modules share it.  An Atom x7809C
(Amston Lake), which reports shifts of 1, 3 and 7 for its SMT, core and
module levels, came up as two packages of four cores.  The N150 (Twin
Lake) in the PR is affected in the same way.

Use the shift of the last level enumerated for the package.  The SDM
describes the package as the unenumerated domain above the last valid

    [24 lines not shown]
DeltaFile
+48-7sys/x86/x86/mp_x86.c
+4-0sys/x86/include/specialreg.h
+52-72 files