commits
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.
No intentional functional change.
While here, fix one wrong parameter type and three inconsistent
parameter names in the SYNOPSIS.
This makes it look a bit more like other tests and also prepares the
addition of further test cases and different tests.
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.
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
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
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.
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
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@
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@
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@
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@
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@
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@
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@
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@
this list comes from the Quectel LTE&5G Linux USB Driver User Guide v2.0
ok miod@
No intentional functional change.
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.
Pointed out by miod@, patrick@
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@
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@
"disk" can mean both "chunk" and "volume" and a future diff for better
softraid volumes handling will benefit from this distinction.
No functional change.
- 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@
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
No intentional functional change.
Also use C99 initializers for readability.
discussed with jsing
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.
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.
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
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.
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
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@
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@
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@
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@
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@
- 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@
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