1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00
Commit Graph

237206 Commits

Author SHA1 Message Date
kirill
30208656d0 sys/usb: fix ISOCHRONOUS IN transfer offsets
Offsets for ISOCHRONOUS IN frames are now based on a fixed packet size
(xfer->length / xfer->nframes), ensuring accuracy even with shorter frames.

OK: mpi@
2024-12-22 22:36:23 +00:00
mglocker
a70ebb6553 Fix double space typo in printf from last commit 2024-12-22 21:55:20 +00:00
miod
47df0e24a7 Remove forward declaration of struct clockframe, not needed here. 2024-12-22 20:38:35 +00:00
kirill
a623dae001 sys/uvideo: forward error bit to consumer
Some invalid frames or frames with an error flag from the camera might be
essential for a stream consumer for synchronization and other purposes.
Without this, the consumer may be unable to synchronize the stream or play
it at all.

Instead of skipping frames that the driver considers incorrect, this change
forwards them to the V4L consumer with the V4L2_BUF_FLAG_ERROR flag set,
allowing the consumer to decide whether to skip the frame or use parts of it.

The behavior for non-mmap consumers remains unchanged, and error frames
are still skipped by the driver.

This change fixes the integrated camera on:
 - ThinkPad T14 Gen 5
 - ThinkPad X1 nano 2
 - Lenovo x13

Plus made progress with support of Elgato HD60 S+

OK: mglocker@
2024-12-22 20:30:04 +00:00
kirill
792482ec38 backout previous, wrong diff 2024-12-22 20:22:53 +00:00
kirill
391f6e7a80 sys/uvideo: forward error bit to consumer
Some invalid frames or frames with an error flag from the camera might be
essential for a stream consumer for synchronization and other purposes.
Without this, the consumer may be unable to synchronize the stream or play
it at all.

Instead of skipping frames that the driver considers incorrect, this change
forwards them to the V4L consumer with the V4L2_BUF_FLAG_ERROR flag set,
allowing the consumer to decide whether to skip the frame or use parts of it.

The behavior for non-mmap consumers remains unchanged, and error frames
are still skipped by the driver.

This change fixes the integrated camera on:
 - ThinkPad T14 Gen 5
 - ThinkPad X1 nano 2
 - Lenovo x13

Plus made progress with support of Elgato HD60 S+

OK: mglocker@
2024-12-22 20:11:26 +00:00
mpi
8774a9584f Read entry's values before releasing locks in uvm_fault_lower_io().
ok tb@, miod@, kettenis@
2024-12-22 20:02:57 +00:00
mglocker
3288a07de7 Instead of doing hard-coded pin mappings on X1E machines, extract the pin
mappings from the respective ACPI tables.

This patch is an adaptation from a NetBSD commit spotted by patrick@:

575554bd38

Tested and ok kirill@, kettenis@
2024-12-22 18:00:18 +00:00
ratchov
b4d5e3c92b aucat: Switch to printf(3)-style logging
Lines are logged using a single function call, which 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.
2024-12-22 14:17:45 +00:00
florian
b0c10c99a4 Set correct request timeout once we found the correct server block.
On accept(2), httpd(8) sets the timeout based on ip:port. Once we have
parsed the http headers we can find the name-based server block and
apply its request timeout.

Problem identified and fix from Nick Owens, thanks!

OK tb
2024-12-22 13:51:42 +00:00
schwarze
222d99e539 mark six #define'd constants as intentionally undocumented 2024-12-22 00:45:23 +00:00
jca
7dd88e41b8 ld.lld now needs 9GB of ram to link firefox/libxul.so on riscv64 2024-12-21 14:12:45 +00:00
jsg
76b1f2ebe5 change '386BSD 0.1.2.4/FreeBSD' to .Fx
the 0.2.4 patchkit for 386BSD 0.1 did not have this command
2024-12-21 13:15:36 +00:00
ratchov
0cdbd9642b 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@
2024-12-21 08:57:18 +00:00
anton
d6933ec7e0 Replace poor man's synchronization primitive (i.e. sleep) with a wait
until construct in the hopes of making these tests less flaky.
2024-12-21 07:49:03 +00:00
jsg
7ed182d8b9 correct history; a reboot command did not appear until 4BSD 2024-12-21 05:01:25 +00:00
jsg
a80738d887 correct history; ascii(7) is the first edition manual 2024-12-21 03:34:31 +00:00
jsg
f1f9609d3e 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
2024-12-21 03:10:46 +00:00
jsg
ce1c3cff25 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@
2024-12-21 01:00:31 +00:00
schwarze
a63b39658a 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@
2024-12-21 00:27:47 +00:00
mvs
8ee0399bd2 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
2024-12-21 00:10:04 +00:00
sf
77d0f8231d 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.
  This does all queue setup, including the interrupt vectors.

* Don't call virtio_setup_queue() in virtio_alloc_vq() anymore.

* We can also move the setting of the DRIVER_OK flag into this function.
  virtio_attach_finish() must be called before using any virtqueue or
  writing any virtio config register.

