FreeBSD/src d82bcf5sys/netgraph/bluetooth/drivers/ubt ng_ubt.c ng_ubt_intel.c, usr.sbin/bluetooth/iwmbtfw iwmbtfw.8 iwmbtfw.conf

bluetooth: add device IDs for Intel AX411 and BE200 adapters

Add USB product IDs for Intel AX411 (0x0035) and BE200 (0x0036)
Bluetooth adapters to ng_ubt_intel, ng_ubt, iwmbtfw, and iwmbtfw.conf.

Both chips use the same TLV-based firmware protocol as the existing
9260/9560 entries.  Newer Blazar-generation chips (BE201, BE202,
Whale Peak 2) are omitted as they require IML support not yet
implemented in iwmbtfw.

Signed-off-by: Christos Longros <chris.longros at gmail.com>

Reviewed by:    wulf
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56122
DeltaFile
+2-5sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
+2-2usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8
+2-0sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c
+1-1usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf
+2-0usr.sbin/bluetooth/iwmbtfw/main.c
+9-85 files

FreeBSD/src f54caa0sys/dev/evdev evdev_utils.c, sys/dev/hid hkbd.c hid.h

hkbd(4): fix handling of apple function keys in hid and evdev

Signed-off-by: tslight <tslight at pm.com>

Reviewed by:    wulf
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1998
DeltaFile
+72-16sys/dev/hid/hkbd.c
+8-3sys/dev/evdev/evdev_utils.c
+2-0sys/dev/hid/hid.h
+82-193 files

FreeBSD/src bb8230fsys/dev/hid hkbd.c, sys/dev/usb/input ukbd.c

hkbd(4): add some extra handy fn key bindings

- Fn+S for ScrollLock as it's very useful to have ScrollLock on
  FreeBSD's TTY.
- Fn+P for PrtSc/SysRq, as it's another very handy but sadly missing
  key on Macbooks.
- Some other Fn+<key> combinations duplicating existing keys.

Apply the change to ukbd(4) as well.

Signed-off-by: Toby Slight <tslight at pm.me>

Reviewed by:    wulf
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1998
DeltaFile
+10-0sys/dev/hid/hkbd.c
+10-0sys/dev/usb/input/ukbd.c
+20-02 files

FreeBSD/src 1033253sys/dev/hid hkbd.c, sys/dev/usb/input ukbd.c

hkbd(4): be more cautious & explicit about Apple vendor checking

Apply the changes to ukbd(4) as well.

Signed-off-by: tslight <tslight at pm.com>

Reviewed by:    wulf
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1998
DeltaFile
+34-29sys/dev/hid/hkbd.c
+31-26sys/dev/usb/input/ukbd.c
+1-1sys/modules/hid/hkbd/Makefile
+66-563 files

FreeBSD/src 40f55easys/dev/hid hkbd.c, sys/dev/usb/input ukbd.c

ukbd(4): backport Apple function keys support from hkbd(4)

and expose eject in addition to fn.

Signed-off-by: tslight <tslight at pm.com>

Reviewed by:    wulf
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1998
DeltaFile
+81-20sys/dev/usb/input/ukbd.c
+10-6sys/dev/hid/hkbd.c
+91-262 files

FreeBSD/src 920ad3csys/dev/usb/input ukbd.c

ukbd(4): make debug guard consistent with hkbd(4)

Signed-off-by: Toby Slight <tslight at pm.me>

Reviewed by:    wulf
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1998
DeltaFile
+3-1sys/dev/usb/input/ukbd.c
+3-11 files

FreeBSD/src 7d1285esys/amd64/amd64 exec_machdep.c

amd64 sendsig(): explicitly copy registers from trapframe to ucontext

With the IDT event delivery, previously reserved fields in tf_cs and
tf_ss are guaranteed to be zero. With FRED, these fields are not zero,
which affects the values copied to userspace.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56141
DeltaFile
+28-1sys/amd64/amd64/exec_machdep.c
+28-11 files

FreeBSD/src 6904270usr.sbin/syslogd syslogd.c, usr.sbin/syslogd/tests syslogd_test.sh

syslogd: Fix ereregex property filters and add test

This change fixes Bug 293879, where ereregex filters in syslogd
did not handle alternation correctly.

