FreeBSD/src 6ac7152sys/sys videoio.h

video(4): add extended controls and remaining V4L2 compat symbols

Add the extended control interface

Values match the reference ABI; the new struct layouts are pinned
with static assertions.

Reported by:    thierry

Reviewed by:    adrian, thierry
Differential Revision:  https://reviews.freebsd.org/D59496
DeltaFile
+162-1sys/sys/videoio.h
+162-11 files

FreeBSD/src 8e5e2c3share/man/man4 hfsts.4, sys/amd64/conf NOTES

intel: add hfsts debug-probe driver for Intel ME/HECI firmware status

Add an amd64-only, Intel-only diagnostic driver that reads ME Host
Firmware Status registers from PCI configuration space without mapping the messaging BAR.

Select the HFS register count per device generation, decode sparse
HFS1 state, mode, and error fields, and expose raw and summarized
status via sysctl. Register an ISA-side hfstsfd probe for supported
RCBA/FD2 generations so firmware-hidden HECI functions can be diagnosed.

Reviewed by:    kbowling, adrian
Differential Revision:  https://reviews.freebsd.org/D58863
DeltaFile
+564-0sys/dev/intel/hfsts.c
+237-0sys/dev/intel/hfsts_isa.c
+219-0share/man/man4/hfsts.4
+12-0sys/dev/intel/hfsts.h
+11-0sys/modules/hfsts/Makefile
+3-0sys/amd64/conf/NOTES
+1,046-03 files not shown
+1,052-09 files

FreeBSD/src 592ae60sbin/devmatch devmatch.c

devmatch(8): Preserve const qualifier on strchr(3) and strstr(3) results

