FreeBSD/src ed60e57usr.sbin/bhyve bhyve_config.5 ipc.c, usr.sbin/bhyvectl Makefile bhyvectl.8

bhyvectl: support querying VM pid

Extend bhyvectl(8) to support querying VM pid using the
`--get-vm-pid` flag.

This is useful in monitor mode when the VM pid differs
from the main bhyve(8) process run by the user. Knowing the VM pid
is necessary, for example, to query process resource usage or
trigger ACPI shutdown with SIGTERM.

Of course, it could be obtained by matching the monitor process
children by the process title, but it's a little more complex
and fragile than it could be.

Implement that by adding the "get_vm_pid" IPC command,
and using it to implement `bhyvectl --get-vm-pid`, which
prints the VM PID.

When the VM PID is not known, ESRCH is returned.

    [4 lines not shown]
DeltaFile
+51-9usr.sbin/bhyvectl/bhyvectl.c
+11-0usr.sbin/bhyve/ipc.c
+6-2usr.sbin/bhyvectl/bhyvectl.8
+1-2usr.sbin/bhyvectl/Makefile
+1-1usr.sbin/bhyve/bhyve_config.5
+70-145 files

FreeBSD/src 7008192share/man/man4 dtrace_pid.4

dtrace_pid.4: Add example "Listing Program's Function Entries"

Reviewed by:    bcr
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57515
DeltaFile
+22-2share/man/man4/dtrace_pid.4
+22-21 files

FreeBSD/src 47f9e66usr.sbin/pkg pkg.c

pkg(7): Preserve const qualifier on strrchr(3) results

