summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2023-10-27Forward TCP LRO disabling to parent devices.Jan Klemkow
Also disable TCP LRO on bridged vlan(4) and default for bpe(4), nvgre(4) and vxlan(4). ok bluhm@
2023-10-27Make out-of-swap checks more robust.Martin Pieuchot
Consider that the swap space is full when 99% of it is filled with pages that are no longer present in memory. This prevents deadlocks when out-of-swap if some swap ranges had I/O errors and have been marked as 'bad', or if some pages are unreachable by the pagedaemon and still holding some slots. Also introduce uvm_swapisfilled() to check if there are some free slots in the swap. Note that we consider the swap space completly filled if it is not possible to write a full cluster. This prevents deadlocks if a few slots are never allocated. ok miod@
2023-10-27Do not decrement the swap counter if the anon is associated to a "bad" slot.Martin Pieuchot
When such anon is freed its content is obviously not living in swap. ok miod@
2023-10-26add cd9660Jonathan Gray
2023-10-26make efi_getdisklabel_cd9660() handle a block size of 512 and simplifyJonathan Gray
ok yasuoka@
2023-10-25Make `vscsi_filtops' mpsafe. filt_vscsiread() checks `sc_ccb_i2t'Vitaliy Makkoveev
protected by `sc_state_mtx' mutex(9), so use it to protect `sc_klist' knotes list too. ok claudio
2023-10-24Remove bold8x16 font.Frederic Cambus
Since we have imported the IBM encoded version of "Spleen 8x16" as a replacement, there is no reason to keep it anymore. OK miod@
2023-10-24Normally context switches happen in mi_switch() but there are 3 casesClaudio Jeker
where a switch happens outside. Cleanup these code paths and make the machine independent. - when a process forks (fork, tfork, kthread), the new proc needs to somehow be scheduled for the first time. This is done by proc_trampoline. Since proc_trampoline is machine dependent assembler code change the MP specific proc_trampoline_mp() to proc_trampoline_mi() and make sure it is now always called. - cpu_hatch: when booting APs the code needs to jump to the first proc running on that CPU. This should be the idle thread for that CPU. - sched_exit: when a proc exits it needs to switch away from itself and then instruct the reaper to clean up the rest. This is done by switching to the idle loop. Since the last two cases require a context switch to the idle proc factor out the common code to sched_toidle() and use it in those places. Tested by many on all archs. OK miod@ mpi@ cheloha@
2023-10-24revert rev 1.19 'drm/radeon: Fix eDP for single-display iMac11,2'Jonathan Gray
mglocker@ reports this caused the screen to stay black on iMac11,2 when radeondrm takes over
2023-10-24Merge two equivalent if blocks.Martin Pieuchot
No functional change, ok tb@
2023-10-24Delete any existing v4 address before setting a new one. This allows usJonathan Matthew
to keep a working default route when the address changes. ok dlg@ kn@
2023-10-23Prevent wg(4) stuck on peer destruction.Vitaliy Makkoveev
While interface going down and output stopped, packets could rest in `if_snd' queue. So the (!ifq_empty(&sc->sc_if.if_snd)) condition will always be true and wg_peer_destroy() will sleep until interface became up and stuck packets transmitted. Check IFF_RUNNING flag within (!ifq_empty(&sc->sc_if.if_snd)) loop in wg_peer_destroy(). If the flag is not set that means interface is down, so drain the `if_snd' queue manually to prevent wg_peer_destroy() stuck. Problem reported and fix tested by Kirill Miazine. ok bluhm@
2023-10-22fix 40 MHz channel validation checks for the 2.4 GHz channel rangeStefan Sperling
Just like the 5 GHz channels, 2.4 GHz channels are spaced 5 MHz apart. 40 MHz wide channels hence span channels [N, N + 4] not [N, N + 1]. Adjust our secondary channel range checks accordingly.
2023-10-21ignore wide channel configs that do not appear in the 802.11ac specStefan Sperling
Wide channel configurations not listed in operating class tables of the 802.11ac spec can trigger regulatory assertion failures in iwm(4) firmware, and potentially other device firmware. Ignore non-standard channels configs such that we downgrade to 40MHz or even 20MHz to make such APs usable, albeit at lower speed. Found by dlg@ with a mikrotik AP advertising channel configs that do not appear as such in the spec: 80 MHz: |104|108|112|116| 40 MHz: |primary: 112|secondary above: 116| Either of these triggered iwm0: 0x000014FD | ADVANCED_SYSASSERT Fix tested by myself on iwx(4) AX200 and dlg@ on iwm(4) 7260. Johannes Berg helped with deciphering the error code, thanks!
2023-10-21ensure that iwm(4) uses the 80Mhz primary channel index announced in beaconsStefan Sperling
same fix was applied to iwx(4) some time ago
2023-10-20Adopt MI re-upgrade preventionKlemens Nanni
In comparison to MI boot which only cares about /bsd.upgrade's x bit, powerpc64 rdboot just wants a regular file. Require and strip u+x before execution to prevent sysupgrade(8) loops. OK kettenis
2023-10-20Adopt MI re-upgrade preventionKlemens Nanni
In comparison to MI boot which only cares about /bsd.upgrade's x bit, octeon rdboot just wants a regular file. Require and strip u+x before execution to prevent sysupgrade(8) loops. OK kettenis
2023-10-20Avoid forcible mounting a dirty filessystem. Mount such filesystemsMark Kettenis
read-only instead. This means that writing to the filesystem will fail. As a consequence chmod'ing of files in the bootloader will fail, but that will fix itself on the next clean boot. Same change as I committed to powerpc64 a few days ago. ok kn@, deraadt@
2023-10-20Avoid assertion failure when splitting mbuf cluster.Alexander Bluhm
m_split() calls m_align() to initialize the data pointer of newly allocated mbuf. If the new mbuf will be converted to a cluster, this is not necessary. If additionally the new mbuf is larger than MLEN, this can lead to a panic. Only call m_align() when a valid m_data is needed. This is the case if we do not refecence the existing cluster, but memcpy() the data into the new mbuf. Reported-by: syzbot+0e6817f5877926f0e96a@syzkaller.appspotmail.com OK claudio@ deraadt@
2023-10-20Add missing tcps_outpkttso counter to ixl(4) TSO setup.Jan Klemkow
ok bluhm@
2023-10-20Improve bad comment.Jan Klemkow
pointed out by kn@ ok kn@
2023-10-20dma-buf: add dma_fence_timestamp helperJonathan Gray
From Christian Koenig d67b5a2b97b6e8959117ff71fc2daa30e66c8290 in linux-6.1.y/6.1.59 b83ce9cb4a465b8f9a3fa45561b721a9551f60e3 in mainline linux
2023-10-20drm/amd/display: Don't set dpms_off for seamless bootJonathan Gray
From Daniel Miess f0410917561cb56f93ac8c502eb0ec94f25cafe9 in linux-6.1.y/6.1.59 23645bca98304a2772f0de96f97370dd567d0ae6 in mainline linux
2023-10-20drm/amdgpu: add missing NULL checkJonathan Gray
From Christian Koenig a61d905a86879427e330a5a66cba8b2330dac4d1 in linux-6.1.y/6.1.59 ff89f064dca38e2203790bf876cc7756b8ab2961 in mainline linux
2023-10-20drm/atomic-helper: relax unregistered connector checkJonathan Gray
From Simon Ser 0fb82afee55fc6e12f3581e87d47fd1beae36a98 in linux-6.1.y/6.1.59 2b7947bd32e243c52870d54141d3b4ea6775e63d in mainline linux
2023-10-20drm/i915: Don't set PIPE_CONTROL_FLUSH_L3 for aux invalJonathan Gray
From Nirmoy Das f175665385fe9fdd996080806aa67e666475d3d8 in linux-6.1.y/6.1.59 128c20eda73bd3e78505c574fb17adb46195c98b in mainline linux
2023-10-20add dma_fence_timestamp() for 6.1.59 drmJonathan Gray
2023-10-19Enable TCP Segmentation Offloading for ixl(4)Jan Klemkow
Tested on amd64 and sparc64. Also tested by bluhm@. ok bluhm@
2023-10-19Add IBM encoded version of "Spleen 8x16".Frederic Cambus
The font is 2-Clause BSD licensed and is my original creation. OK miod@
2023-10-18Avoid forcible mounting a dirty filessystem. Mount such filesystemsMark Kettenis
read-only instead. This means that writing to the filesystem will fail. As a consequence chmod'ing of files in the bootloader will fail, but that will fix itself on the next clean boot. ok kn@
2023-10-18Avoid segments greater than maxsegsz during map mergingJan Klemkow
Found with hints from kettenis@ Tested on Sun-Fire-V215. Also tested on U2 and UltraBook IIe by miod@ ok miod@
2023-10-18drm/amd: Fix logic error in sienna_cichlid_update_pcie_parameters()Jonathan Gray
From Mario Limonciello d2894c4f473ab71cd68ef0f9b086148bb2c02132 in linux-6.1.y/6.1.57 2a1fe39a5be785e962e387146aed34fa9a829f3f in mainline linux
2023-10-18drm/amd: Fix detection of _PR3 on the PCIe root portJonathan Gray
From Mario Limonciello c8bd3e12b3291e632ae189619169914743ba77d1 in linux-6.1.y/6.1.57 134b8c5d8674e7cde380f82e9aedfd46dcdd16f7 in mainline linux
2023-10-18drm/amd/display: Adjust the MST resume flowJonathan Gray
From Wayne Lin 71472872932b11ca2591104eb73255fecaae9d33 in linux-6.1.y/6.1.57 ec5fa9fcdeca69edf7dab5ca3b2e0ceb1c08fe9a in mainline linux
2023-10-17clockintr: move callback-specific API behaviors to "clockrequest" namespaceScott Soule Cheloha
The API's behavior when invoked from a callback function is impossible to document. Move the special behavior into a distinct namespace, "clockrequest". - Add a 'struct clockrequest'. Basically a stripped-down 'struct clockintr' for exclusive use during clockintr_dispatch(). - In clockintr_queue, replace the "cq_shadow" clockintr with a "cq_request" clockrequest. They serve the same purpose. - CLST_SHADOW_PENDING -> CR_RESCHEDULE; different namespace, same meaning. - CLST_IGNORE_SHADOW -> CLST_IGNORE_REQUEST; same meaning. - Move shadow branch in clockintr_advance() to clockrequest_advance(). - clockintr_request_random() becomes clockrequest_advance_random(). - Delete dead shadow branches in clockintr_cancel(), clockintr_schedule(). - Callback functions now get a clockrequest pointer instead of a special clockintr pointer: update all prototypes, callers. No functional change intended.
2023-10-16Consider required constraint when moving pages from active to inactive lists.Martin Pieuchot
Make sure low pages are deactivated first when there is a shortage of inactive pages. Without this the system can have a ton of high pages on the active list and never swapout anything if there's a shortage of low pages. This prevents a deadlock on amd64 reported and tested by bluhm@. ok kettenis@
2023-10-13Add Allwinner D1 support.Mark Kettenis
ok mbuhl@, patrick@, dlg@
2023-10-13enable dwqe(4) in RAMDISK_CDStefan Sperling
reminded by jsg@, snapshot test build done by me
2023-10-13Remove bold8x16-iso1 font.Frederic Cambus
This font has been unlinked from the build in January 2019 when it was replaced by Spleen 8x16. OK mpi@
2023-10-12pflog(4) logs packet dropped by default rule with block.Alexander Bluhm
If a packet is malformed, it is dropped by pf(4). The rule referenced in pflog(4) is the default rule. As the default rule is a pass rule, tcpdump printed "pass" although the packet was actually dropped. To avoid confusion, change the action to drop. Then tcpdump prints "block". OK sashan@ kn@
2023-10-12timeout: add TIMEOUT_MPSAFE flagScott Soule Cheloha
Add a TIMEOUT_MPSAFE flag to signal that a timeout is safe to run without the kernel lock. Currently, TIMEOUT_MPSAFE requires TIMEOUT_PROC. When the softclock() is unlocked in the future this dependency will be removed. On MULTIPROCESSOR kernels, softclock() now shunts TIMEOUT_MPSAFE timeouts to a dedicated "timeout_proc_mp" bucket for processing by the dedicated softclock_thread_mp() kthread. Unlike softclock_thread(), softclock_thread_mp() is not pinned to any CPU and runs run at IPL_NONE. Prompted by bluhm@. Lots of input from bluhm@. Joint work with mvs@. Prompt: https://marc.info/?l=openbsd-tech&m=169646019109736&w=2 Thread: https://marc.info/?l=openbsd-tech&m=169652212131109&w=2 ok mvs@
2023-10-11Prevent deref-after-free when tdb_timeout() fires on invalid new tdb.Tobias Heider
When receiving a pfkeyv2 SADB_ADD message, a newly created tdb can fail in tdb_init(), which causes the tdb to not get added to the global tdb list and an immediate dereference. If a lifetime timeout triggers on this tdb, it will unconditionally try to remove it from the list and in the process deref once more than allowed, causing a one bit corruption in the already freed up slot in the tdb pool. We resolve this issue by moving timeout_add() after tdb_init() just before puttdb(). This means tdbs failing initialization get discarded immediately as they only hold a single reference. Valid tdbs get their timeouts activated just before we add them to the tdb list, meaning the timeout can safely assume they are linked. Feedback from mvs@ and millert@ ok mvs@ mbuhl@
2023-10-11kernel: expand fixed clock interrupt periods to 64-bit valuesScott Soule Cheloha
Technically, all the current fixed clock interrupt periods fit within an unsigned 32-bit value. But 32-bit multiplication is an accident waiting to happen. So, expand the fixed periods for hardclock, statclock, profclock, and roundrobin to 64-bit values. One exception: statclock_mask remains 32-bit because random(9) yields 32-bit values. Update the initclocks() comment to make it clear that this is not an accident.
2023-10-11clockintr: move clockintr_schedule() into public APIScott Soule Cheloha
Prototype clockintr_schedule() in <sys/clockintr.h>.
2023-10-11Add initial support for Elkhart Lake ethernet to dwqe(4).Stefan Sperling
For now, only attach to PSE0/RGMII (device ID 0x4ba0) which is the only device I have access to for testing. There is a known problem where Tx throughput is lower than expected. This is being looked into. ok kettenis@
2023-10-11fix bitmask of GMAC4 hwfeatures1 RX FIFO sizeStefan Sperling
ok kettenis
2023-10-11clockintr_stagger: rename parameters: "n" -> "numer", "count" -> "denom"Scott Soule Cheloha
Rename these parameters to align the code with the forthcoming manpage. No functional change.
2023-10-10Correctly define GMAC_VERSION. Found by stsp@Mark Kettenis
ok stsp@
2023-10-10Ignore PCI MEM64 ranges over 4GB, since this 32-bit kernel can't use them;Miod Vallat
this prevents a DIAGNOSTIC panic when running in qemu without option "-M virt,highmem=off". Reported by and ok jsg@
2023-10-10pf(4) must not pass packet if state cannot be created.Alexander Bluhm
The behavior of the PFRULE_SRCTRACK and max_states check was unintentionally changed by commit revision 1.964. If the state was not created due to some limit had been reached, pf still passed the packet. Restore the old logic by setting action to pass later, after the checks. In pf_test_rule() action is initialized to drop. OK sashan@