1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-21 23:18:00 -08:00
Commit Graph

91655 Commits

Author SHA1 Message Date
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
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
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
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
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
mpi
0528dcd014 Do not busy pages that are resident & fetched with PGO_LOCKED.
This is safe because the rwlock of the related object is never released until
the handler is done with the pages.

ok kettenis@, tb@
2024-12-18 16:41:27 +00:00
dlg
e541a7ae0c go back to r1.326, before i fiddled with packet generation and bpf.
i've had a couple of reports of redundant firewalls misbehaving
since these changes, so until i can figure out what's wrong i'm
backing them out.

reported by hrvoje popovski and mark patruck
2024-12-18 02:25:30 +00:00
dlg
2fbde403af let LLDP packets fall through to being handled on the port interfaces.
802.1ax says that LLDP packets sent to the multicast groups listed
in 802.1ab (the lldp spec) should be treated as "control frames"
so they can be processed by an lldp agent on physical interface.

in our situation that means we shouldn't aggregate LLDP packets so
they appear to enter the system on aggr(4) interfaces, we should
let the physical port interfaces handle them. this will allow
AF_FRAME sockets listening on aggr port interfaces receive lldp
packets.

jmatthew@ says it looks good.
2024-12-18 01:56:05 +00:00
claudio
0c9ac8635e Mark processes that are stopped because of a ptrace trap as PS_TRAPPED.
Use this flag instead of ps_single in dowait6() to decide if a process
was stopped because of a ptrace event.
OK mpi@
2024-12-17 14:45:00 +00:00
stsp
0cb476ce62 actually enable vlan tagging offload on ice(4) interfaces
Patch by brad, tested by me on E810
2024-12-17 05:32:31 +00:00
mvs
098ff4accc Unlock sysctl_video().
This sysctl(2) path contains only `video_record_enable', which is
atomically accessed boolean integer.

ok kirill mglocker
2024-12-16 21:22:51 +00:00
mvs
0a76646535 Unlock KERN_GLOBAL_PTRACE. `global_ptrace' is atomically accessed
boolean integer. Only ptrace_ctrl() loads it once outside sysctl(2)
layer.

ok mpi
2024-12-15 18:25:12 +00:00
mvs
82fe8fc4fe Make `video_filtops' mp-safe.
Replace selinfo data with klist. Introduce `sc_mtx' mutex(9) to protect
`sc_frames_data' and `sc_rklist'.

Additionally tested by Laurence Tratt.

ok kirill mglocker
2024-12-15 18:23:56 +00:00
mpi
f46a341eee Return errno values rather than dying VM_PAGER_* in the pgo_fault() interfaces.
This doesn't introduce any value change.  All errors are converted to EACCES
even if many could use EIO.

ok tb@, jsg@
2024-12-15 11:02:59 +00:00
dlg
6fb93e4770 add an AF_FRAME socket domain and an IFT_ETHER protocol family under it.
this allows userland to use sockets to send and receive Ethernet
frames. as per the upcoming frame.4 man page:

     frame protocol family sockets are designed as an alternative to bpf(4)
     for handling low data and packet rate communication protocols.  Rather
     than filtering every frame entering the system before the network stack
     like bpf(4), the frame protocol family processing avoids this overhead by
     running after the built in protocol handlers in the kernel.  For this
     reason, it is not possible to handle IPv4 or IPv6 packets with frame
     protocol sockets because the kernel network stack consumes them before
     the receive handling for frame sockets is run.

if you've used udp sockets then these should feel much the same.

my main motivation is to implement an lldp agent in userland, but
without having to have bpf look at every packet when lldp happens
every minute or two.

