openbsd
19 months agoZap extra empty line
tb [Thu, 6 Apr 2023 07:07:54 +0000 (07:07 +0000)]
Zap extra empty line

19 months agosimplify sshsig_find_principals() similar to what happened to
djm [Thu, 6 Apr 2023 03:56:02 +0000 (03:56 +0000)]
simplify sshsig_find_principals() similar to what happened to
sshsig_check_allowed_keys() in r1.31, removing some dead code

19 months agoremove redundant ssh!=NULL check; we'd already dereferenced it
djm [Thu, 6 Apr 2023 03:21:31 +0000 (03:21 +0000)]
remove redundant ssh!=NULL check; we'd already dereferenced it

19 months agomatch_user() shouldn't be called with user==NULL unless
djm [Thu, 6 Apr 2023 03:19:32 +0000 (03:19 +0000)]
match_user() shouldn't be called with user==NULL unless
host and ipaddr are also NULL

19 months agodon't care about glob() return value here.
djm [Thu, 6 Apr 2023 03:12:32 +0000 (03:12 +0000)]
don't care about glob() return value here.

19 months agobetter handle "phy-mode" properties, in particular around clk delays.
dlg [Thu, 6 Apr 2023 00:09:39 +0000 (00:09 +0000)]
better handle "phy-mode" properties, in particular around clk delays.

the phy mode can encode whether rk3568 mac should be doing the
delays when talking to the phy, or whether it should ignore them
and let the phy handle them. turns out this will probably be needed
by kettenis to get working ethernet on another rk3568 based system.

tweaks and ok kettenis@

19 months agoPush kernel lock into nd6_resolve()
kn [Wed, 5 Apr 2023 23:01:03 +0000 (23:01 +0000)]
Push kernel lock into nd6_resolve()

Tested as part of bigger unlock diffs, commit now as tiny first step.

OK bluhm

19 months agoARP has a sysctl to show the number of packets waiting for an arp
bluhm [Wed, 5 Apr 2023 21:51:47 +0000 (21:51 +0000)]
ARP has a sysctl to show the number of packets waiting for an arp
response.  Implement analog sysctl net.inet6.icmp6.nd6_queued for
ND6 to reduce places where mbufs can hide within the kernel.
Atomic operations operate on unsigned int.  Make the type of total
hold queue length consistent.
Use atomic load to read the value for the sysctl.  This clarifies
why no lock around sysctl_rdint() is needed.
OK mvs@ kn@

19 months agoARP has a queue of packets that should be sent after name resolution.
bluhm [Wed, 5 Apr 2023 19:35:23 +0000 (19:35 +0000)]
ARP has a queue of packets that should be sent after name resolution.
ND6 did only hold a single packet.  Unify the logic and add a mbuf
hold queue to struct llinfo_nd6.  This is MP safe and queue limits
are tracked with atomic operations.  New function if_mqoutput() has
common code for ARP and ND6.  ln_saddr6 holds the source address
of the requesting packet.  That is easier than fiddling with mbuf
queue in nd6_ns_output().
OK kn@

19 months agoImport the first of the new libevent manual pages
schwarze [Wed, 5 Apr 2023 18:34:37 +0000 (18:34 +0000)]
Import the first of the new libevent manual pages
written by Ted Bullock <tbullock at comlore dot com>
in order to polish it in the tree.
Not yet linked to the build.

In particular, this documents the so far undocumented functions
event_base_new(3) and event_reinit(3) and provides lots of new
information regarding event_init(3) and event_base_free(3).

Also using input from nicm@, jmc@, and myself, OK nicm@ jmc@.

19 months agoEnable Force Unit Access (FUA) for write commands. This seems to fix
mglocker [Wed, 5 Apr 2023 17:23:30 +0000 (17:23 +0000)]
Enable Force Unit Access (FUA) for write commands.  This seems to fix
intermittent data corruptions which I faced.  The documentation says about
FUA for write commands:

"The Device Server shall write the logical blocks to the medium, and shall
not complete the command with GOOD status until all the logical blocks have
been written on the medium without error."

