summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2023-12-19syncTheo de Raadt
2023-12-19the 4th argument of pinsyscalls() is now "number of pin elements",Theo de Raadt
not "size of the storage of the pin elements"
2023-12-19soreceive() must not hold mutex when calling sblock().Alexander Bluhm
In my recent commit I missed that sblock() may sleep while soreceive() holds the incpb mutex. Call pru_lock() after sblock(). Reported-by: syzbot+f79c896ec019553655a0@syzkaller.appspotmail.com Reported-by: syzbot+08b6f1102e429b2d4f84@syzkaller.appspotmail.com OK mvs@
2023-12-18Fix race between ifconfig destroy and ARP timer.Alexander Bluhm
After if_detach() has called if_remove(), if_get() will return NULL. Before if_detach() grabs the net lock, ARP timer can still run. In this case arptfree() should just return, instead of triggering an assertion because ifp is NULL. The ARP route will be deleted later when in_ifdetach() calls in_purgeaddr(). OK kn@ mvs@ claudio@
2023-12-18Run bind(2) system call in parallel.Alexander Bluhm
For protocols that care about locking, use the shared net lock to call sobind(). Use the per socket rwlock together with shared net lock. This affects protocols UDP, raw IP, and divert. Move the inpcb mutex locking into soreceive(), it is only used there. Add a comment to describe the current inmplementation of inpcb locking. OK mvs@ sashan@
2023-12-16Make `fuse_rd_filtops' mpsafe.Vitaliy Makkoveev
Introduce `fd_lock' rwlock(9) and use it for `fd_fbufs_in' fuse buffers queue and `fd_rklist' knotes list protection. Tested by Rafael Sadowski. Discussed with and ok from bluhm
2023-12-16Rework pflowioctl() lock dances.Vitaliy Makkoveev
Release netlock and take `sc_lock' rwlock(9) just in the beginning of pflowioctl() and do corresponding operations in the end. Use `sc_lock' to protect `sc_dying'. We need to release netlock not only to keep locks order with `sc_lock' rwlock(9), but also because pflowioctl() calls some operations like socreate() or soclose() on udp(4) socket. Current implementation has many relocking places which breaks atomicy, so merge them into one. The `sc_lock' rwlock(9) is taken during all pflowioctl() call, so `sc_dying' atomicy is not broken. Not the ideal solution, but better then we have now. Tested by Hrvoje Popovski. Discussed with and ok from sashan
2023-12-15Drop no-longer-applicable comment.Miod Vallat
2023-12-15provide the pieces for ktrace/kdump to observe pinsyscall violations.Theo de Raadt
(not used yet, because the pinsyscall changes are still being worked on) ok kettenis
2023-12-15Use inpcb table mutex to set addresses.Alexander Bluhm
Protect all remaining write access to inp_faddr and inp_laddr with inpcb table mutex. Document inpcb locking for foreign and local address and port and routing table id. Reading will be made MP safe by adding per socket rw-locks in a next step. OK sashan@ mvs@
2023-12-14Workaround for broken clang which has a broken -fno-zero-initialized-in-bssClaudio Jeker
implementation. Set nkmempages to -1 by default instead of 0 so that the value ends up in the data section. This way config(8) is able to alter the value as promised. See also: https://github.com/llvm/llvm-project/issues/74632 OK miod@
2023-12-14NKMEMPAGES_MAX_DEFAULT is no longer used. Remove it from param.h.Claudio Jeker
OK miod@
2023-12-14Bring default logic to set nkmempages into the 21st century.Claudio Jeker
The new logic is: Up to 1G physmem use physical memory / 4, above 1G add an extra 16MB per 1G of memory. Clamp it down depending on available kernel virtual address space - up and including 512M -> 64MB (macppc, arm, sh) - between 512M and 1024M -> 128MB (hppa, i386, mips, luna88k) - over 1024M clamping to VM_KERNEL_SPACE_SIZE / 4 The result is much more malloc(9) space on 64bit archs with lots of memory and large kva space. Note: amd64 only has 4G of kva and therefor nkmempages is limited to 262144 As a side-effect NKMEMPAGES_MAX and nkmempages_max are no longer used. Tested and OK miod@
2023-12-14drm/i915: Skip some timing checks on BXT/GLK DSI transcodersJonathan Gray
From Ville Syrjala f38b4e99e24cbc45084552fe50273ed847a4f511 in linux-6.1.y/6.1.68 20c2dbff342aec13bf93c2f6c951da198916a455 in mainline linux
2023-12-14drm/i915/sdvo: stop caching has_hdmi_monitor in struct intel_sdvoJonathan Gray
From Jani Nikula d9ef7b05ccd7f4f0d12b7aed2a2e5858809dd4a4 in linux-6.1.y/6.1.68 f2f9c8cb6421429ef166d6404426693212d0ca07 in mainline linux
2023-12-14drm/i915/lvds: Use REG_BIT() & co.Jonathan Gray
From Ville Syrjala cf70d62ace9070fb8be900fa87cb2e43cbc1fa9f in linux-6.1.y/6.1.68 9dd56e979cb69f5cd904574c852b620777a2f69f in mainline linux
2023-12-14drm/i915/display: Drop check for doublescan mode in modevalidJonathan Gray
From Ankit Nautiyal e6d55cf4939987eb1761cb0cbf47af233123da87 in linux-6.1.y/6.1.68 9d04eb20bc71a383b4d4e383b0b7fac8d38a2e34 in mainline linux
2023-12-14drm/amdgpu: Update EEPROM I2C address for smu v13_0_0Jonathan Gray
From Candice Li c8bf22e0d0499de0692a91290f923029230a5bd4 in linux-6.1.y/6.1.68 e0409021e34af50e7b6f31635c8d21583d7c43dd in mainline linux
2023-12-14drm/amdgpu: Add I2C EEPROM support on smu v13_0_6Jonathan Gray
From Candice Li 87509778718cffdee6412f0d39713f883208a013 in linux-6.1.y/6.1.68 b81fde0dfe402e864ef1ac506eba756c89f1ad32 in mainline linux
2023-12-14drm/amdgpu: simplify amdgpu_ras_eeprom.cJonathan Gray
From Alex Deucher 4ccb34d4313b81d6268b1e68bd9a4e7309f096f6 in linux-6.1.y/6.1.68 6246059a19d4cd32ef1af42a6ab016b779cd68c4 in mainline linux
2023-12-14drm/amdgpu: Return from switch early for EEPROM I2C addressJonathan Gray
From Luben Tuikov af6b1f1156fc2d886251a076b87243597301437c in linux-6.1.y/6.1.68 8782007b5f5795f118c5167f46d8c8142abcc92f in mainline linux
2023-12-14drm/amdgpu: Remove second moot switch to set EEPROM I2C addressJonathan Gray
From Luben Tuikov a3049c9a30131639f056a2b3db934c70ff91068a in linux-6.1.y/6.1.68 1bb745d7596d2b368fd9afb90473f3581495e39d in mainline linux
2023-12-14drm/amdgpu: Add support for RAS table at 0x40000Jonathan Gray
From Luben Tuikov 30289057ef8f8accd98ee41221c859a471f20c5c in linux-6.1.y/6.1.68 64a3dbb06ad88d89a0958ccafc4f01611657f641 in mainline linux
2023-12-14drm/amdgpu: Decouple RAS EEPROM addresses from chipsJonathan Gray
From Luben Tuikov c67c553b4dd9a315919ae8990da367523fad0e38 in linux-6.1.y/6.1.68 3b8164f8084ff7888ed24970efa230ff5d36eda8 in mainline linux
2023-12-14drm/amdgpu: Remove redundant I2C EEPROM addressJonathan Gray
From Luben Tuikov ee9efcdc76af0dcb51579aa61c5019eabce93d73 in linux-6.1.y/6.1.68 da858deab88eb561f2196bc99b6dbd2320e56456 in mainline linux
2023-12-14drm/amdgpu: Add EEPROM I2C address support for ip discoveryJonathan Gray
From Candice Li a945568638acfc7d2d95de520849857506b21252 in linux-6.1.y/6.1.68 c9bdc6c3cf39df6db9c611d05fc512b1276b1cc8 in mainline linux
2023-12-14drm/amdgpu: Update ras eeprom support for smu v13_0_0 and v13_0_10Jonathan Gray
From Candice Li f549f837b9aca23983540fc6498e19eee8b3073a in linux-6.1.y/6.1.68 bc22f8ec464af9e14263c3ed6a1c2be86618c804 in mainline linux
2023-12-14drm/amdgpu: correct the amdgpu runtime dereference usage countJonathan Gray
From Prike Liang 458affed061935948d31f5d731bbcfbff3158762 in linux-6.1.y/6.1.68 c6df7f313794c3ad41a49b9a7c95da369db607f3 in mainline linux
2023-12-14drm/amd/amdgpu: Fix warnings in amdgpu/amdgpu_display.cJonathan Gray
From Srinivasan Shanmugam 41c5dd545e765bf4677a211d3c68808d7069e4a1 in linux-6.1.y/6.1.68 93125cb704919f572c01e02ef64923caff1c3164 in mainline linux
2023-12-14drm/amdgpu: fix memory overflow in the IB testJonathan Gray
From Tim Huang 613eaee4459dfdae02f48cd02231cc177e9c37e7 in linux-6.1.y/6.1.68 6b0b7789a7a5f3e69185449f891beea58e563f9b in mainline linux
2023-12-14drm/amdgpu: correct chunk_ptr to a pointer to chunk.Jonathan Gray
From YuanShang 9046665befd6e9b9b97df458dc4c41cfe63e21d3 in linux-6.1.y/6.1.68 50d51374b498457c4dea26779d32ccfed12ddaff in mainline linux
2023-12-13Implement per-CPU caching for the page table page (vp) pool and the PTEJeremie Courreges-Anglas
descriptor (pted) pool in the [riscv64] pmap implementation. This significantly reduces the side-effects of lock contention on the kernel map lock that is (incorrectly) translated into excessive page daemon wakeups. This is not a perfect solution but it does lead to significant speedups [on the Hifive Unmatched] Improvement and commit message adapted from kettenis' rev 1.110 commit to arm64/pmap.c. ok phessler@ kettenis@
2023-12-13Fix syscall number bounds check computations.Miod Vallat
2023-12-13Unbreak; looks like a not up-to-date diff was commited )-:Miod Vallat
2023-12-13Put back variable initialization mistakenly lost in 1.162Miod Vallat
2023-12-13another syscall(2) removal chunk got lostTheo de Raadt
2023-12-12two syscall(2) removal chunks got lostTheo de Raadt
2023-12-12put pinsyscalls(2) into the "always" groupTheo de Raadt
2023-12-12syncTheo de Raadt
2023-12-12remove support for syscall(2) -- the "indirection system call" becauseTheo de Raadt
it is a dangerous alternative entry point for all system calls, and thus incompatible with the precision system call entry point scheme we are heading towards. This has been a 3-year mission: First perl needed a code-generated wrapper to fake syscall(2) as a giant switch table, then all the ports were cleaned with relatively minor fixes, except for "go". "go" required two fixes -- 1) a framework issue with old library versions, and 2) like perl, a fake syscall(2) wrapper to handle ioctl(2) and sysctl(2) because "syscall(SYS_ioctl" occurs all over the place in the "go" ecosystem because the "go developers" are plan9-loving unix-hating folk who tried to build an ecosystem without allowing "ioctl". ok kettenis, jsing, afresh1, sthen
2023-12-12slyle(9) fix. No functional changes.Vitaliy Makkoveev
2023-12-12The sigtramp was calling sigreturn(2), and upon failure exit(2), whichTheo de Raadt
doesn't make sense anymore. It is better to just issue an illegal instruction. ok kettenis, with some misgivings about inconsistant approaches between architectures. In the future we could change sigreturn(2) to never return an exit code, but always just terminate the process. We stopped this system call from being callable ages ago with msyscall(2), and there is no stub for it in libc.. maybe that's the next step to take?
2023-12-12Turn `pflowstats' statistics counters into per-CPU counters to make themVitaliy Makkoveev
mpsafe. The weird interactions around `pflow_flows' and `sc_gcounter' replaced by simple `pflow_flows' increment. Since the flow sequence is the 32 bits integer, the `sc_gcounter' type replaced by the type of uint32_t. ok bluhm sashan
2023-12-11Implement per-CPU caching for the page table page (vp) pool and the PTEMark Kettenis
descriptor (pted) pool in the arm64 pmap implementation. This significantly reduces the side-effects of lock contention on the kernel map lock that is (incorrectly) translated into excessive page daemon wakeups. This is not a perfect solution but it does lead to significant speedups on machines with many CPU cores. This requires adding a new pmap_init_percpu() function that gets called at the point where kernel is ready to set up the per-CPU pool caches. Dummy implementations of this function are added for all non-arm64 architectures. Some other architectures can probably benefit from providing an actual implementation that sets up per-CPU caches for pmap pools as well. ok phessler@, claudio@, miod@, patrick@
2023-12-11Fix the shift of status bits 2:0 to 11:9 from <<8 to <<9.Kenneth R Westerback
Fix the mask of shifted 8 bit field from 0x7f to 0xff. Allows proper decoding of status fields SCT and SC. From mlelstv@netbsd via NetBSD. ok miod@
2023-12-11Turn `pflow_softc' list into SMR list.Vitaliy Makkoveev
Since the revision 1.1182 of net/pf.c netlock is not taken while export_pflow() called from pf_purge_states(). Current locks order requires netlock to be taken before PF_LOCK(), so there is no reason to turn it back into this path only for optional export_pflow() call. The `pflowif_list' foreach loop has no context switch within, so SMR list is better than mutex(9). Tested by Hrvoje Popovski. ok sashan bluhm
2023-12-11Add ampchwm(4) a driver to access the Ampere Altra Fine-Grained Power TelemetryClaudio Jeker
This adds per core energy sensors (in Joules) and one per SoC temparature sensor. OK kettenis@ deraadt@
2023-12-11vio(4): simplify mbuf parsing with ether_extract_headers()Jan Klemkow
ok sf@
2023-12-11drm/amd/display: Fix MPCC 1DLUT programmingJonathan Gray
From Ilya Bakoulin 10ce6301009fa46ba264ed75b822115ec3ca6e67 in linux-6.1.y/6.1.66 6f395cebdd8927fbffdc3a55a14fcacf93634359 in mainline linux
2023-12-11drm/amd/display: Fix the delta clamping for shaper LUTJonathan Gray
From Harry Wentland 8332cb6c63394f32117a6f46a8cf7bedb8eec0b1 in linux-6.1.y/6.1.66 27fc10d1095f7a7de7c917638d7134033a190dd8 in mainline linux