sndiod: Pad the last play block using the right encoding
Fixes the short noise when playback of unsigned samples stops. We've
to call enc_sil_do() instead of padding with 0 (0 doesn't represent
silence for unsigned encodings).
Mostly from gkoehler@
ddb was not part of Mach until 3.0
"The Mach kernel has a builtin kernel debugger (kdb) based on adb"
Mach: A New Kernel Foundation For UNIX Development, USENIX Summer 1986
"The new kernel debugger has most of the features of the old kdb, but
with a more rational (gdb-like) syntax."
Mach 3.0 (mk83), ddb.man
Mark W. Eichin explains how ddb came to be in 386BSD 0.1 in
a June 1992 post to comp.unix.bsd
https://groups.google.com/g/comp.unix.bsd/c/LY3hbHwjdG0/m/ca1hS0Hp5HcJ
Julian Elischer's scsi code was not part of 386BSD 0.1. It was posted to
comp.unix.bsd and was part of the 0.2.2 patchkit. The first two commits
to NetBSD were 386BSD 0.1 and the 0.2.2 patches.
uk.c did not appear till NetBSD 1.0.
ok miod@
Add an EXAMPLES section.
I admit this is unusually long for a manual page. But that's not my fault
as a documentation author. An example in a manual page ought to be minimal
to show what needs to be demonstrated, and this example is minimal in that
sense. Making it shorter without loosing important aspects does not seem
possible.
When an API is poorly designed, one of the consequences is that that
documentation becomes harder to understand and often longer - in this
case to the point of becoming outright intimidating. If people dislike
that, they should design better APIs in the first place rather than
blasting the poor manual page for being too long or too complicated.
OK tb@
Kill `inp_notify' list remains.
This was the list where PCBs were temporary linked to avoid sleep with
`inpt_mtx' mutex(9) held. in_pcbnotifyall() and in6_pcbnotify are the
last list users, so switch them to in_pcb_iterator() too, moreover they
already do in_pcb_is_iterator() check.
Note, in_pcb_iterator() does necessary reference couter handling,
unlocked `inp' dereference is safe.
ok bluhm
virtio: Refactor attach logic
virtio 1.x requires that all queue setup, including the queue interrupt
vector, is done before setting the queue_enable register to 1. This
conflicts with how we do things right now:
* We implicitly make queue setup in virtio_alloc_vq(), which is called
from the child driver attach functions. This also sets queue_enable=1.
* Later, we allocate the interrupts and set the queue interrupt vectors
in the second half of the virtio transport attach functions.
This is a violation of a MUST from the standard and causes problems with
some hypervisors, in particular those that have no virtio 0.9 support,
which has no such ordering requirements.
To fix this:
* Move the interrupt allocation to a new virtio_attach_finish() function.
[17 lines not shown]
If EVP_CIPHER_CTX_ctrl(3) is called on EVP_chacha20_poly1305(3)
with an unsupported control command, return -1 rather than 0
to the caller to indicate the error because in general, these
control hooks ought to return -1 for unsupported control commands
and 0 for other errors, for example other invalid arguments.
Not a big deal because this change does not change when operations
succeed or fail, and because callers are unlikely to pass unsupported
control commands in the first place. The only functional change is that
if a calling program inspects the ERR(3) stack after this failure,
it will now find the correct error code rather than nothing.
Even that wasn't a huge problem because for most EVP_CIPHER control
failures, getting no reason for the error is the usual situation.
Then again, giving the reason when easily possible may occasionally
be useful. OpenSSL also returns -1 in this case, so it also helps
compatibility a tiny bit.
Found while auditing the return values of all the EVP_CIPHER
control hooks in our tree. This was the only fishy one i found.
[2 lines not shown]
Fix signed integer comparison in tcp mss.
In tcp_mss_adv() max(9) was used to guarantee that mss it not too
small. Unfortunately max() uses u_int and mss could get negative
in some error conditions.
Rearrange the code to directly return in case of errors. Also read
tcp_mssdflt only once to head towards atomic integer sysctl.
OK mvs@
Relax some uvm_page_owner_locked() assertions.
. uvm_pagewait(): do not require an exclusive lock to release it & sleep
. uvm_page{de,}activate(): lists updates are serialized by the `pageqlock' mutex
More assertions could be relaxed but only those 3 are necessary for running
the lower fault handler in parrallel.
ok miod@
sndiod: Switch to printf(3)-style logging
With this change, any line is logged using a single function call
(instead of one function call per logged token). This makes the
sources easier to read and reduces the binary size. Debug strings that
would be too difficult to produce with snprintf(3) are simplified.
ok tb, dlg
Pass BUS_DMA_64BIT to bus_dmamem_alloc(). On amd64, this allows use of
memory past 4GB, potentially freeing up some low memory for more important
uses.
ok dlg@
Move the horrific EVP_aes_128_ccm(3) API out of the important,
algorithm-independent EVP_EncryptInit(3) manual as another step
in making the latter leaner and more palatable.
As a side benefit, the new EVP_aes_128_ccm(3) manual page may provide
a better fighting chance to programmers who see themselves forced to
support CCM for whatever reason. It documents the mandatory, but so
far undocumented EVP_CTRL_CCM_GET_TAG control command and makes the
description of the three EVP_CTRL_CCM_SET_* control commands and the
numerous related quirks more precise.
Rework and fix the mlkem tests
Make proper use of CBB and CBS. If a CBS ever owns data, you're holding
it wrong. Ditch gross macros, sscanf, and globals. The use of fgets is
annoying here, so replace it with getline, which be provided by portable
if needed.
Most importantly, make the tests actually signal failure rather than
only printing an error. Fix the state machines in a few of them. Some
tests didn't parse the .txt file at all. Others mostly did but didn't
actually test what they were supposed to be testing. Such failures
were hidden by the way the tests were written.
This basically needed a complete revamp. It still isn't pretty and much
of it could be deduplicated, but I only have so much time alotted on this
blue planet.
Do not install mlkem.h and bytestring.h into /usr/include/openssl for now
More work in mlkem is needed and this was premature.
discussed with beck and jsing