The issue appears to come from mixing up two different kinds of
flags: syslogd's internal serialized filter flags in
usr.sbin/syslogd/syslogd.h, and the regex compilation flags from
include/regex.h. ereregex was storing REG_EXTENDED in cmp_flags,
even though cmp_flags is meant to carry syslogd's own FILT_FLAG_*
values for configuration serialization and reconstruction.

REG_EXTENDED has the same bit value as FILT_FLAG_EXCLUDE, so the
filter could be reconstructed with the wrong semantics.

The fix stores FILT_FLAG_EXTENDED instead, allowing syslogd to
correctly REG_EXTENDED when compiling the regex.

A test was also added for both ereregex and !ereregex filters.

    [7 lines not shown]
DeltaFile
+22-0usr.sbin/syslogd/tests/syslogd_test.sh
+1-1usr.sbin/syslogd/syslogd.c
+23-12 files

FreeBSD/src e7de7fesys/dev/usb usbdevs

usbdevs: Add USB device IDs for Nuand bladeRF SDR

Add vendor and product IDs for bladeRF family of USB software defined radios manufactured by Nuand LLC.

Reviewed by:    imp, adrian
Differential Revision:  https://reviews.freebsd.org/D54733
DeltaFile
+7-0sys/dev/usb/usbdevs
+7-01 files

FreeBSD/src b65e7b4sys/fs/nfsserver nfs_nfsdsocket.c

nfs_nfsdsocket.c: All Copy and Clone across file systems

For some server file system types, such as ZFS, a Copy/Clone
operation can be done across file systems of the same file
system type.

As such, this patch allows the Copy/Clone to be attempted
when the file handles are for files on different file systems.

This fixes a problem for exported ZFS file systems when a
copy_files on file_range(2) between file systems in the same
NFSv4 mount is attempted.

PR:     294010
MFC after:      2 weeks
DeltaFile
+2-1sys/fs/nfsserver/nfs_nfsdsocket.c
+2-11 files

FreeBSD/src 6cc99balib/libc/gen dup3.3, lib/libsys dup.2

dup(2): document the handling of filedescriptor flags

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D56121
DeltaFile
+4-1lib/libsys/dup.2
+2-0lib/libc/gen/dup3.3
+6-12 files

FreeBSD/src c8d40bfusr.bin/diff pr.c

diff: use O_CLOEXEC on pipes

This only simplifies the code, no functional changes expected

MFC After:      1 week
DeltaFile
+2-5usr.bin/diff/pr.c
+2-51 files

FreeBSD/src 945e60eusr.bin/diff3 diff3.c

diff3: set O_CLOEXEC on pipes

This avoid leaking pipe fd in children and simplifies the code

MFC After:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D56120
DeltaFile
+2-6usr.bin/diff3/diff3.c
+2-61 files

FreeBSD/src 7b6be00sys/dev/hyperv/vmbus/x86 hyperv_reg.h, sys/x86/x86 local_apic.c

Hyper-V: Detect Extended Destination ID support

Hyper-V advertises support for the Extended Destination ID standard via
bit 2 of the value returned in the EAX register when the hypervisor
stack properties are queried via CPUID.

This is based on a commit to the Linux kernel, as there does not seem
to be any other documentation of this feature.

Reviewed by:    Souradeep Chakrabarti
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55432
DeltaFile
+9-0sys/x86/x86/local_apic.c
+6-0sys/dev/hyperv/vmbus/x86/hyperv_reg.h
+15-02 files

FreeBSD/src 8dd9a0dsys/x86/x86 local_apic.c

Bhyve: Detect Extended Destination ID support

Bhyve advertises support for the Extended Destination ID standard via
bit 0 (aka CPUID_BHYVE_FEAT_EXT_DEST_ID) of the value returned in the
EAX register when Bhyve features are queried via CPUID.

MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55431
DeltaFile
+8-0sys/x86/x86/local_apic.c
+8-01 files

FreeBSD/src 49b6254sys/amd64/vmm x86.c, sys/x86/include bhyve.h

vmm: Move defines from x86.c to x86/bhyve.h

The values CPUID_BHYVE_FEATURES and CPUID_BHYVE_FEAT_EXT_DEST_ID are
useful for guests, not just hosts; so they belong in a header file in
sys/x86/include rather than simply in the .c file implementing the
bhyve host side.