19 months agoAdd (inside #if 0 blocks) #define's and gpt_types[] entries for
krw [Wed, 5 Apr 2023 14:07:08 +0000 (14:07 +0000)]
Add (inside #if 0 blocks) #define's and gpt_types[] entries for
all the GPT partition types known to mankind. a.k.a. Wikipedia,
Linux, and various BSD's.

Makes it easier to discuss/add/remove/check GUID's known to
fdisk(8).

No functional change.

19 months agoIf ndp -d did not find a neigbor entry, it removed the cloning route
bluhm [Wed, 5 Apr 2023 13:56:41 +0000 (13:56 +0000)]
If ndp -d did not find a neigbor entry, it removed the cloning route
instead.  Comparing the arp(8) and ndp(8) code shows that the latter
has a fallthrough to delete.  Return an error also in this case.
OK kn@

19 months agoCall getuptime(9) once for consistency; OK bluhm
kn [Wed, 5 Apr 2023 13:56:31 +0000 (13:56 +0000)]
Call getuptime(9) once for consistency;  OK bluhm

19 months agoAdd a few missing braces
tb [Wed, 5 Apr 2023 11:31:38 +0000 (11:31 +0000)]
Add a few missing braces

ok jsing

19 months agoSet up the RSA's _method_mod_n before the initial blinding
tb [Wed, 5 Apr 2023 11:30:12 +0000 (11:30 +0000)]
Set up the RSA's _method_mod_n before the initial blinding

As observed by Bernd Edlinger, the main part of the RSA timing leak that was
recently made public is that the initial blinding isn't done with Montgomery
exponentiation but rather with plain exponentiation.

Pull up the initialization of the cached Montgomery context to ensure we use
Montgomery exponentiation. Do this for private_{de,en}crypt(). Interestingly,
the latter was fixed in OpenSSL a while ago by Andy Polyakov as part of the
"smooth CRT-RSA" addition.

If this code was anything but completely insane this would never have been
an issue in the first place. But it's libcrypto...

ok jsing

19 months agoSprinkle a few BTI instructions into the arm64 assembly files and pass
kettenis [Wed, 5 Apr 2023 11:07:40 +0000 (11:07 +0000)]
Sprinkle a few BTI instructions into the arm64 assembly files and pass
-mmark-bti-property to indicate those now have BTI support.

ok jsing@, deraadt@

19 months agobn_mod_sqrt: Improve a handful of comments and a printf
tb [Wed, 5 Apr 2023 11:03:11 +0000 (11:03 +0000)]
bn_mod_sqrt: Improve a handful of comments and a printf

19 months agoCall dwpcie_link_config() when initializing the RK3568 PCIe controllers.
kettenis [Wed, 5 Apr 2023 10:48:12 +0000 (10:48 +0000)]
Call dwpcie_link_config() when initializing the RK3568 PCIe controllers.
This makes sure the PCIe link runs at the maximum possible speed.

Prompted by a diff from dlg@, who also tested this alternative diff.

ok dlg@

19 months agoImprove regress coverage for BN_mod_sqrt()
tb [Wed, 5 Apr 2023 10:47:00 +0000 (10:47 +0000)]
Improve regress coverage for BN_mod_sqrt()

This now covers all the main branches of both the old and new
BN_mod_sqrt() implementation except for negative p.

19 months agoImplement software control for the internal delays of the RTL8211F PHY.
kettenis [Wed, 5 Apr 2023 10:45:07 +0000 (10:45 +0000)]
Implement software control for the internal delays of the RTL8211F PHY.
Since we need to retain the hardware/firmware configuration of the delays
in most existing hardware that uses rgephy(4) (such as PCIe NICs), add a
bew MIIF_SETDELAY flag that controls the software configuration of the
delays.

ok dlg@, jsg@

19 months agoCall getuptime(9) once for consistency, sync with ARP
kn [Wed, 5 Apr 2023 10:40:37 +0000 (10:40 +0000)]
Call getuptime(9) once for consistency, sync with ARP

Feedback OK bluhm

19 months agosync
jsg [Wed, 5 Apr 2023 10:34:36 +0000 (10:34 +0000)]
sync

19 months agobsd.port.mk: Fix documentation on PATCHORIG.
edd [Wed, 5 Apr 2023 09:46:27 +0000 (09:46 +0000)]
bsd.port.mk: Fix documentation on PATCHORIG.

The default recently changed to `.orig.port`.

OK sthen@, tb@, op@, thanks!

19 months agoSimplify mod_sqrt_test() a bit
tb [Wed, 5 Apr 2023 08:43:31 +0000 (08:43 +0000)]
Simplify mod_sqrt_test() a bit

19 months agoRefactor port definitions to also support service names like bgp.
claudio [Wed, 5 Apr 2023 08:37:21 +0000 (08:37 +0000)]
Refactor port definitions to also support service names like bgp.
OK tb@

19 months agoRename family with af to follow pfctl/parse.y a bit more.
claudio [Wed, 5 Apr 2023 08:04:28 +0000 (08:04 +0000)]
Rename family with af to follow pfctl/parse.y a bit more.
OK tb@

19 months agobn_mod_sqrt test: Use a #define rather than hard coded 100
tb [Wed, 5 Apr 2023 07:52:25 +0000 (07:52 +0000)]
bn_mod_sqrt test: Use a #define rather than hard coded 100

19 months agoAdd coverage for the truly non-deterministic path of Tonelli-Shanks
tb [Wed, 5 Apr 2023 07:17:44 +0000 (07:17 +0000)]
Add coverage for the truly non-deterministic path of Tonelli-Shanks

Regress coverage of all of BN_mod_sqrt() is still lacking after this.
This will improve in forthcoming commits.

19 months agoIntroduce variation in location of junked bytes; ok tb@
otto [Wed, 5 Apr 2023 06:25:38 +0000 (06:25 +0000)]
Introduce variation in location of junked bytes; ok tb@

19 months agoclockintr: add clockintr_cancel()
cheloha [Wed, 5 Apr 2023 00:23:06 +0000 (00:23 +0000)]
clockintr: add clockintr_cancel()

As the name suggests, clockintr_cancel() cancels any pending
expiration of the given clockintr.

I think we will need this in the near future.

19 months agoclockintr: add clockintr_cancel_locked()
cheloha [Tue, 4 Apr 2023 21:49:10 +0000 (21:49 +0000)]
clockintr: add clockintr_cancel_locked()

Move the CLST_PENDING check and TAILQ_REMOVE() in
clockintr_schedule_locked() into a dedicated function,
clockintr_cancel_locked().  clockintr_schedule_locked() no longer
implicitly cancels a pending clockintr: it is the caller's
responsibility to check for CLST_PENDING and cancel any pending
expiration before calling clockintr_schedule_locked().  We can skip
the CLST_PENDING check during the dispatch loop because we know for
certain the clockintr in question is pending.

This is more verbose but I think it is less surprising.  Both
functions do one thing.

19 months agoAdopt a more compact idiom when initializing gpt_types[]. Group
krw [Tue, 4 Apr 2023 21:43:06 +0000 (21:43 +0000)]
Adopt a more compact idiom when initializing gpt_types[]. Group
entries with attributes together.

No intentional functional change.

19 months agoRemove stylistic differences between arp(8) and ndp(8) delete()
bluhm [Tue, 4 Apr 2023 21:18:04 +0000 (21:18 +0000)]
Remove stylistic differences between arp(8) and ndp(8) delete()
function.  This makes it easier to spot real changes in behavior.
OK kn@

19 months agoA refactoring back in 2016 in which magic numbers where extracted into
anton [Tue, 4 Apr 2023 18:14:32 +0000 (18:14 +0000)]
A refactoring back in 2016 in which magic numbers where extracted into
named constants accidentally dropped an instruction causing detection of
eXtended operations (XOP) on AMD hardware to break.

ok miod@ tb@

19 months agoIn preparation for better documenting BIO info callbacks, improve the
schwarze [Tue, 4 Apr 2023 17:10:37 +0000 (17:10 +0000)]
In preparation for better documenting BIO info callbacks, improve the
description of BIO_ctrl(3) and its three siblings.  Given the vast range
of effects these functions can have, the text is unavoidably still
vague, but at least some information can be provided.

While here, fix one wrong parameter type and three inconsistent
parameter names in the SYNOPSIS.

19 months agoCleanup parse.y a bit. Move global defines a bit down. Move mrtdump and
claudio [Tue, 4 Apr 2023 16:01:54 +0000 (16:01 +0000)]
Cleanup parse.y a bit. Move global defines a bit down. Move mrtdump and
network rules up into the grammar and switch the order of restricted
to be more like the rest.
OK tb@

19 months agoClean bn_mod_sqrt up a little
tb [Tue, 4 Apr 2023 15:32:02 +0000 (15:32 +0000)]
Clean bn_mod_sqrt up a little

This makes it look a bit more like other tests and also prepares the
addition of further test cases and different tests.

19 months agoWhen sending IP packets to userland with divert-packet rules, the
bluhm [Tue, 4 Apr 2023 10:12:03 +0000 (10:12 +0000)]
When sending IP packets to userland with divert-packet rules, the
checksum may be wrong.  Locally generated packets diverted by pf
out rules may have no checksum due to to hardware offloading.
Calculate the checksum in that case.
OK mvs@ sashan@

19 months agoEnable guided disk encryption support on arm64
kn [Tue, 4 Apr 2023 08:39:40 +0000 (08:39 +0000)]
Enable guided disk encryption support on arm64

All board specific quirks inside the installer (and other bugs) relating to
root on softraid are fixed, so that install media with the new question
just works for plain as well as encrypted installs.

Tested on Pinebook Pro, Raspberry Pi 4b, SolidRun CEX7.

19 months agoMake root on softraid installations boot out of the box on Raspberry Pis
kn [Tue, 4 Apr 2023 08:31:35 +0000 (08:31 +0000)]
Make root on softraid installations boot out of the box on Raspberry Pis

Various files are put onto a pi's ESP, assuming root disk means boot disk,
which is not true for root on softraid(4).

Wrap the code in a loop over chunks (if any) or the single disk as before,
just like installboot(8) does.

OK mbuhl

19 months agoSynopsis Designware -> Synopsys DesignWare
jsg [Tue, 4 Apr 2023 00:38:37 +0000 (00:38 +0000)]
Synopsis Designware -> Synopsys DesignWare

19 months agoCompress euclid() a little
tb [Mon, 3 Apr 2023 21:43:43 +0000 (21:43 +0000)]
Compress euclid() a little

This function is spread out over way too many lines and has too much
repetition. Once this is made a little more compact, it becomes clearer
that this is a somewhat obfuscated version of binary gcd (it is not
constant time therefore cryptographically unsound. It is not used
internally). This will likely go away later.

ok jsing

19 months agoLink bn_gcd test to regress
tb [Mon, 3 Apr 2023 21:33:16 +0000 (21:33 +0000)]
Link bn_gcd test to regress

19 months agoAdd regress coverage for BN_gcd() and BN_gcd_ct()
tb [Mon, 3 Apr 2023 21:32:44 +0000 (21:32 +0000)]
Add regress coverage for BN_gcd() and BN_gcd_ct()

19 months agoFix stupid bug in previous.
miod [Mon, 3 Apr 2023 18:59:47 +0000 (18:59 +0000)]
Fix stupid bug in previous.

19 months agoclockintr: clockintr_cpu_init(): isolate struct clockintr_queue setup
cheloha [Mon, 3 Apr 2023 17:40:51 +0000 (17:40 +0000)]
clockintr: clockintr_cpu_init(): isolate struct clockintr_queue setup

We will always need to initialize the clockintr_queue struct.
However, the hardclock, schedclock, and statclock will not always be a
part of that struct.  Move the clockintr_establish() calls in
clockintr_cpu_init() away from the other initialization steps to make
the dependency relationship more obvious.  We need to intialize a
struct clockintr_queue before we can establish clock interrupts.

19 months agoacpibtn_notify: ignore duplicate ACPI lid transitions
millert [Mon, 3 Apr 2023 13:38:18 +0000 (13:38 +0000)]
acpibtn_notify: ignore duplicate ACPI lid transitions
A Dell Precision 5510 produces two _LID events when the lid is closed.
This results in acpibtn_notify() adding two sleep tasks.  The laptop
suspends and resumes successfully, but on resume the second sleep
task runs and it goes right back to sleep.  Making the lid transition
a no-op when the existing value matches new _LID value works around
the problem.  OK miod@ jcs@

19 months agoReduce indent in single_thread_check_locked() by inverting initial
claudio [Mon, 3 Apr 2023 11:57:50 +0000 (11:57 +0000)]
Reduce indent in single_thread_check_locked() by inverting initial
if () check which just returns.
OK mpi@

19 months agoStop writing pine64 firmware to disk
kn [Mon, 3 Apr 2023 10:51:50 +0000 (10:51 +0000)]
Stop writing pine64 firmware to disk

pine64 happens to be the first board "we ran on", as kettenis explains, and
this code tries to handle the situation of installing to the same disk the
installer booted from.

Similar boards like the Pinebook Pro don't get special treatment and work;
INSTALL.arm64 already explains how to flash required firmware onto disks or
install media -- Allwinner SoCs like the pine64 included.

Spotted through md_installboot() dd'ing blobs onto the root disk,
which does not fly with root on softraid and is in the way of arm64 getting
support for guided disk encryption.

Suggested by kettenis patrick
Feedback jsg patrick
OK patrick

19 months agoAdd first step of flowspec support. This adds the bits to establish a
claudio [Mon, 3 Apr 2023 10:48:00 +0000 (10:48 +0000)]
Add first step of flowspec support. This adds the bits to establish a
connection with SAFI 133. Right now any sent UPDATE with SAFI 133 is
simply ignored. At the moment SAFI 134 (flowspec for L3VPN) is unsupported.
OK tb@

19 months agoMove null check up and simplify process_escapes. Based on Coverity CID
dtucker [Mon, 3 Apr 2023 08:10:54 +0000 (08:10 +0000)]
Move null check up and simplify process_escapes.  Based on Coverity CID
291863 which points out we check the channel pointer for NULLness after
dereferencing it.  Move this to the start of the function, and while
there simplify initialization of efc a bit.  ok djm@

19 months agoClarify text for new -A slightly, GitHub issue 3508.
nicm [Mon, 3 Apr 2023 07:39:37 +0000 (07:39 +0000)]
Clarify text for new -A slightly, GitHub issue 3508.

19 months agoenable rkusbphy(4)
dlg [Mon, 3 Apr 2023 05:58:56 +0000 (05:58 +0000)]
enable rkusbphy(4)

19 months agotry using a standard phy drivers registered with ofw/fdt first.
dlg [Mon, 3 Apr 2023 01:57:41 +0000 (01:57 +0000)]
try using a standard phy drivers registered with ofw/fdt first.

this allows ehci to enable rkusbphy(4), which in means the port and
port gets turned onto the port.

tested on a radxa e25 and nanopi r5s without any usb or usb phy
support in the boot loader.

ok kettenis@

19 months agoadd support for enabling both the usb2 and usb3 phys.
dlg [Mon, 3 Apr 2023 01:55:00 +0000 (01:55 +0000)]
add support for enabling both the usb2 and usb3 phys.

the code tried enabling the 0th phy in the usb-phy proplist, which
is the usb2 phy, and if that didn't exist it would try usb3-phy in
the standard phys/phy-names properties. it now tries to enable the
usb2 and usb3 phys independently.

further, support using standard phy drivers registered with the
ofw/fdt code, not just the ones handled inside the xhci driver.

ok kettenis@

19 months agoregister mvneta so the interface can be found by node/phandle later.
dlg [Mon, 3 Apr 2023 01:46:18 +0000 (01:46 +0000)]
register mvneta so the interface can be found by node/phandle later.

19 months agoadd phy_enable_prop_idx() to work with phys under props other than "phy".
dlg [Mon, 3 Apr 2023 01:40:32 +0000 (01:40 +0000)]
add phy_enable_prop_idx() to work with phys under props other than "phy".

eg, the snps,dwc3 device tree bindings say that it uses a usb2 and
usb3 phy, and they can be listed either "usb2-phy" and "usb3-phy"
under the standard "phys" and "phy-names" properties supported by
phy_enable(), or as slots 0 and 1 under a "usb-phy" properties. the
latter would be supported by phy_enable_idx(), but it hardcodes
"phys" as the property it looks at. phy_enable_prop_idx() is the
same as phy_enable_prop_idx, but it lets you specify which property
you're indexing into.

ok kettenis@

19 months agospecial case phandle 0 and return NULL when looking up network interfaces.
dlg [Mon, 3 Apr 2023 01:34:06 +0000 (01:34 +0000)]
special case phandle 0 and return NULL when looking up network interfaces.

not all interfaces will have a phandle (ie, it will be 0), so don't
let phandle 0 be used to find any of these.

discussed with miod@

19 months agoadd glue for network interfaces to be found by fdt/ofw node or phandle.
dlg [Mon, 3 Apr 2023 01:30:32 +0000 (01:30 +0000)]
add glue for network interfaces to be found by fdt/ofw node or phandle.

if we're going to support switch chips (eg, marvell link street
switches as found on a3700 boards like the espressobin), then the
device tree for switch ports identifies which network interface
they're connected by by a reference (phandle) across the device
tree. this lets network drivers register the ifnet struct with the
associated node and phandle so the switch can find it and configure
it for use with the switch.

ok kettenis@

19 months agodo actual init of the phy itself when needed.
dlg [Mon, 3 Apr 2023 01:21:31 +0000 (01:21 +0000)]
do actual init of the phy itself when needed.

turn the phy clock on and take the port out of suspend when something
(eg, xhci or ehci) wants to use the port.

before this the code just enabled power on the phy port regulators.

ok kettenis@

19 months agoclockintr: protect struct clockintr_queue with a mutex
cheloha [Mon, 3 Apr 2023 00:20:24 +0000 (00:20 +0000)]
clockintr: protect struct clockintr_queue with a mutex

Add a mutex (cq_mtx) to stuct clockintr_queue so that arbitrary CPUs
can manipulate clock interrupts established on arbitrary CPU queues.

Refactor the bulk of clockintr_schedule() into clockintr_schedule_locked()
so we can reuse it from within the mutex.

Tested by mlarkin@.  Neat bug found by mlarkin@.  With tweaks from
kettenis@.

ok kettenis@

19 months agofill out the list of quectel devices that should be supported.
dlg [Sun, 2 Apr 2023 23:57:57 +0000 (23:57 +0000)]
fill out the list of quectel devices that should be supported.

the list comes from the Quectel LTE&5G Linux USB Driver User Guide V2.0
and claims that all these devices function the same as each other.

ok miod@

19 months agoregen
dlg [Sun, 2 Apr 2023 23:56:19 +0000 (23:56 +0000)]
regen

19 months agoadd more quectel usb device ids
dlg [Sun, 2 Apr 2023 23:55:12 +0000 (23:55 +0000)]
add more quectel usb device ids

this list comes from the Quectel LTE&5G Linux USB Driver User Guide v2.0

ok miod@

19 months agoFix table by using strings of proper lengths instead of bogus
tb [Sun, 2 Apr 2023 23:33:42 +0000 (23:33 +0000)]
Fix table by using strings of proper lengths instead of bogus
scaling widths.

ok schwarze

19 months agoUse #define instead of `char * const' for the repeated GUID strings. Ugly,
miod [Sun, 2 Apr 2023 18:44:13 +0000 (18:44 +0000)]
Use #define instead of `char * const' for the repeated GUID strings. Ugly,
but restores compilability with older compilers such as gcc.

No intentional functional change.

19 months agoAdd support for TEMPerGold 3.4 to ugold(4).
miod [Sun, 2 Apr 2023 17:03:14 +0000 (17:03 +0000)]
Add support for TEMPerGold 3.4 to ugold(4).

ok landry@

19 months agoRegen
miod [Sun, 2 Apr 2023 17:02:08 +0000 (17:02 +0000)]
Regen

19 months agoNew TEMPerGold device.
miod [Sun, 2 Apr 2023 17:01:48 +0000 (17:01 +0000)]
New TEMPerGold device.

19 months agoadd Ryuichi Sakamoto. rest in peace.
sthen [Sun, 2 Apr 2023 16:43:42 +0000 (16:43 +0000)]
add Ryuichi Sakamoto. rest in peace.

19 months agoRevert r1.9 and reinstate r1.6
tb [Sun, 2 Apr 2023 15:36:53 +0000 (15:36 +0000)]
Revert r1.9 and reinstate r1.6

The argument change to x5519_ge_scalarmult_base() was made to match the
prototype in the header. More recent compilers warn about such ptr vs
array mismatches.

19 months agoadd Windows 11 _OSI strings
jsg [Sun, 2 Apr 2023 11:32:48 +0000 (11:32 +0000)]
add Windows 11 _OSI strings
ok mlarkin@

19 months agoAdd support for the RTL8211F-VD PHY.
kettenis [Sun, 2 Apr 2023 11:28:23 +0000 (11:28 +0000)]
Add support for the RTL8211F-VD PHY.

ok kevlo@

19 months agozap excessive semicolons; ok mglocker@
anton [Sun, 2 Apr 2023 08:53:01 +0000 (08:53 +0000)]
zap excessive semicolons; ok mglocker@

19 months agosync
kevlo [Sun, 2 Apr 2023 03:41:38 +0000 (03:41 +0000)]
sync

19 months agonable ngbe(4) on install media. Passes 'make release' build.
kevlo [Sun, 2 Apr 2023 03:40:54 +0000 (03:40 +0000)]
nable ngbe(4) on install media.  Passes 'make release' build.

Pointed out by miod@, patrick@

19 months agovmd(8): migrate vmd_vm.vm_ttyname to char array.
dv [Sun, 2 Apr 2023 02:04:10 +0000 (02:04 +0000)]
vmd(8): migrate vmd_vm.vm_ttyname to char array.

Other structs use a fixed length array already. This allows a vmd_vm
object to be transmitted over an ipc channel, too.

Additionally, solves a segfault caused by a strlcpy(3) in an error
path.

ok mlarkin@

19 months agomanpage for rkusbphy(4)
dlg [Sun, 2 Apr 2023 01:40:52 +0000 (01:40 +0000)]
manpage for rkusbphy(4)

19 months agoadd rkusbphy(4), a driver for the usb2phy on rockchip SoCs.
dlg [Sun, 2 Apr 2023 01:21:39 +0000 (01:21 +0000)]
add rkusbphy(4), a driver for the usb2phy on rockchip SoCs.

the rkusbphy device has children nodes in the device tree which are
the actual phys. this driver mostly exists to wire those children
up as PHYs and turn the associated regulators on when a host
controller enables the PHYs. in the future it should enable clocks
and take ports out of suspend too.

i'm not enabling this yet because it's useless without some tweaks
in the usb host controller drivers.

ok kettenis@

19 months agoRename get_softraid_{disks -> chunk}() and CRYPTO{DISK -> CHUNK}
kn [Sun, 2 Apr 2023 00:58:07 +0000 (00:58 +0000)]
Rename get_softraid_{disks -> chunk}() and CRYPTO{DISK -> CHUNK}

"disk" can mean both "chunk" and "volume" and a future diff for better
softraid volumes handling will benefit from this distinction.

No functional change.

19 months agotc_init.9: miscellaneous cleanup and rewrites
cheloha [Sun, 2 Apr 2023 00:02:26 +0000 (00:02 +0000)]
tc_init.9: miscellaneous cleanup and rewrites

- In DESCRIPTION, try to more fully describe what kern_tc.c does.
  Clean up the wording.

- Mention *all* the requirements for timekeeping hardware.  Describe
  the rollover margin in plainer language.

- Revise field descriptions for struct timecounter.  Don't mention
  fields the driver doesn't need to initialize.  Document the tc_user
  field.

- Add a CONTEXT section.

- In SEE ALSO, switch to an https URI on the main freebsd.org website.

- In HISTORY, note that the timecounting code first reached end users
  in FreeBSD 3.0.  This commit is probably the first one:

"Replace TOD clock code with more systematic approach."
https://cgit.freebsd.org/src/commit/sys/sys/timetc.h?id=7ec73f64179417aeda085c1c338385559fb49c23

- Add an AUTHORS section.

With input from Poul-Henning Kamp.

Link: https://marc.info/?l=openbsd-tech&m=168004968214914&w=2
ok jmc@

19 months agoLimit IFS scope to effect parsing code only
kn [Sat, 1 Apr 2023 23:24:46 +0000 (23:24 +0000)]
Limit IFS scope to effect parsing code only

Set to split `hw.disknames' strings is neat, but functionn-wide means the
bsort() invocation honours it, i.e. it'll output newlines not spaces.

Break the one-liner into the same multi-line idom occuring elsewhere and
contain IFS in the subshell that needs it.

This was never visible due how the output of was consumed by the shell.

The only visual, but otherwise effectless bug due to this appeared with the
new disk encryption question double-quoting get_dkdevs() output, i.e.
multiple disks printed across multiple lines;  this yields one, as inteded.

OK afresh1

19 months agoCheck all chunks in the delayed free list for write-after-free.
otto [Sat, 1 Apr 2023 18:47:51 +0000 (18:47 +0000)]
Check all chunks in the delayed free list for write-after-free.
Should catch more of them and closer (in time) to the WAF.  ok tb@

19 months agoUse char * const for the rest of the repeated GUID strings. More
krw [Sat, 1 Apr 2023 14:18:29 +0000 (14:18 +0000)]
Use char * const for the rest of the repeated GUID strings. More
readable, less prone to typos.

No intentional functional change.

19 months agoPull static const data out of BN_value_one()
tb [Sat, 1 Apr 2023 12:44:56 +0000 (12:44 +0000)]
Pull static const data out of BN_value_one()

Also use C99 initializers for readability.

discussed with jsing

19 months agoIndent labels
tb [Sat, 1 Apr 2023 11:10:55 +0000 (11:10 +0000)]
Indent labels

19 months agoGroup the non-constant time gcd functions together
tb [Sat, 1 Apr 2023 11:08:43 +0000 (11:08 +0000)]
Group the non-constant time gcd functions together

The only consumer of euclid() is BN_gcd(), which, in turn is only
used by BN_gcd_nonct(). Group them together rather than having
parts of the constant time implementation separate them.

This moves two functions to a different place in the file.

19 months agorkiovd(4)
kettenis [Sat, 1 Apr 2023 08:48:04 +0000 (08:48 +0000)]
rkiovd(4)

19 months agoEnable rkiovd(4)
kettenis [Sat, 1 Apr 2023 08:39:54 +0000 (08:39 +0000)]
Enable rkiovd(4)

19 months agoAdd rkiovd(4), a driver for the IO voltage domains on Rockchip SoCs. This
kettenis [Sat, 1 Apr 2023 08:39:05 +0000 (08:39 +0000)]
Add rkiovd(4), a driver for the IO voltage domains on Rockchip SoCs.  This
driver makes sure the SoC IO voltage domains stay in sync with the voltage
provided by the regulator associated with the domain.

ok dlg@

19 months agoImplement regulator notifiers which get called when the voltage/current
kettenis [Sat, 1 Apr 2023 08:37:23 +0000 (08:37 +0000)]
Implement regulator notifiers which get called when the voltage/current
for a regulator is changed or when the regulator gets initialized when it
attaches for the first time.  The latter makes it possible to register
a notifier for a regulator that hasn't attached yet.

ok dlg@

19 months agoavoid use of uninitialised memory
jsg [Sat, 1 Apr 2023 06:39:03 +0000 (06:39 +0000)]
avoid use of uninitialised memory
ok mlarkin@

19 months agohorrible whitespace, mostly on non-code lines. no object change
tb [Sat, 1 Apr 2023 05:27:44 +0000 (05:27 +0000)]
horrible whitespace, mostly on non-code lines. no object change

19 months agofollow quectel guidance on which usb interfaces umsm should match.
dlg [Sat, 1 Apr 2023 00:04:40 +0000 (00:04 +0000)]
follow quectel guidance on which usb interfaces umsm should match.

the Quectel LTE&5G Linux USB Driver User Guide V2.0 says umsm should
only attach to usb interfaces 0 to 3 using the interface class
UICLASS_VENDOR. their doco uses magic numbers, but this is what
they mean.

interfaces 4 and above provide network (not serial) via qmi, ecm,
or mbim. preventing umsm from attaching to the high interfaces
allows the appropriate network driver to use it instead. eg, umb
is now able to attach to the network interface because it presents
a standard mbim class.

discussed with and tested by kevlo@
ok patric@ sthen@ kevlo@

19 months agoshuffle the code in umsm_match a bit.
dlg [Fri, 31 Mar 2023 23:55:45 +0000 (23:55 +0000)]
shuffle the code in umsm_match a bit.

if umsm_lookup doesnt return anything, return early and leave the
rest of umsm_match to handling specific devices.

no functional change.

19 months agodont match quectel ec25 by vendor+product id
dlg [Fri, 31 Mar 2023 23:53:49 +0000 (23:53 +0000)]
dont match quectel ec25 by vendor+product id

quectel seem to provide a sane and consistent set of functionality
built on top of the qualcomm qmi stuff. their linux drivers guide
says quectel modems provide a set of umsm usb interfaces and a
network interface that can be in qmi, ecm, or mbim mode.

if the modem is in mbim mode, it will present the mbim classes which
umb should be able to attach to without this explicit vendor+product
match (assuming umsm doesn't claim the interface first).

based on info in the Quectel LTE&5G Linux USB Driver User Guide V2.0

discussed with and tested by kevlo@
ok patrick@ sthen@ kevlo@

19 months agoregen after "BE-M1000" addition
kn [Fri, 31 Mar 2023 20:31:35 +0000 (20:31 +0000)]
regen after "BE-M1000" addition

19 months agoAdd "Baikal Electronics" and their "BE-M1000" SoC
kn [Fri, 31 Mar 2023 20:28:48 +0000 (20:28 +0000)]
Add "Baikal Electronics" and their "BE-M1000" SoC

OK kettenis

19 months agoAdd missing NULL check after group_get()
tb [Fri, 31 Mar 2023 20:16:55 +0000 (20:16 +0000)]
Add missing NULL check after group_get()

Otherwise dh_getlen() will dereference ie->group and crash.

looks correct to hshoexer