FreeBSD/src eb3dbf2sys/netinet6 in6.h

in6.h: expose s6_addr* definitions to user level

The only element of of in6_addr that is specified in RFC 3493 or
in POSIX.1-2017 is s6_addr, implemented via a #define to a union
member.  However, FreeBSD and other BSD systems have additional
definitions for the other union members, s6_addr{8,16,32} which
are defined for the kernel and loader.  Some Linux applications
also use them, and they seem to be allowed by the RFC and POSIX.
Remove the current ifdefs, exposing the additional fields to user
level, and replace with #if __BSD_VISIBLE.  Add an explanatory
comment expanding on the previous "nonstandard" comment.

MFC after:      1 week
Reviewed by:    bz
Differential Revision:  https://reviews.freebsd.org/D44979
DeltaFile
+7-1sys/netinet6/in6.h
+7-11 files

FreeBSD/src 19e3355sys/kern kern_kthread.c

kthread: Set *tdptr earlier in kproc_kthread_add()

See commit ae77041e0714 ("kthread: Set *newtdp earlier in
kthread_add1()") for details.  That commit was incomplete since
g_init()'s first call to kproc_kthread_add() will cause
kproc_kthread_add() to take the `*procptr == NULL` branch, which avoids
kthread_create().

To ensure that the thread pointer is initialized before the thread
starts running, we have to start the kernel process with RFSTOPPED.
We could perhaps go further and use RFSTOPPED only when tdptr != NULL,
but it's probably better to have consistent behaviour.

Reviewed by:    olce, kib
Reported by:    syzbot+e91e798f3c088215ace6 at syzkaller.appspotmail.com
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D44927

(cherry picked from commit d66399326cb4f89d1565fb62c1c07974886893c5)
DeltaFile
+9-1sys/kern/kern_kthread.c
+9-11 files

FreeBSD/src 4ee7b8esys/dev/dpaa if_dtsec_rm.c

dpaa: uma_zcreate() does not fail

No functional change intended.

MFC after:      1 week

(cherry picked from commit 964064937ea04519bd400668dc1ce38848d50901)
DeltaFile
+0-4sys/dev/dpaa/if_dtsec_rm.c
+0-41 files

FreeBSD/src b6a2ce7sys/fs/udf udf_vfsops.c

udf: uma_zcreate() does not fail

While here remove an old comment regarding preallocation; it appears to
refer to an optimization that is almost certainly irrelevant at this
point.

No functional change intended.

MFC after:      1 week

(cherry picked from commit 78c51db3c4927db2437ec616b33ba1faf73f08ee)
DeltaFile
+0-11sys/fs/udf/udf_vfsops.c
+0-111 files

FreeBSD/src bff26fesys/dev/wg if_wg.c wg_cookie.c

wg: uma_zcreate() does not fail

No functional change intended.

MFC after:      1 week

(cherry picked from commit b6a0ed7c78dd45937e404706620467bef61c308d)
DeltaFile
+3-3sys/dev/wg/if_wg.c
+2-3sys/dev/wg/wg_cookie.c
+5-62 files

FreeBSD/src 7a8b490sys/kern subr_busdma_bufalloc.c

busdma: uma_zcreate() does not fail

No functional change intended.

MFC after:      1 week

(cherry picked from commit 8ef2c021822f59a334e3926e8505c8a8e8a3475f)
DeltaFile
+0-4sys/kern/subr_busdma_bufalloc.c
+0-41 files

FreeBSD/src fa1d1e8sys/kern kern_khelp.c

khelp: uma_zcreate() does not fail

No functional change intended.

MFC after:      1 week

(cherry picked from commit 1e607a0753ff93847926a46003fe74087426b580)
DeltaFile
+0-4sys/kern/kern_khelp.c
+0-41 files

FreeBSD/src eee88eflib/libc/net sctp_recvmsg.3

sctp: document sctp_recvmsg as implemented

PR:             275990
MFC after:      3 days
DeltaFile
+3-3lib/libc/net/sctp_recvmsg.3
+3-31 files

FreeBSD/src 3f59eb3lib/libulog ulog_login.c

libulog: Make sure ut_line, ut_user, ut_host are terminated.

MFC after:      3 days
Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D45004

(cherry picked from commit c28253ecde333c9908b7160664805acc3a92e2b0)
DeltaFile
+3-3lib/libulog/ulog_login.c
+3-31 files

FreeBSD/src 2bdfc29lib/libulog ulog_login.c

libulog: Make sure ut_line, ut_user, ut_host are terminated.

MFC after:      3 days
Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D45004

(cherry picked from commit c28253ecde333c9908b7160664805acc3a92e2b0)
DeltaFile
+3-3lib/libulog/ulog_login.c
+3-31 files

FreeBSD/src 986ccedlibexec/tftpd tftpd.c tftp-utils.c, libexec/tftpd/tests functional.c

tftpd: Use `size_t` where appropriate.

* Limit the use of `ssize_t` to only where it's needed.
* Correct one case of `int` being used for a length.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D44954

(cherry picked from commit 1ed44fcc44b2c04db330663589541608135402f4)

tftpd: Clean up the tests.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D44955


    [38 lines not shown]
DeltaFile
+212-140libexec/tftpd/tests/functional.c
+18-12libexec/tftpd/tftpd.c
+2-2libexec/tftpd/tftp-utils.c
+1-1libexec/tftpd/tftp-utils.h
+233-1554 files

FreeBSD/src c3a3b23sys/arm64/arm64 efirt_machdep.c minidump_machdep.c, sys/arm64/include vmparam.h

arm64: Check DMAP address is valid in PHYS_IN_DMAP

When checking if a physical address is in the DMAP region we assume
all physical addresses between DMAP_MIN_PHYSADDR and DMAP_MAX_PHYSADDR
are able to be accesses through the DMAP. It may be the case that
there is device memory in this range that shouldn't be accessed through
the DMAP mappings.

Add a check to PHYS_IN_DMAP that the translated virtual address is a
valid kernel address. To support code that already checks the address
is valid add PHYS_IN_DMAP_RANGE.

PR:             278233
Reviewed by:    alc, markj
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D44677

(cherry picked from commit 9d40492efa467095340cf3dca5860880aa441472)
DeltaFile
+15-3sys/arm64/include/vmparam.h
+2-7sys/arm64/arm64/efirt_machdep.c
+4-3sys/arm64/arm64/minidump_machdep.c
+1-1sys/arm64/arm64/machdep.c
+22-144 files

FreeBSD/src 93b11felibexec/rc/rc.d nuageinit

nuageinit: start the script after zfs

It prevents the home directory for the new users to be hidden
by late mount of the home directory

(cherry picked from commit b6a4776008519bb4a1d5abfe63c46d5f009ce102)
DeltaFile
+1-1libexec/rc/rc.d/nuageinit
+1-11 files

FreeBSD/src f8575d4sys/rpc clnt_vc.c

krpc: Ref cnt the client structures for TLS upcalls

A crash occurred during testing, where the client structures had
already been free'd when the upcall thread tried to lock them.

This patch acquires a reference count on both of the structures
and these are released when the upcall is done, so that the
structures cannot be free'd prematurely.  This happened because
the testing is done over a very slow vpn.

Found during a IETF bakeathon testing event this week.

(cherry picked from commit 4ba444de708bada46a88ecac17b2f6c1dc912234)
DeltaFile
+8-2sys/rpc/clnt_vc.c
+8-21 files

FreeBSD/src f6b902asys/rpc clnt_vc.c

krpc: Ref cnt the client structures for TLS upcalls

A crash occurred during testing, where the client structures had
already been free'd when the upcall thread tried to lock them.

This patch acquires a reference count on both of the structures
and these are released when the upcall is done, so that the
structures cannot be free'd prematurely.  This happened because
the testing is done over a very slow vpn.

Found during a IETF bakeathon testing event this week.

(cherry picked from commit 4ba444de708bada46a88ecac17b2f6c1dc912234)
DeltaFile
+8-2sys/rpc/clnt_vc.c
+8-21 files

FreeBSD/src b07689dshare/man/man8 beinstall.8, tools/build beinstall.sh

beinstall: retire mergemaster support

Mergemaster has been deprecated for some time, and will be retired.

Reviewed by:    kevans
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D41799
DeltaFile
+3-12share/man/man8/beinstall.8
+1-14tools/build/beinstall.sh
+4-262 files

FreeBSD/src 98c8caalib/libgcc_s Symbol.map

libgcc_s: 80-bit long double function are x86-only

Don't try to expose them on other architectures.

Reviewed by:    arichardson
Differential Revision:  https://reviews.freebsd.org/D45028
DeltaFile
+13-9lib/libgcc_s/Symbol.map
+13-91 files

FreeBSD/src ecaab0fsys/x86/acpica madt.c, sys/x86/conf NOTES

guestrpc module to handle VMware backdoor port GuestRPC functionality

Convert existing FreeBSD vmware_hvcall function to take a channel
and parameter arguments.

Added vmware_guestrpc_cmd() to send GuestRPC commands to the VMware
hypervisor. The sbuf argument is used for both the command to send
and to store the data to return to the caller.

The following KPIs can be used to get and set FreeBSD-specific guest
information in key/value pairs:
 * vmware_guestrpc_set_guestinfo
   - set a value into the guestinfo.fbsd.<keyword> key
 * vmware_guestrpc_get_guestinfo
   - get the value stored in the guestinfo.fbsd.<keyword> key

Add VMware devices to x86 NOTES

Reviewed by:    jhb

    [2 lines not shown]
DeltaFile
+337-0sys/x86/x86/vmware_guestrpc.c
+37-0sys/x86/include/vmware_guestrpc.h
+6-2sys/x86/include/vmware.h
+5-0sys/x86/conf/NOTES
+2-1sys/x86/x86/identcpu.c
+2-1sys/x86/acpica/madt.c
+389-42 files not shown
+391-58 files

FreeBSD/src 63b7478share/man/man7 hier.7

hier.7: polish entry to system manual

Entries reworded to improve grammar or add keywords:
- document description: substitute layout for index for first-glance
- /etc/freebsd/update.conf
- /usr/share/vi/

Entries that have been wordshuffled for brevity or consistency:
- /{bin,libexec,nonexistent,sbin,tmp}/
- /boot/dtb/overlays/
- /boot/{defaults,efi,kernel,lua}/
- /usr/libexec/
- /var/{db,games,lib,log/{bsdisks.log,spool/,tmp/}}
- /usr/share/sysroot/VERSION/MACHINE.MACHINE_ARCH/ (unfold a little)
- /usr/local/share/doc/freebsd/ (unfold a little)

Entries that have macro or linking adjustments:
- /{boot,boot/efi,dev,etc,home,sbin,usr/bin}/ (overview or intro pages)
- /media/ (bsdisks is from ports, but afaik pulled by every desktop)

    [23 lines not shown]
DeltaFile
+123-84share/man/man7/hier.7
+123-841 files

FreeBSD/src a7a6873. ObsoleteFiles.inc, etc/mtree BSD.usr.dist

BSD.usr.dist: remove empty /usr/libdata/gcc directory

I am unsure of its exact historical usage, but, we no longer ship GCC
with FreeBSD, and it should have been removed.

Reviewed by:    imp, emaste
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D44440

(cherry picked from commit cc1268a926772900a08c61fd791bb66df1e6c30c)
DeltaFile
+1-3share/man/man7/hier.7
+3-0ObsoleteFiles.inc
+0-2etc/mtree/BSD.usr.dist
+4-53 files

FreeBSD/src 3d50905share/man/man7 hier.7

hier.7: various improvements

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/831

(cherry picked from commit 03ee09148950c9ea99987bfee8a769473079745b)
(cherry picked from commit 94dedfdfa96baef02e4ad661512a267ae5647d7b)
(cherry picked from commit a5b07274fcaf71fc9c14947a75fbe0a13d381a79)
(cherry picked from commit f19875b66bf403ed5c57f82bbe2a3f42475d0a06)
DeltaFile
+417-97share/man/man7/hier.7
+417-971 files

FreeBSD/src 1d921beshare/man/man9 ieee80211_vap.9

ieee80211_vap(9): fix the title

MFC after:      3 days

(cherry picked from commit c5989febcc00be41e05b4b714bbfc6ea1359abaf)
DeltaFile
+1-1share/man/man9/ieee80211_vap.9
+1-11 files

FreeBSD/src f4b0809release Makefile.mirrors

release: Stage non-UFS images in vm-images-stage

When the VM image building code was updated to support building
non-UFS images, the vm-images-stage target was not updated to
install those newly built images to the FTP site.  As a result, we
have been sending weekly snapshot announcements since August claiming
that ZFS VM images are available when they are not in fact present
anywhere publicly accessible.

Fixes:  32ae9a6b3937 "release: Build UFS and ZFS VM images"
Reported by:    Michael Dexter
MFC after:      5 days
DeltaFile
+14-0release/Makefile.mirrors
+14-01 files

FreeBSD/src 793556eshare/examples/modules Makefile

Fix up a mistake in the CFLAGS added.  Pointed out by jrtc.
DeltaFile
+1-1share/examples/modules/Makefile
+1-11 files

FreeBSD/src e60ca52share/examples/modules Makefile

Out of tree modules should be built with DTrace by default.
DeltaFile
+2-0share/examples/modules/Makefile
+2-01 files

FreeBSD/src c100fe0share/examples Makefile

examples: Install bhyve files on arm64

Sponsored by:   Innovate UK
DeltaFile
+1-1share/examples/Makefile
+1-11 files

FreeBSD/src e10b9d6usr.sbin/bhyve uart_backend.c uart_pl011.c

bhyve: Move lock of uart frontend to uart backend

Currently, lock of uart in bhyve is placed in frontend. There are some
problems about it:

1. If every frontend should has a lock, why not move it inside backend
   as they all have same uart_softc.
2. If backend needs to modify the information of uart after initialize,
   it will be impossible as backend cannot use lock. For example, if we
   want implement a telnet support for uart in backend, It should wait
   for connection when initialize. After some remote process connect it,
   it needs to modify rfd and wfd in backend.

So I decide to move it to backend.

Reviewed by:    corvink, jhb, markj
Differential Revision:  https://reviews.freebsd.org/D44947
DeltaFile
+21-1usr.sbin/bhyve/uart_backend.c
+6-10usr.sbin/bhyve/uart_pl011.c
+6-9usr.sbin/bhyve/uart_emul.c
+2-1usr.sbin/bhyve/uart_backend.h
+35-214 files

FreeBSD/src aa34b1dshare/examples/bhyve vmrun.sh

vmrun.sh: Add arm64 support

For now, we enumerate disk devices before network devices.  This is to
work around a problem wherein u-boot remaps BARs during boot in a way
that bhyve does not handle.  Some discussion and experiments suggest
that this can be handled by having bhyve not map BARs during boot on
arm64; until a solution is implemented, however, this workaround is
sufficient for simple usage and doesn't have any real downsides.

The console and bootrom are specified slightly differently versus amd64,
and a few of vmrun.sh's command-line options are amd64-only.

Reviewed by:    corvink, jhb
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D44933
DeltaFile
+71-29share/examples/bhyve/vmrun.sh
+71-291 files

FreeBSD/src c1b37d9usr.sbin Makefile.aarch64, usr.sbin/bhyvectl/aarch64 bhyvectl_machdep.c Makefile.inc

bhyvectl: Add arm64 bits and hook it up to the build

For now this implementation doesn't provide any machine dependent
functionality on arm64, but it's enough to be able to reset and destroy
VMs.

Reviewed by:    jhb
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D44932
DeltaFile
+82-0usr.sbin/bhyvectl/aarch64/bhyvectl_machdep.c
+1-0usr.sbin/bhyvectl/aarch64/Makefile.inc
+1-0usr.sbin/Makefile.aarch64
+84-03 files

FreeBSD/src 1c4ee7dusr.sbin/bhyvectl bhyvectl.c bhyvectl.h, usr.sbin/bhyvectl/amd64 bhyvectl_machdep.c Makefile.inc

bhyvectl: Prepare to add arm64 support

Move MD code into a separate directory and add a simple interface which
lets the MD bits register options and handle them.

No functional change intended.

Reviewed by:    jhb
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D44932
DeltaFile
+1,888-0usr.sbin/bhyvectl/amd64/bhyvectl_machdep.c
+31-1,807usr.sbin/bhyvectl/bhyvectl.c
+53-0usr.sbin/bhyvectl/bhyvectl.h
+5-4usr.sbin/bhyvectl/Makefile
+1-0usr.sbin/bhyvectl/amd64/Makefile.inc
+1,978-1,8115 files