Reviewed by:    fuz
Approved by:    fuz (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59777
DeltaFile
+2-2usr.sbin/pkg/pkg.c
+2-21 files

FreeBSD/src cc61cc7bin/ls print.c

ls(1): Preserve const qualifier on strstr(3) result

Reviewed by:    fuz
Approved by:    fuz (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59774
DeltaFile
+2-2bin/ls/print.c
+2-21 files

FreeBSD/src 066fad8bin/ed io.c

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

Reviewed by:    fuz
Approved by:    fuz (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59773
DeltaFile
+1-1bin/ed/io.c
+1-11 files

FreeBSD/src 225612cbin/dd args.c

dd(1): Preserve const qualifier on bsearch(3) results

Reviewed by:    fuz, dteske
Approved by:    fuz (mentor), dteske (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59754
DeltaFile
+9-5bin/dd/args.c
+9-51 files

FreeBSD/src 4c6e74a. UPDATING, sys/sys param.h

UPDATING: bump __FreeBSD_version to 1501503 for LinuxKPI changes

The size of multiple embedded structs have changed and may lead to
problems (pci_error_handlers in pci_driver, dev_pm_info in struct device).
Allow these changes to be detected by bumping __FreeBSD_version.

(cherry picked from commit e1ad124136deb4f270d4cef759bf9e9debdb17d3)
DeltaFile
+6-0UPDATING
+1-1sys/sys/param.h
+7-12 files

FreeBSD/src 3ff1aeasys/compat/linuxkpi/common/include/linux pci.h

LinuxKPI: pci: add reset_{prepare,done} to pci_error_handlers

Needed by an upcoming wireless driver.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58882

(cherry picked from commit c40219c572df8b4b0c2392ee341d93bc82e6076b)
DeltaFile
+2-0sys/compat/linuxkpi/common/include/linux/pci.h
+2-01 files

FreeBSD/src 9b0e737sys/compat/linuxkpi/common/src linux_80211.c linux_80211_macops.c

LinuxKPI: 802.11: Always lock around lkpi_80211_mo_{remove_interface,stop}()

Add the missing locking to another two MO driver downcalls, as drivers
always expect it (e.g. rtw89 by assertion).

Add the lock and might_sleep assertions to the respective lkpi_80211_mo_*
downcalls.

PR:             298417
Reviewed by:    bz
Differential Revision: https://reviews.freebsd.org/D59608

(cherry picked from commit 73166d21bd831db264509cbdce1ab3b63ab5b189)
DeltaFile
+6-0sys/compat/linuxkpi/common/src/linux_80211_macops.c
+2-0sys/compat/linuxkpi/common/src/linux_80211.c
+8-02 files

FreeBSD/src 28ca279sys/compat/linuxkpi/common/include/linux pm.h, sys/compat/linuxkpi/common/src linux_compat.c

LinuxKPI: add can_wakeup option and accessor functions

We can implement device_set_wakeup_capable() in the !CONFIG_PM_SLEEP
case;  we do not have the infrastructure in place for the CONFIG_PM_SLEEP
case so leave a pr_debug TODO.

Needed by an upcoming wireless driver.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58883

(cherry picked from commit a424fb3519ebf8fb972e7ba45ba19df322992b00)
DeltaFile
+17-0sys/compat/linuxkpi/common/include/linux/pm.h
+6-0sys/compat/linuxkpi/common/src/linux_compat.c
+23-02 files

FreeBSD/src 5fd93b6sys/compat/linuxkpi/common/include/linux pci.h, sys/compat/linuxkpi/common/src linux_pci.c

LinuxKPI: add PCI_IRQ_AFFINITY #define

Add the #define for PCI_IRQ_AFFINITY and leave a pr_debug note in
pci_alloc_irq_vectors() that it is unimplemented.

The flag is needed by an upcoming WiFi driver.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58881

(cherry picked from commit b589e403a2c3bd2a94fb2ab88cd23255c68a9f05)
DeltaFile
+3-0sys/compat/linuxkpi/common/src/linux_pci.c
+1-0sys/compat/linuxkpi/common/include/linux/pci.h
+4-02 files

FreeBSD/src 67c01ebsys/compat/linuxkpi/common/include/linux pci.h

LinuxKPI: pci: add pci_select_bars() and pci_msix_vec_count()

For pci_select_bars() we use the LinuxKPI internal information, while
for pci_select_bars() we fall back to the native PCI stack.

Needed by a wifi driver.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58878

(cherry picked from commit 55c07af60172b211116be47010fc0831aafc99e8)
DeltaFile
+29-0sys/compat/linuxkpi/common/include/linux/pci.h
+29-01 files

FreeBSD/src 0b1dea8sys/compat/linuxkpi/common/include/linux dma-mapping.h, sys/compat/linuxkpi/common/src linux_pci.c

LinuxKPI: implement dma_{alloc,free}_{noncoherent,attrs}

We use one to implement the other given direction stays unused.

This is needed by an upcoming wifi driver.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58880

(cherry picked from commit c3fa17a6a331db8aad03e9cb89ba97e1811ab381)
DeltaFile
+50-0sys/compat/linuxkpi/common/src/linux_pci.c
+36-0sys/compat/linuxkpi/common/include/linux/dma-mapping.h
+86-02 files

FreeBSD/src e44083csys/compat/linuxkpi/common/include/linux types.h

LinuxKPI: add typedef for clockid_t

Needed by a wireless driver (not really using it) to compile.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58877

(cherry picked from commit 401d0922a4bfcf40d3ae1866a0d90f955264def0)
DeltaFile
+2-0sys/compat/linuxkpi/common/include/linux/types.h
+2-01 files

FreeBSD/src 4909288sys/compat/linuxkpi/common/include/linux interrupt.h pci.h, sys/compat/linuxkpi/common/src linux_pci.c

LinuxKPI: fix argument type to lkpi_pci_msi_desc_alloc()

lkpi_pci_msi_desc_alloc() takes an unsigned int, not an int.
While here make sure the prototype is visibile in interrupt.h as
well before use to avoid -Wimplicit-function-declaration errors.

Discovered while working on a wireless driver.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58879

(cherry picked from commit cfb23b01e269e8a0a84066637b82b746f01b46b4)
DeltaFile
+2-1sys/compat/linuxkpi/common/include/linux/pci.h
+1-1sys/compat/linuxkpi/common/src/linux_pci.c
+1-0sys/compat/linuxkpi/common/include/linux/interrupt.h
+4-23 files

FreeBSD/src c1a87absys/compat/linuxkpi/common/include/linux rculist.h

LinuxKPI: rcu: add optional condition to list_for_each_entry_rcu()

list_for_each_entry_rcu() can take an optional condition.  Add the
macro argument so code remains compiling but do not do anything with
it just yet.

Leave comments as list_for_each_entry_rcu() likely should have a
different implementation.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D59292

(cherry picked from commit e975ce86ff11a330128f5b21c7cd11c28d3aff87)
DeltaFile
+4-2sys/compat/linuxkpi/common/include/linux/rculist.h
+4-21 files

FreeBSD/src 6aef530sys/dev/mlx5/mlx5_core mlx5_health.c

mlx5: remove init_timer()

The init_timer() was there from day one in (dc7e38ac4da50).  It was
never needed as the setup_timer() below already did more than just
that part of the job.
This is part of trying to clear up the Linux pre-4.15 timer KPI
from LinuxKPI.

Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D59681

(cherry picked from commit 3769ee9bc4167d4f508ba4f14cf544dedf7c520e)
DeltaFile
+0-1sys/dev/mlx5/mlx5_core/mlx5_health.c
+0-11 files

FreeBSD/src e03abecsys/dev/mlx4/mlx4_en en.h mlx4_en_cq.c

mlx4: convert to timer_setup() Linux KPI

The Linux driver switched away from using this timer in e22979d96a55d.
Locally adjust the code to use timer_setup/from_timer in order to get
us out of Linux version 4.15 (and earlier) KPIs.
Also, right away, apply 41cb08555c416 from_timer -> timer_container_of.

Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D59680

(cherry picked from commit 871c09c9b47eb0ef0f17a5a1fc2299dba7693516)
DeltaFile
+1-3sys/dev/mlx4/mlx4_en/mlx4_en_cq.c
+2-2sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
+1-1sys/dev/mlx4/mlx4_en/en.h
+4-63 files

FreeBSD/src a8420c2sys/compat/linuxkpi/common/include/linux ethtool.h

LinuxKPI: add #include of rculist.h to ethtool.h for Linux conformance

Add #include rculist.h to ethtool.h to fullfill expectations of
Linux drivers without having to modify them.

Reviewed by:    dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D58874

(cherry picked from commit 4570a1bf760a3cd63eb7dd9e3ebbc3cf103bda4d)
DeltaFile
+2-1sys/compat/linuxkpi/common/include/linux/ethtool.h
+2-11 files

FreeBSD/src d7eb529sys/dev/mlx4/mlx4_core mlx4_catas.c

mlx4: apply upstream changes to convert to timer_setup() Linux KPI

Apply Linux change 55c0fcc3de460 "Convert timers to use timer_setup()"
to get us out of Linux version 4.15 (and earlier) KPIs.
Also apply 41cb08555c416 from_timer -> timer_container_of.

Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D59679

(cherry picked from commit 272138c279dd1954f3fb88d9e0b2874db74597a3)
DeltaFile
+4-6sys/dev/mlx4/mlx4_core/mlx4_catas.c
+4-61 files

FreeBSD/src bf0e735sys/dev/mthca mthca_catas.c

mthca: apply upstream changes to convert to timer_setup() LinuxKPI

Apply upstream changes b9eaf18722221 init_timer() -> setup_timer(),
and 86cb30ec07cdc7 setup_timer() -> timer_setup() to get us out of
Linux version 4.15 (and earlier) KPIs.
Also apply 41cb08555c416 from_timer -> timer_container_of.

Reviewed by:    jhb, emaste
Differential Revision: https://reviews.freebsd.org/D59677

(cherry picked from commit 9d467dfa31922b3b2fbb145f202200bf66ca550a)
DeltaFile
+3-5sys/dev/mthca/mthca_catas.c
+3-51 files

FreeBSD/src 4680109sys/arm/mv mv_cp110_icu.c

ARMADA 8040: Adapt ICU driver to updated device tree.
DeltaFile
+2-2sys/arm/mv/mv_cp110_icu.c
+2-21 files

FreeBSD/src 8c20260usr.sbin/bhyveload bhyveload.c

bhyveload: do not hang on EOF from console input

Currently, when bhyveload(8) fails to boot the guest,
it drops into the loader prompt waiting for user input.

This behaviour is inconvenient when using bhyveload(8) from
scripts.

Make it exit when it receives EOF from console input.

PR:             286289
Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59226
DeltaFile
+5-1usr.sbin/bhyveload/bhyveload.c
+5-11 files

FreeBSD/src 11df1d9. UPDATING, usr.sbin/bhyve pci_nvme.c

bhyve: fix byte order for manually set NVMe eui64

Manually specified eui64 value gets converted to big endian twice:
first using htobe64() and then using be64enc(). On little-endian hosts
that results in a little-endian value instead of a big-endian.

Fix by removing htobe64() for a user submitted value.

Fixes:          409a80e5a434 ("bhyve: Create EUI64 for NVMe namespaces")
Reviewed by:    chuck
Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
MFC after:      3 weeks
Differential Revision:  https://reviews.freebsd.org/D59080

(cherry picked from commit 8bd30a72e7012126a1c8d52b3ba32f844a88f8dc)
DeltaFile
+10-0UPDATING
+1-1usr.sbin/bhyve/pci_nvme.c
+11-12 files

FreeBSD/src b4a465eusr.sbin/sysconf sysconf-sysctl.8 sysconf-src.8

sysconf: Remove visual line-break after .Dd in man-pages (ziaee)

Reviewed by:    ziaee, kfv
Differential Revision:  https://reviews.freebsd.org/D59746
DeltaFile
+0-1usr.sbin/sysconf/sysconf-sysctl.8
+0-1usr.sbin/sysconf/sysconf-src.8
+0-1usr.sbin/sysconf/sysconf-rc.8
+0-1usr.sbin/sysconf/sysconf-make.8
+0-1usr.sbin/sysconf/sysconf-loader.8
+0-1usr.sbin/sysconf/sysconf-generic.8
+0-62 files not shown
+0-88 files

FreeBSD/src a53aee1. RELNOTES

RELNOTES: Add an entry for sysconf(8) and libbsdconf(3)

Reviewed by:    ziaee, kfv
Differential Revision:  https://reviews.freebsd.org/D59747
DeltaFile
+6-0RELNOTES
+6-01 files

FreeBSD/src b87b15dsys/rpc clntrdma.h

clntrdma.h: Add a field to rpcrdma_xprt

Add a maxsegs field to rpcrdma_xprt, which is used to set
the number of segments allowed for a chunk based on device
attributes.

This commit should not affect non-RDMA behaviour.

MFC after:      3 months
Fixes:  884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
DeltaFile
+1-0sys/rpc/clntrdma.h
+1-01 files

FreeBSD/src ef98d08sys/rpc clnt_bck.c

clnt_bck.c: Fix the "glue" for the nfsrdma.ko module

Without this patch, the code failed to acquire the error
return for clnt_bck_rdma_send() and could use "error" uninitialized.

No semantics change for non-RDMA NFS service.

MFC after:      3 months
Fixes:  7144a1d58c5c ("nfsd: Add glue for the nfsrdma.ko module")
DeltaFile
+2-1sys/rpc/clnt_bck.c
+2-11 files

FreeBSD/src 62c80d7sys/dev/bnxt/bnxt_en if_bnxt.c

bnxt: Initialize RSS with the common key

Use rss_getkey() for the initial VNIC key instead of generating a
per-attachment private key.  Preserve the writable rss_key sysctl,
its override lifetime, the hardware DMA representation, and all hash
and indirection settings.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59795
DeltaFile
+4-1sys/dev/bnxt/bnxt_en/if_bnxt.c
+4-11 files

FreeBSD/src 9d48fd4sys/dev/qlnx/qlnxe ecore_vf.h ecore_vf.c

qlnx: Report the programmed RSS key and hash types

Implement SIOCGIFRSSKEY and SIOCGIFRSSHASH for qlnxe and qlnxev using
the cached vport RSS configuration.  This lets hn(4) synchronize its
synthetic RSS configuration with the VF without assuming that every
driver programs all of the common RSS hash selections.

Serialize the queries with the device lock and reject them while the
interface is not running.  Convert the firmware request's key words back
into network byte order and translate the six representable IPv4/IPv6
TCP/UDP hash selections.  Report no hashing when RSS is disabled, including
the driver's single-queue configuration.

For VFs, require a successful RSS extension response from every hardware
function.  The overall vport-update reply can succeed while its RSS TLV
is missing or rejected; recording that result prevents reporting an
unconfirmed configuration.  Invalidate the confirmation before each RSS
request.  Leave existing vport-update return semantics, queue setup, and
the receive datapath unchanged.

    [5 lines not shown]
DeltaFile
+84-0sys/dev/qlnx/qlnxe/qlnx_os.c
+5-0sys/dev/qlnx/qlnxe/ecore_vf.c
+3-0sys/dev/qlnx/qlnxe/ecore_vf.h
+92-03 files