The original addition of these defines took place without adding a
copyright statement, but since I'm moving them into a new file I've
added the original author's standard copyright (Amazon).

MFC after:      3 weeks
Fixes:  313a68ea20b4 ("bhyve: Add CPUID_BHYVE_FEATURES leaf")
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55430
DeltaFile
+35-0sys/x86/include/bhyve.h
+1-4sys/amd64/vmm/x86.c
+36-42 files

FreeBSD/src 9b18ba2sys/x86/x86 local_apic.c

Xen: Detect Extended Destination ID support

Xen advertises support for the Extended Destination ID standard via
bit 5 (aka XEN_HVM_CPUID_EXT_DEST_ID) of the value returned in the
EAX register when Xen features are queried via CPUID.

MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55429
DeltaFile
+6-0sys/x86/x86/local_apic.c
+6-01 files

FreeBSD/src 8c986d1sys/contrib/xen/arch-x86 cpuid.h

x86/cpuid: add CPUID flag for Extended Destination ID support

Introduce the CPUID flag to be used in order to signal the support for
using an extended destination ID in IO-APIC RTEs and MSI address
fields. Such format expands the maximum target APIC ID from 255 to
32768 without requiring the usage of interrupt remapping.

The design document describing the feature can be found at:

http://david.woodhou.se/15-bit-msi.pdf

Signed-off-by: Roger Pau Monné <roger.pau at citrix.com>
Reviewed-by: Jan Beulich <jbeulich at suse.com>
DeltaFile
+7-0sys/contrib/xen/arch-x86/cpuid.h
+7-01 files

FreeBSD/src 9ab5aa3sys/x86/include kvm.h, sys/x86/x86 local_apic.c

KVM: Detect Extended Destination ID support

KVM advertises support for the Extended Destination ID standard via
bit 15 of the value returned in the EAX register when KVM features
are queried via CPUID.

Tested on:      EC2 r8i.96xlarge
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55427
DeltaFile
+11-0sys/x86/x86/local_apic.c
+1-0sys/x86/include/kvm.h
+12-02 files

FreeBSD/src b0e1b10sys/x86/include apicvar.h, sys/x86/x86 io_apic.c

io_apic: Support APIC Extended Destination IDs

If APIC Extended Destination ID support is enabled, use it in APIC RTEs
by allowing APIC IDs up to 2^15 - 1 and encoding the high bits into
Intel "reserved" bits per the standard.

Reviewed by:    kib
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55889
DeltaFile
+7-0sys/x86/x86/io_apic.c
+1-0sys/x86/include/apicvar.h
+8-02 files

FreeBSD/src 02f29c1sys/x86/x86 msi.c

msi: Support APIC Extended Destination IDs

If APIC Extended Destination ID support is enabled, use it in MSIs by
allowing APIC IDs up to 2^15 - 1 and encoding the high bits into
Intel "reserved" bits per the standard.

Tested on:      EC2 r8i.96xlarge
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55426
DeltaFile
+9-2sys/x86/x86/msi.c
+9-21 files

FreeBSD/src d9db6d7sys/x86/include apicvar.h, sys/x86/x86 local_apic.c

x86: Add stub for Extended Destination ID support

Without an IOMMU, the APIC standard only allows 8 bits of Destination
ID for MSI messages, limiting us to 256 CPUs.  While IOMMUs can allow
for more than 256 CPUs to be supported, they are not necessarily
desirable in virtualized environments.

The Extended Destination ID standard authored by David Woodhouse uses
7 "Reserved" bits for the high bits of a 15-bit Extended Destination
ID in order to address this: http://david.woodhou.se/ExtDestId.pdf

Add a loader tunable machdep.apic_ext_dest_id to control the use of
this feature; the default value (-1) means "autodetect" while 0 and
1 mean disabled and enabled respectively.

Code to detect host support in Xen, Hyper-V, KVM, and Bhyve will come
in future commits, as will the code to use this setting in msi_map and
ioapic_program_intpin.


    [4 lines not shown]
DeltaFile
+15-0sys/x86/x86/local_apic.c
+1-0sys/x86/include/apicvar.h
+16-02 files

FreeBSD/src 5809c9asys/x86/x86 io_apic.c

