949bc17c andrew Sept. 8, 2022, 1:30 p.m.
Bring in the last version of the optimized memset from the Cortex
Strings library that didn't use the VFP registers. While here clean up
to use the ENTRY/EDIT macros.

This is imported from:

Sponsored by:	The FreeBSD Foundation
51a1bf7b andrew Sept. 8, 2022, 1:29 p.m.
Bring in a version of the Arm Optimized Routines memcpy from before
the VFP registers were used.

Imported with modification from:

Sponsored by:	The FreeBSD Foundation
8c6e5d8c andrew Sept. 8, 2022, 1:23 p.m.
These are from the Arm Optimized Routines and don't use the VFP so are
safe to use in the kernel.

Sponsored by:	The FreeBSD Foundation
01e478d9 andrew Sept. 8, 2022, 1:23 p.m.
Bring in the latest Arm Optimized Routines memcpy/memmove into the
arm64 kernel. As these functions have been merged in the current
version remove the now unneeded memmove.S.

Sponsored by:	The FreeBSD Foundation
376025cf andrew Sept. 8, 2022, 1:23 p.m.
To make way for a flag for SVE move the PCB_FP_* flags we don't export
to userspace to the upper bits.

Sponsored by:	The FreeBSD Foundation
6ad780ca sobomax Sept. 8, 2022, 11:22 a.m.
need to do synchronization by hand when termcap is updated.

Reviewed by:	uqs, bapt, imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36333
e7624170 melifaro Sept. 8, 2022, 10:21 a.m.
MFC after:	1 month
000250be melifaro Sept. 8, 2022, 9:18 a.m.
Routing daemons such as bird need to know if they install certain route
 so they can clean it up on startup, as a form of achieving consistent
 state during the crash recovery.
Currently they use combination of routing flags (RTF_PROTO1) to detect
 these routes when interacting via route(4) rtsock protocol.
Netlink protocol has a special "rtm_protocol" field that is filled and
 checked by the route originator. To prepare for the upcoming netlink
 introduction, add ability to record origing to both nexthops and
 nexthop groups via <nhop|nhgrp>_<get|set>_origin() KPI. The actual
 calls will be used in the followup commits.

MFC after:	1 month
bab32a80 kevans Sept. 8, 2022, 5:03 a.m.
In 8db2e8fd16c4 ("Remove the secondary_stacks array in arm64 [...]"),
bootstacks was setup to be allocated dynamically.  While this is
generally how x86 does it, it inadvertently shrunk each boot stack from
KSTACK_PAGES pages to a single page.

Resize these back up to the expected size using the kstack_pages
tunable, as we'll need larger stacks with upcoming sanitizer work.

Reviewed by:	andrew, imp, markj
Fixes:	8db2e8fd16c4 ("Remove the secondary_stacks array [...]")
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D36475
d0354fa7 dougm Sept. 8, 2022, 4:46 a.m.
Change RB_INSERT_COLOR and RB_REMOVE_COLOR so that the blocks of code
that are identical except for left and right being exchanged are made
only one block with a variable to indicate left- or right-handedness.

Rename RB macros so that those not intended for external use begin
with an underscore.

Add comments to the balancing code so that another might understand it.

Reviewed by:	alc, kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D36393
6f7b1310 whu Sept. 8, 2022, 4:22 a.m.
Seems these kasserts don't work well on ARM64

Fixes:	0af5a0cd2788e
Sponsored by:	Microsoft
2c545cf3 dougm Sept. 8, 2022, 2:40 a.m.
With _RB_DIAGNOSTIC defined, provide an RB_RANK method to compute the
rank of a node in an rb-tree, if the subtree rooted at that node is
rank-balanced, and -1 otherwise.

In rb_test, rewrite a bit to avoid malloc/free and nondeterministic
running times because of randomness. Allocate all the nodes on the
stack, and shuffle a set of keys to get randomness for the testing.

Add a rank-balance check for the completed tree.

Reviewed by:	markj
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D36484
0eb736c0 grembo Sept. 8, 2022, 12:16 a.m.
This corrects an issue introduced in b4cb3fe0e39a3, where a freshly
allocated `DOS_FS` structure would not be initialized properly before
use in `dos_open`.

In case of FAT32 file systems, this would leave `fs->dirents`
uninitialized and - depending on its content and due to checks in
`parsebs` - prevent mounting the file system successfully.

This particularily impacted the EFI loader, as it was sometimes not
able to read files from a FAT32-formatted EFI partition, including
LoaderEnv (`/efi/freebsd/loader.env`).

Accepted by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36482
b3b6a959 bz Sept. 7, 2022, 11:48 p.m.
Add DLink DWA-182 rev D1 and generic Realtek RTW8821CU entry found on
a Tenda U10 USB WLAN Stick, AC 650 Mbps (and possibly more devices).
The latter first presents itself as a CD device with Windows drivers
(useless on FreeBSD) first so add a quirk for that we get the wireless
device right away.

MFC after:	2 weeks
While here sort some other Realtek entries by DeviceID.
549198b1 bz Sept. 7, 2022, 11:38 p.m.
Update the mac80211 ops KPI for (*conf_tx), (*assign_vif_chanctx),
(*unassign_vif_chanctx), (*start_ap), and (*stop_ap), as well as
ieee80211_beacon_get_tim() and ieee80211_beacon_get_template().

Update in-tree drivers iwlwifi and rtw88 accordingly based on upstream
changes (as well as out-of-tree ones).  This was triggered by trying to
synchronize more drivers to a common state.

MFC after:	1 week