r365948 dab Sept. 21, 2020, 3:45 p.m.
nvmecontrol tries to upload firmware in chunks as large as it thinks
the device permits. It fails to take into account the FWUG value used
by some drives to advertise the size and alignment limits for firmware

  - Use the firwmare update granularity value from the
  - If the granularity is not reported or not restricted, fall back to
    the previously existing logic that calculates the max transfer
    size based on MDTS.
  - Add firmware update granularity to the identify-controller output.

Reviewed by:	imp (previous version), chuck
Obtained from:	Dell EMC Isilon
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26390
r365947 mhorne Sept. 21, 2020, 3:44 p.m.
A small example of how these functions can be used to simplify checks of
this nature.

Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26271
r365946 dab Sept. 21, 2020, 3:41 p.m.
Reviewed by:	imp, chuck
Obtained from:	Dell EMC Isilon
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26390
r365945 mhorne Sept. 21, 2020, 3:24 p.m.
This adds the getenv_bool() function, to parse a boolean value from a
kernel environment variable or tunable. This works for traditional
boolean values like "0" and "1", and also "true" and "false"
(case-insensitive). These semantics do not yet apply to sysctls declared
using SYSCTL_BOOL with CTLFLAG_TUN (they still only parse 1 and 0).

Also added are two wrapper functions, getenv_is_true() and
getenv_is_false(). These are slightly simpler for callers wishing to
perform a single check of a configuration variable.

Reviewed by:	jhb (slightly earlier version)
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26270
r365943 avg Sept. 21, 2020, 10:02 a.m.
OTG mode is not supported still.  It's easy to do it as a one-off
detection, but the proper support requires continuous monitoring and
communicating the current state to the USB layer.

Also, fix phy0_route setting for H3.  Remove duplicate register

Tested on Orange Pi PC Plus with dr_mode="peripheral" using

Reviewed by:	manu
MFC after:	5 weeks
Differential Revision: https://reviews.freebsd.org/D26348
r365941 arichardson Sept. 21, 2020, 9:03 a.m.
This absolute include causes a build failure on Linux for me:
.../cheri/freebsd/contrib/nvi/cl/../common/common.h:10:10: fatal error: '/usr/include/db.h' file not found

This change patches the file to use #include <db.h> instead until a
solution has been found upstream. See also https://github.com/lichray/nvi2/issues/69

Reviewed By:	bapt
Differential Revision: https://reviews.freebsd.org/D26480
r365940 arichardson Sept. 21, 2020, 9:03 a.m.
Reviewed By:	kevans
Differential Revision: https://reviews.freebsd.org/D26479
r365939 arichardson Sept. 21, 2020, 9:03 a.m.
Otherwise we get lots of warnings when building on Linux/macOS during
Scanning /local/scratch/alr48/cheri/output/freebsd-x86/usr/share/certs/blacklisted for certificates...
install: invalid option -- 'U'
Try 'install --help' for more information.
install: invalid option -- 'U'

Reviewed By:	kevans
Differential Revision: https://reviews.freebsd.org/D26481
r365938 tsoome Sept. 21, 2020, 9:01 a.m.
bootonce feature is temporary, one time boot, activated by
"bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag.

By default, the bootonce setting is reset on attempt to boot and the next
boot will use previously active BE.

By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will
be set permanently active.

bootonce dataset name is recorded in boot pool labels, bootenv area.

in case of nextboot, the nextboot_enable boolean variable is recorded in
freebsd:nvstore nvlist, also stored in boot pool label bootenv area.
On boot, the loader will process /boot/nextboot.conf if nextboot_enable
is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf
processing on next boot.

bootonce and nextboot features are usable in both UEFI and BIOS boot.

To use bootonce/nextboot features, the boot loader needs to be updated on disk;
if loader.efi is stored on ESP, then ESP needs to be updated and
for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated
(gpart or other tools).

At this time, only lua loader is updated.

Sponsored by:	Netflix, Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D25512
r365932 jrtc27 Sept. 20, 2020, 11:20 p.m.
This was broken in r357940 which introduced the __typeof use. We need
the volatile qualifier to be on the pointee not the pointer otherwise it
does nothing. This was found by mhorne in D26498, noticing there was a
problem (a spin loop condition was hoisted for RISC-V boot code) but not
the root cause of it.

Reported by:	mhorne
Reviewed by:	mhorne, mjg
Approved by:	mhorne, mjg
Differential Revision:	https://reviews.freebsd.org/D26500
r365931 kib Sept. 20, 2020, 10:16 p.m.
Possible in LA57 pmap config.

Noted by:	alc
Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D26492
r365930 melifaro Sept. 20, 2020, 9:32 p.m.
Remove "opt_mpath.h" header where not needed.

No functional changes.
r365929 mmel Sept. 20, 2020, 5:28 p.m.
It should be at least as large as the maximum value of caheline size
for currently known CPUs.

MFC after:	2 weeks
r365927 manu Sept. 20, 2020, 4:11 p.m.
MFC after:	1 week
r365926 mmel Sept. 20, 2020, 3:11 p.m.
Noticed by:	mav
MFC after:	1 month
MFC with:	r365899