io_apic: Don't route to APIC ID > 255

I/O APIC Redirection Table Entries use 8 bits to encode the Destination
ID.  Attempting to route an IRQ to a higher APIC ID would result in it
being silently routed to the value reduced modulo 256, causing a panic
if the IRQ fired since the receiving CPU would not expect that IRQ.

Instead, print a warning and mark the interrupt as invalid, resulting
in it being forcibly masked.

Reviewed by:    kib
Tested on:      EC2 r8i.96xlarge
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55857
DeltaFile
+13-3sys/x86/x86/io_apic.c
+13-31 files

FreeBSD/src 1d0ccd6sys/x86/x86 io_apic.c

x86: Add struct ioapic_intsrc.io_valid

As of this commit, io_valid is always set to 1; but a future commit
will set it to 0, at which point IOART_INTMSET will be set to forcibly
disable interrupt sources regardless of whether they are requested to
be "masked".

Reviewed by:    kib
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D56006
DeltaFile
+11-3sys/x86/x86/io_apic.c
+11-31 files

FreeBSD/src f350063sys/x86/x86 local_apic.c

clapic_handle_intr: KASSERT isrc != NULL

If an interrupt arrives at a CPU which isn't expecting that particular
vector, intr_lookup_source will return an isrc of NULL and we'll panic
when intr_execute_handlers increments *isrc->is_count.

Place a KASSERT a few nanoseconds earlier in order to leave some more
breadcrumbs for the next person to trip over this behaviour.

Tested on:      EC2 r8i.96xlarge
MFC after:      3 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D55851
DeltaFile
+3-0sys/x86/x86/local_apic.c
+3-01 files

FreeBSD/src 72bb61bsys/amd64/conf NOTES, sys/x86/conf NOTES

i386/amd64/NOTES: Add some missing devices

The following devices to x86: ocs_fc aq vge tws
And this to amd64: ufshci

These are in GENERIC, but not NOTES.

Sponsored by:           Netflix
DeltaFile
+5-0sys/x86/conf/NOTES
+3-0sys/amd64/conf/NOTES
+8-02 files

FreeBSD/src ccc235fsys/dev/vmgenc vmgenc_acpi.c

vmgenc: fix typo in MODULE_DEPEND declaration

The random_harvestq dependency was registered under the misspelled
name "vemgenc" instead of "vmgenc", causing the dependency to not
be associated with the correct module.

Signed-off-by: Christos Longros <chris.longros at gmail.com>
Reviewed by: cem, imp
Differential Revision:  https://reviews.freebsd.org/D56012
DeltaFile
+1-1sys/dev/vmgenc/vmgenc_acpi.c
+1-11 files

FreeBSD/src beab2fesys/net/route route_ctl.c

routing: Include opt_route.h in route_ctl.c

Fix incorrect removal of opt_route.h header in route_ctl.c

Reported by:    Jenkins
Fixes:          254b23eb1f54 ("routing: Retire ROUTE_MPATH compile option")
Differential Revision: https://reviews.freebsd.org/D55884
DeltaFile
+1-0sys/net/route/route_ctl.c
+1-01 files

FreeBSD/src 254b23esys/net rtsock.c route.h, sys/net/route route_ctl.c nhop_ctl.c

routing: Retire ROUTE_MPATH compile option

The ROUTE_MPATH compile option was introduced to
test the new multipath implementation.
Since compiling it has no overhead and it's enabled
by default, remove it.

Reviewed by:    melifaro, markj
Relnotes:       yes
Differential Revision: https://reviews.freebsd.org/D55884
DeltaFile
+2-36sys/net/route/route_ctl.c
+13-21sys/netlink/route/rt.c
+10-22sys/net/rtsock.c
+0-17sys/net/route.h
+4-13sys/net/route/nhop_ctl.c
+6-8sys/netinet6/in6_fib.c
+35-11741 files not shown
+67-22347 files

FreeBSD/src 2371b24tests/sys/netinet6 ndp.sh

tests: Add grand link-layer event in netinet6/ndp

Add test for ndp to verity link-layer address change event
actually triggers the grand.

Differential Revision: https://reviews.freebsd.org/D55927
DeltaFile
+50-0tests/sys/netinet6/ndp.sh
+50-01 files