the only feedback i had was positive, so i'm putting it in
ok claudio@
2024-12-15 11:00:05 +00:00
mvs
3e142e7fa6 Unlock KERN_WXABORT.
`uvm_wxabort' is atomically accessed boolean integer. uvm_wxcheck()
already loads it lockless.

ok mpi
2024-12-14 12:07:38 +00:00
kirill
40dad511e1 regen 2024-12-14 10:04:51 +00:00
kirill
854ac53823 sys/usbdevs: remove unused Jabra PanaCast 20
OK mglocker@ kn@
2024-12-14 10:02:47 +00:00
kirill
e8f231c9fb sys/uvideo: remove quirk UVIDEO_FLAG_RENEGOTIATE_AFTER_SET_ALT
This quirk was introduced as a workaround, not the fix for the real
issue. The root cause was fixed in the previous commit (v1.227) to
uvide.c with skip uvideo_vs_set_alt for bulk endpoint.

OK mglocker@ kn@
2024-12-14 09:58:04 +00:00
patrick
6040dc01ee Rework and fill in the device specific handling for WCN7850. 2024-12-11 04:53:17 +00:00
dlg
09380e002e get rid of code for an extra DLT_LOOP bpf attachment.
pfsync doesnt know the source address in IP packets before it calls
ip_output, so the extra bpf attachment has a distorted view of what
IP packets are being sent anyway. you can tcpdump on the pfsync
syncdev if you want to see what will be on the wire.
2024-12-11 04:22:41 +00:00
dlg
780061c369 fix pfsync_encap to cope with pfsync_sendout changes.
problem noticed by hrvoje popovski
2024-12-11 04:18:52 +00:00
dlg
23a5083371 white space fixes, no functional change.
cvs diff -w agrees.
2024-12-11 02:00:32 +00:00
stsp
ed29f361a6 make ice(4) warn about unhandled firmware phy types
Some firmware phy types are not being mapped to ifmedia yet.
Print a message when this happens since the driver might not
work without a known media type.
The real fix will be to get missing media types mapped properly.
2024-12-10 16:07:17 +00:00
stsp
0ca5b64ce9 prevent IFM_INST_ANY from being reported in ice_media_status
IFM_INST_ANY is used as a placeholder for firmware PHY types which do
not have a mapping to ifmedia types. Don't report this value to userland.
2024-12-10 16:02:19 +00:00
patrick
c6aabb152b Set single_pdev_only for WCN7850. 2024-12-10 07:38:45 +00:00
patrick
9fa263cd58 Cleanup qwz_wmi_scan_prob_req_oui(). 2024-12-10 07:38:13 +00:00
patrick
9c0f05d8ac Initial stab at qwz_dp_cc_cleanup(), list cleanup probably missing. 2024-12-10 07:33:43 +00:00
jsg
71ffb8de38 drm/amd/pm: update current_socclk and current_uclk in gpu_metrics on smu v13.0.7
From Umio Yasuno
8a799149ab451199d6acbec37944d66b3e964573 in linux-6.6.y/6.6.64
2abf2f7032df4c4e7f6cf7906da59d0e614897d6 in mainline linux
2024-12-10 03:02:35 +00:00
jsg
a0d73938f7 drm/amdgpu: fix usage slab after free
From Vitaly Prosyak
3990ef742c064e22189b954522930db04fc6b1a7 in linux-6.6.y/6.6.64
b61badd20b443eabe132314669bb51a263982e5c in mainline linux
2024-12-10 02:58:48 +00:00
jsg
323a2b517d drm/amdkfd: Use the correct wptr size
From Lijo Lazar
70e6599a9e78384d22c3feb95da46514e5e5ee41 in linux-6.6.y/6.6.64
cdc6705f98ea3f854a60ba8c9b19228e197ae384 in mainline linux
2024-12-10 02:56:26 +00:00
jsg
4b0e85add7 drm/amd/display: Add NULL pointer check for kzalloc
From Hersen Wu
cd1e565a5b7fa60c349ca8a16db1e61715fe8230 in linux-6.6.y/6.6.64
8e65a1b7118acf6af96449e1e66b7adbc9396912 in mainline linux
2024-12-10 02:54:39 +00:00
jsg
8ca68bca0f drm/amd/display: Check phantom_stream before it is used
From Alex Hung
d247af7c5dbf143ad6be8179bb1550e76d6af57e in linux-6.6.y/6.6.64
3718a619a8c0a53152e76bb6769b6c414e1e83f4 in mainline linux
2024-12-10 02:52:40 +00:00
jsg
e1d5c04978 drm/amd/display: Add NULL check for function pointer in dcn20_set_output_transfer_func
From Srinivasan Shanmugam
8c854138b593efbbd8fa46a25f3288c121c1d1a1 in linux-6.6.y/6.6.64
62ed6f0f198da04e884062264df308277628004f in mainline linux
2024-12-10 02:50:35 +00:00
jsg
035c6335ec drm/amd/display: Check null pointer before try to access it
From Rodrigo Siqueira
ebef6616219ff04abdeb39450625f85419787ee3 in linux-6.6.y/6.6.64
1b686053c06ffb9f4524b288110cf2a831ff7a25 in mainline linux
2024-12-10 02:48:41 +00:00
jsg
3746c6d7f6 drm/amd/display: Add NULL check for clk_mgr in dcn32_init_hw
From Srinivasan Shanmugam
ec1be3c527b4a5fc85bcc1b0be7cec08bf60c796 in linux-6.6.y/6.6.64
c395fd47d1565bd67671f45cca281b3acc2c31ef in mainline linux
2024-12-10 02:45:45 +00:00
jsg
c55c328b61 drm/amd/display: Add NULL check for clk_mgr and clk_mgr->funcs in dcn30_init_hw
From Srinivasan Shanmugam
205e3b96cc9aa9211fd2c849a16245cf236b2d36 in linux-6.6.y/6.6.64
cba7fec864172dadd953daefdd26e01742b71a6a in mainline linux
2024-12-10 02:43:51 +00:00
jsg
4a839efc44 drm/amd/display: Fix null check for pipe_ctx->plane_state in hwss_setup_dpp
From Zicheng Qu
020002c76147ecfdafe95c44abd3240e216b6316 in linux-6.6.y/6.6.64
2bc96c95070571c6c824e0d4c7783bee25a37876 in mainline linux
2024-12-10 02:41:59 +00:00
jsg
631ad31c18 drm/radeon: Fix spurious unplug event on radeon HDMI
From Steven 'Steve' Kendall
756f30dc27ae8c5ee4b87cd66e026cfe5421725f in linux-6.6.y/6.6.64
7037bb04265ef05c6ffad56d884b0df76f57b095 in mainline linux
2024-12-10 02:38:05 +00:00
jsg
33a3edb177 drm/radeon: change rdev->ddev to rdev_to_drm(rdev)
From Wu Hoi Pok
5e3a0f772d97a6d50163ad7694beec823c802d54 in linux-6.6.y/6.6.64
fb1b5e1dd53fc834e12f69749cbc8484382599c4 in mainline linux
2024-12-10 02:35:56 +00:00
jsg
21ee691064 drm/radeon: add helper rdev_to_drm(rdev)
From Wu Hoi Pok
28f6a86a2f6613967e947dd116b20d3e8d97e23c in linux-6.6.y/6.6.64
a6e23bec8ed184ed2a11080b28cdbd7a3024f0c0 in mainline linux
2024-12-10 02:31:55 +00:00
jsg
e6965b2641 drm/amdkfd: Fix wrong usage of INIT_WORK()
From Yuan Can
38e3d796f65438d58791e6e75181948a63299beb in linux-6.6.y/6.6.64
21cae8debc6a1d243f64fa82cd1b41cb612b5c61 in mainline linux
2024-12-10 02:28:44 +00:00
jsg
c9876c597d drm/mm: Mark drm_mm_interval_tree*() functions with __maybe_unused
From Andy Shevchenko
2ee46de426cc9555e507afd0dc390a98e8947332 in linux-6.6.y/6.6.64
53bd7c1c0077db533472ae32799157758302ef48 in mainline linux
2024-12-10 02:26:38 +00:00
jsg
4c7926800d drm/amd/display: Add null check for pipe_ctx->plane_state in dcn20_program_pipe
From Srinivasan Shanmugam
68f75e6f08aad66069a629db8d7840919156c761 in linux-6.6.y/6.6.64
8e4ed3cf1642df0c4456443d865cff61a9598aa8 in mainline linux
2024-12-10 02:23:43 +00:00