While there,

* also streamline the attach error handling in all drivers.

* skip initially setting sc_config_change to NULL, the softc is
  initialized to 0.

ok jan@
tested by bluhm@
2024-12-20 22:18:27 +00:00
bluhm
7aa20da420 Declare some global TCP variables constant.
OK mvs@
2024-12-20 21:30:17 +00:00
schwarze
4ac9059474 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.

OK tb@
2024-12-20 20:05:29 +00:00
bluhm
3458005deb 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@
2024-12-20 19:20:34 +00:00
mpi
ae80fb09d1 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@
2024-12-20 18:54:12 +00:00
mpi
f3e62b5987 A shared lock is now enough to call pgo_get() functions iff PGO_LOCKED is given.
Update assertions to reflect that.

ok tb@, miod@
2024-12-20 18:49:37 +00:00
mpi
dceff77413 Merge identical code paths to promote data to a new anon into a new function.
ok tb@, miod@
2024-12-20 18:46:51 +00:00
tb
c7c5643a71 mlkem regress: garbage collect two global variables 2024-12-20 15:47:26 +00:00
tb
b229b719d0 hidden mlkem.h: add comment to #endif 2024-12-20 15:10:31 +00:00
tb
abab89db3f Annotate yet another greasy stinky tentacle of xca
I'm so tired of this.
2024-12-20 09:40:29 +00:00
ratchov
7b6392009e 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
2024-12-20 07:35:56 +00:00
nicm
9e4e626151 Only map S-Tag in mode 2, not mode 1. GitHub issue 4304. 2024-12-20 07:10:51 +00:00
jmatthew
dd0896fb3b 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@
2024-12-20 03:31:09 +00:00
schwarze
ff6a185afe 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.
2024-12-20 01:54:03 +00:00
tb
6f65ec34f2 Fix whitespace in Makefile 2024-12-20 01:53:46 +00:00
tb
f3c21583ac That works better with a G 2024-12-20 01:51:27 +00:00
tb
e9751d5483 cant't -> can't
(the mystery of spotting typos right after commit strikes again)
2024-12-20 00:32:15 +00:00
tb
8889493e35 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.
2024-12-20 00:07:12 +00:00
tb
58f37af48f sync 2024-12-19 23:57:27 +00:00
tb
822ced31eb 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
2024-12-19 23:56:32 +00:00
tb
9c470d64a6 #ifdef out the inclusion of openssl/mlkem.h for now
discussed with beck and jsing
2024-12-19 23:53:38 +00:00
tb
ef1019e622 Do not assume mlkem.h and bytestring.h are public in libcrypto
As long as is not quite clear what we want to do about the public API
aspect of MLKEM, keep things internal for now.

discussed with beck and jsing
2024-12-19 23:52:26 +00:00
tb
d65e817093 mlkem regress: reach around into bytestring again 2024-12-19 23:45:09 +00:00
mvs
f1bf6f4e82 Use per-sockbuf mutex(9) to protect `so_rcv' buffer of tcp(4) sockets.
Only unlock soreceive() path, somove() path still locked exclusively. Also
exclusive  socket lock will be taken in the soreceive() path each time
before pru_rcvd() call.

Note, both socket and `sb_mtx' locks are held while SS_CANTRCVMORE
modified, so socket lock is enough to check it in the protocol input
path.

ok bluhm
2024-12-19 22:11:35 +00:00
mvs
10d5b13ebf Unlock carp_sysctl().
This is the statistics implemented with per-CPU counters and the
`carp_opts' array of atomically accessed integers.

Replace the `carp_opts' array with individual `carpctl_*' variables
and use sysctl_bounded_arr() instead of sysctl_int(). Keep current
`carpctl_*' variables bounds as is, they would be adjusted with
separate diff.

ok bluhm
2024-12-19 22:10:35 +00:00
tb
3d8e7e8c72 ec_mult: use 1ULL to avoid C4334 warning on Visual Studio
The shift is between 0 and 5 bits, so it doesn't matter, but VS is short
for very st...ubborn as are its users when it comes to reporting non-issues
2024-12-19 21:05:46 +00:00
patrick
98e9fa9caf Implement regulator-based signal voltage switch support in dwmmc(4).
This should not have any functional difference on existing setups, as
so far any time this function would have been used, it would have led
to a kernel panic as it's been a NULL pointer.

This fixes bootup on the MNT Reform2 with the RK3588 module.

ok kettenis@
2024-12-19 18:02:47 +00:00
job
05a19cc6f2 Improve cleanup process
In some cases, following a fallback from RRDP to RSYNC, files are
moved to the wrong place. With this change, only rsync repositories
are considered when looking up where to move DIR_TEMP files.

repo.c requires more study, this fix might be a bandaid for a problem
not fully understood.

"put it in" claudio@ OK tb@
2024-12-19 13:23:38 +00:00
jmc
72dde9b872 received form the peer -> received from the peer 2024-12-19 06:45:21 +00:00