Reviewed by:    fuz, dteske
Approved by:    fuz (mentor), dteske (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59667
DeltaFile
+4-3sbin/devmatch/devmatch.c
+4-31 files

FreeBSD/src d10e39dbin/ps ps.c

ps(1): Preserve const qualifier on strchr(3) result

Reviewed by:    fuz, dteske
Approved by:    fuz (mentor), dteske (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59666
DeltaFile
+2-1bin/ps/ps.c
+2-11 files

FreeBSD/src 63786b0sys/dev/cxgbe/iw_cxgbe cq.c

iw_cxgbe: Remove unused return value from destroy_cq

Part of the original Linux commit was already applied during a prior
OFED update in commit b633e08c705fe43180567eae26923d6f6f98c8d9, but
this portion of the changes to the Linux iw_cxgb4 driver were not
included.

Obtained from:  Linux commit a52c8e2469c30cf7ac453d624aed9c168b23d1af
DeltaFile
+7-8sys/dev/cxgbe/iw_cxgbe/cq.c
+7-81 files

FreeBSD/src e29dcccsys/dev/cxgbe/iw_cxgbe iw_cxgbe.h qp.c

iw_cxgbe: Fix qpid leak

Add await in destroy_qp() so that all references to qp are dereferenced
and qp is freed in destroy_qp() itself.  This ensures freeing of all QPs
before invocation of dealloc_ucontext(), which prevents loss of in use
qpids stored in the ucontext.

Obtained from:  Linux commit f70baa7ee3d1b5a9e66ac7549e31641a656f23c1
Sponsored by:   Chelsio Communications
DeltaFile
+18-32sys/dev/cxgbe/iw_cxgbe/qp.c
+2-2sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
+20-342 files

FreeBSD/src 0505738sys/dev/cxgbe/iw_cxgbe iw_cxgbe.h t4.h

iw_cxgbe: Miscellaneous changes from the iw_cxgb4 driver

These include changes to use newer APIs, cosmetic changes to reduce
diffs between the two drivers, and other minor fixes.

Sponsored by:   Chelsio Communications
Co-authored-by: Arjun V <arjun at chelsio.com>
Co-authored-by: Krishnamraju Eraparaju <krishna2 at chelsio.com>
Co-authored-by: Vishal Kulkarni <vishal at chelsio.com>
DeltaFile
+26-29sys/dev/cxgbe/iw_cxgbe/cm.c
+12-11sys/dev/cxgbe/iw_cxgbe/cq.c
+8-6sys/dev/cxgbe/iw_cxgbe/qp.c
+5-2sys/dev/cxgbe/iw_cxgbe/provider.c
+1-1sys/dev/cxgbe/iw_cxgbe/t4.h
+0-1sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
+52-506 files

FreeBSD/src 9f2a288sys/dev/cxgbe/iw_cxgbe qp.c cq.c

iw_cxgbe: Remove unneeded memset

Obtained from:  Linux commit 4c44d4634b5c90993fccca9f155347221df6f877
DeltaFile
+0-1sys/dev/cxgbe/iw_cxgbe/qp.c
+0-1sys/dev/cxgbe/iw_cxgbe/cq.c
+0-22 files

FreeBSD/src 3968a87contrib/ofed/libcxgb4 t4.h dev.c, sys/dev/cxgbe/iw_cxgbe device.c t4.h

iw_cxgbe/libcxgb4: Pass ftid_base to libcxgb4 through status page

While here, fix incorrect frees in error paths in c4iw_alloc_context().

Sponsored by:   Chelsio Communications
DeltaFile
+2-2contrib/ofed/libcxgb4/dev.c
+1-1sys/dev/cxgbe/iw_cxgbe/t4.h
+1-1contrib/ofed/libcxgb4/t4.h
+1-0sys/dev/cxgbe/iw_cxgbe/device.c
+5-44 files

FreeBSD/src a83be0bsys/dev/cxgbe/iw_cxgbe mem.c

iw_cxgbe: Do not dma memory off of the stack

Obtained from:  Linux commit 3840c5b78803b2b6cc1ff820100a74a092c40cbb
DeltaFile
+17-11sys/dev/cxgbe/iw_cxgbe/mem.c
+17-111 files

FreeBSD/src 0d63508sys/dev/cxgbe t4_main.c, sys/dev/cxgbe/common common.h

cxgbe: Enable RDMA WRITE_CMPL work requests if the firmware supports them

This work request permits combining RDMA WRITE and SEND_INV commands
into a single work request.

Sponsored by:   Chelsio Communications
DeltaFile
+5-0sys/dev/cxgbe/t4_main.c
+2-0sys/dev/cxgbe/common/common.h
+7-02 files

FreeBSD/src e03c2c0contrib/ofed/libcxgb4 qp.c

libcxgb4: remove update_qp_state()

Remove it because it is not needed. If we're flushing the qp, it is
because we've had a fatal error, so just set the user qp state to ERR
and continue on.

Sponsored by:   Chelsio Communications
DeltaFile
+1-15contrib/ofed/libcxgb4/qp.c
+1-151 files

FreeBSD/src b78f8facontrib/ofed/libcxgb4 libcxgb4.h t4.h, sys/dev/cxgbe/iw_cxgbe device.c t4.h

iw_cxgbe/libcxgb4: Support for RDMA WRITE_COMPL work requests

To optimize NVME-oF READ IOPs, use a specialized work request that
combines a RDMA WRITE and SEND_INV chain into a single request.

Sponsored by:   Chelsio Communications
Co-authored-by: Potnuri Bharat Teja <bharat at chelsio.com>
DeltaFile
+167-10contrib/ofed/libcxgb4/qp.c
+146-1sys/dev/cxgbe/iw_cxgbe/qp.c
+7-2contrib/ofed/libcxgb4/t4.h
+5-1sys/dev/cxgbe/iw_cxgbe/t4.h
+2-0sys/dev/cxgbe/iw_cxgbe/device.c
+1-0contrib/ofed/libcxgb4/libcxgb4.h
+328-141 files not shown
+329-147 files

FreeBSD/src f9076bdsys/dev/cxgbe/iw_cxgbe cq.c device.c

iw_cxgbe: Use XArray instead of IDR

Obtained from:  Linux commit 52e124c27e7bfb78980189bdfec049594d7612be
Obtained from:  Linux commit 2f43129127e62b25f56ff82a37c40b42c0e6f883
Obtained from:  Linux commit 7a268a93973c07f93e952d96c2faa88df8ed38d8
Sponsored by:   Chelsio Communications
Co-authored-by: Potnuri Bharat Teja <bharat at chelsio.com>
DeltaFile
+5-64sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
+9-8sys/dev/cxgbe/iw_cxgbe/ev.c
+8-8sys/dev/cxgbe/iw_cxgbe/mem.c
+9-7sys/dev/cxgbe/iw_cxgbe/qp.c
+6-7sys/dev/cxgbe/iw_cxgbe/device.c
+3-3sys/dev/cxgbe/iw_cxgbe/cq.c
+40-976 files

FreeBSD/src 054db35contrib/ofed/libcxgb4 cq.c qp.c, contrib/ofed/libibverbs verbs.h

libcxgb4: Support for RDMA SEND_WITH_INV requests

Sponsored by:   Chelsio Communications
DeltaFile
+27-8contrib/ofed/libcxgb4/qp.c
+22-3contrib/ofed/libcxgb4/cq.c
+4-1contrib/ofed/libibverbs/verbs.h
+53-123 files

FreeBSD/src 73151e4sys/dev/cxgbe/iw_cxgbe qp.c

iw_cxgbe: Cleanups to ucontext handling when creating queues

Obtained from:  Linux commit e00b64f7c54c4cbd88143bbd43e7c3d61a090e5c
Obtained from:  Linux commit 89944450547334aa6655e0cd4aec8df1897a205a
DeltaFile
+2-3sys/dev/cxgbe/iw_cxgbe/qp.c
+2-31 files

FreeBSD/src deb465asys/dev/cxgbe/iw_cxgbe provider.c

iw_cxgbe: Add ib_device->get_netdev support

Obtained from:  Linux commit f215a3d2448ae77253f0b93dcc37114779f51778
DeltaFile
+20-0sys/dev/cxgbe/iw_cxgbe/provider.c
+20-01 files

FreeBSD/src 96d9a91sys/dev/cxgbe/iw_cxgbe t4.h

iw_cxgbe: use __raw_write*() to allow write-combining

pio_copy() is suppose to be used for write-combining work requests.
However, for some architectures like powerpc and arm64, write[ql]()
include an explicit memory barrier which will flush the WC buffer and
render this path useless. To prevent that use the relaxed variant.

Sponsored by:   Chelsio Communications
DeltaFile
+5-7sys/dev/cxgbe/iw_cxgbe/t4.h
+5-71 files

FreeBSD/src c1325c5sys/dev/cxgbe/iw_cxgbe mem.c

iw_cxgbe: Use correct sizing on buffers holding page DMA addresses

Obtained from:  Linux commit 5f818d676ac455bbc812ffaaf5bf780be5465114
DeltaFile
+1-1sys/dev/cxgbe/iw_cxgbe/mem.c
+1-11 files

FreeBSD/src 6ee16b9sys/dev/cxgbe/iw_cxgbe cm.c device.c

iw_cxgbe: Various fixes around waiting for replies to work requests

Allocate wait objects dynamically and add a refcount instead of
allocating them on the current thread's stack.  This permits
c4iw_wait_for_reply() to safely fail with an error and mark the device
as dead if a reply is not received after C4IW_WR_TO seconds.  Once a
device is marked dead, future requests fail immediately.

Sponsored by:   Chelsio Communications
DeltaFile
+139-81sys/dev/cxgbe/iw_cxgbe/mem.c
+76-42sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
+36-30sys/dev/cxgbe/iw_cxgbe/qp.c
+34-31sys/dev/cxgbe/iw_cxgbe/cq.c
+21-0sys/dev/cxgbe/iw_cxgbe/device.c
+9-3sys/dev/cxgbe/iw_cxgbe/cm.c
+315-1876 files

FreeBSD/src 6262cbecontrib/ofed/libcxgb4 t4.h cq.c

libcxgb4: Support send/recv drain work requests

This change allows libcxgb4 to post send/recv drain work requests
after a QP is flushed and schedules a CQE on the software CQ for the
application to note the drain's completion.

Sponsored by:   Chelsio Communications
DeltaFile
+126-6contrib/ofed/libcxgb4/qp.c
+15-0contrib/ofed/libcxgb4/cq.c
+14-0contrib/ofed/libcxgb4/t4.h
+155-63 files

FreeBSD/src f08d90esys/dev/cxgbe/iw_cxgbe iw_cxgbe.h t4.h

iw_cxgbe: Fixes around work queue flushing and draining

- Only insert drain CQEs if a work queue is flushed

- Preserve the request opcode of the original request when flushing a
  request.  Use bit 10 of the CQE header word to indicate the CQE is a
  special drain completion, and save the original WR opcode in the cqe
  header opcode field.

- If a work request chain was posted and needed to be flushed, only
  the first request in the chain was completed with FLUSHED status.
  The rest were never completed.

- When a CQ is shared by multiple QPs, c4iw_flush_hw_cq() needs to
  acquire the corresponding QP lock before moving the CQEs into its
  corresponding SW queue and accessing the SQ contents for completing
  a WR.

- Once a user QP has been flushed, it cannot be flushed again.

    [3 lines not shown]
DeltaFile
+90-9sys/dev/cxgbe/iw_cxgbe/qp.c
+16-6sys/dev/cxgbe/iw_cxgbe/cq.c
+6-0sys/dev/cxgbe/iw_cxgbe/t4.h
+1-3sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
+113-184 files

FreeBSD/src 6c858dacontrib/ofed/libcxgb4 cq.c t4.h, sys/dev/cxgbe/iw_cxgbe t4.h qp.c

iw_cxgbe/libcxgb4: Support for RDMA WRITE_WITH_IMMEDIATE requests

Sponsored by:   Chelsio Communications
DeltaFile
+22-3sys/dev/cxgbe/iw_cxgbe/cq.c
+13-1sys/dev/cxgbe/iw_cxgbe/qp.c
+11-1contrib/ofed/libcxgb4/qp.c
+9-2contrib/ofed/libcxgb4/t4.h
+8-1contrib/ofed/libcxgb4/cq.c
+7-1sys/dev/cxgbe/iw_cxgbe/t4.h
+70-93 files not shown
+78-109 files

FreeBSD/src c957af2contrib/ofed/libcxgb4 cxgb4-abi.h t4.h, sys/dev/cxgbe/iw_cxgbe cq.c user.h

iw_cxgbe/libcxgb4: Support 64B CQEs

The larger CQE exports the RSS header to userspace.  Note that this
changes the ABI between the driver and library, so the ABI version is
bumped.  A new user->kernel create_cq request message is defined to
disallow a CQE size mismatch between iw_cxgbe and libcxgb4.

Sponsored by:   Chelsio Communications
Co-authored-by: Steve Wise <swise at opengridcomputing.com>
DeltaFile
+10-2contrib/ofed/libcxgb4/verbs.c
+6-1sys/dev/cxgbe/iw_cxgbe/t4.h
+4-2contrib/ofed/libcxgb4/t4.h
+5-1sys/dev/cxgbe/iw_cxgbe/user.h
+2-3sys/dev/cxgbe/iw_cxgbe/cq.c
+5-0contrib/ofed/libcxgb4/cxgb4-abi.h
+32-92 files not shown
+34-108 files

FreeBSD/src 2a580b3sys/dev/cxgbe t4_main.c, sys/dev/cxgbe/common common.h

cxgbe: Query the ability to use RDMA WRITE_WITH_IMMEDIATE requests

Sponsored by:   Chelsio Communications
DeltaFile
+5-0sys/dev/cxgbe/t4_main.c
+1-0sys/dev/cxgbe/common/common.h
+6-02 files

FreeBSD/src 99ed975sys/riscv/riscv swtch.S

riscv: Preserve savectx return address with vector support

Calling vector_state_store_savectx() overwrites ra with the address of
the following ret instruction.  The ret consequently branches to itself
and prevents kernel dumps from progressing past dump_savectx().

Tail-call vector_state_store_savectx() so that it returns directly to
the original savectx() caller.

Reviewed by:    br, jrtc27
Approved by:    jrtc27
Fixes:          d7a393095cfd ("riscv: Vector Extension (RVV) support.")
Sponsored by:   FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59689
DeltaFile
+1-2sys/riscv/riscv/swtch.S
+1-21 files

FreeBSD/src 4505445usr.sbin/bhyve tpm_intf_crb.c

bhyve: tpm: allow the last dword of the CRB command buffer

The bounds check rejected any access ending exactly at the end of the
register block, so a four byte write at offset 0xffc was refused,
returning EINVAL and killing the VM.

MFC after:      1 week
PR:             291063
Fixes:          75909086a45d ("bhyve: allow read/write to full CRB buffer")
Sponsored by:   Defenso

Signed-off-by: Quentin Thébault <quentin.thebault at defenso.fr>
Reviewed-by: aokblast, kevans, markj
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2362
DeltaFile
+1-1usr.sbin/bhyve/tpm_intf_crb.c
+1-11 files

FreeBSD/src 602d1b9sys/dev/ntb/test ntb_tool.c

ntb_tool: Bound memory window option strings

parse_mw_buf() copies option names from privileged sysctl input into
eight-byte stack buffers.  Unbounded %s conversions permit option tokens
longer than seven bytes to write past those buffers before the parser
validates them.

Limit each conversion to seven characters, leaving space for the
terminating NUL.

Signed-off-by: Yudi Yang <yudi.yang at rice.edu>

Fixes:          96f556f5044a ("NTB Tool: Test driver for NTB hardware drivers.")
Reviewed by:    markj
MFC after:      1 week
DeltaFile
+1-1sys/dev/ntb/test/ntb_tool.c
+1-11 files

FreeBSD/src 6949235sys/dev/sound/usb uaudio.c

snd_uaudio: Read the UAC2 sample rate back after setting it

Some devices only apply a new sample rate once it has been read back,
and produce no sound at all otherwise.

PR:             294803
Reported by:    tatsuki_makino at hotmail.com
Tested by:      tatsuki_makino at hotmail.com
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D59616
DeltaFile
+22-1sys/dev/sound/usb/uaudio.c
+22-11 files

FreeBSD/src 5407f76sys/compat/linuxkpi/common/include/asm cpu_device_id.h, sys/compat/linuxkpi/common/src linux_compat.c

linuxkpi: Compile `x86_match_cpu()` on amd64 and i386 only

This fixes the build on other architectures where `struct x86_cpu_id` is
unavailable.

Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-0sys/compat/linuxkpi/common/src/linux_compat.c
+2-0sys/compat/linuxkpi/common/include/asm/cpu_device_id.h
+4-02 files