summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2024-07-22Switch proc_finish_wait() to use the process as argument instead of itsClaudio Jeker
ps_mainproc. dowait6() needs to stop using ps_mainproc and this is the first step. OK guenther@
2024-07-21For AMD SEV determine C-bit position and guest mode in locore0.Alexander Bluhm
Actually determine the C-bit position if we are running as a guest with SEV enabled. Configure pg_crypt, pg_frame and pg_lgframe accordingly, using the physical address bit reduction provided by cpuid. from hshoexer@; OK mlarkin@
2024-07-21Populate hwcap and hwcap2 based on the sanitized values of the ID registerMark Kettenis
values and the feature bits that we recognize. ok naddy@, jca@
2024-07-21Export basic HWCAP bits to let applications detect Altivec & VSX on powerpc64Jeremie Courreges-Anglas
Input from miod@ and gkoehler@, tests & ok gkoehler@
2024-07-21Export basic HWCAP bits to let applications detect Altivec on powerpcJeremie Courreges-Anglas
Input from miod@ and gkoehler@, tests & ok gkoehler@
2024-07-21A few manual ret-cleans. Seeing as these pertain to interrupt servicing,Theo de Raadt
the stack utilization ends up near the the deep end of the stack where, retcleans are useful. tested for a while in snaps ok bluhm
2024-07-21Add optimized character rendering case for 6 pixels wide fonts inFrederic Cambus
rasops32_putchar(). From jon (at) elytron (dot) openbsd (dot) amsterdam.
2024-07-20Unlock udp(4) somove().Vitaliy Makkoveev
Socket splicing belongs to sockets buffers. udp(4) sockets are fully switched to fine-grained buffers locks, so use them instead of exclusive solock(). Always schedule somove() thread to run as we do for tcp(4) case. This brings delay to packet processing, but it is comparable wit non splicing case where soreceive() threads are always scheduled. So, now spliced udp(4) sockets rely on sb_lock() of `so_rcv' buffer together with `sb_mtx' mutexes of both buffers. Shared solock() only required around pru_send() call, so the most of somove() thread runs simultaneously with network stack. Also document 'sosplice' structure locking. Feedback, tests and OK from bluhm.
2024-07-20UVIDEO_DEBUG needs fcntl.hJonathan Gray
reported by Peter J. Philipp
2024-07-19Unlock sysctl net.inet.ip.redirect and net.inet6.ip6.redirect.Alexander Bluhm
Variable ip and ip6 sendredirects is only read once during packet processing. Use atomic_load_int() to access the value in exactly one read instruction. No memory barriers needed as there is no correlation with other values. Sort the ip and ip6 checks, so the difference is easier to see. Move access to global variable to the end. OK mvs@
2024-07-19Relax socket lock assertion in UDP input and send.Alexander Bluhm
OK mvs@
2024-07-18Fix typos in previous commit spotted by naddy@Mark Kettenis
2024-07-18In pfattach() pass malloc type instead of flags to cpumem_malloc().Alexander Bluhm
from markus@
2024-07-17Clean up the cpi_id_aa64xxx variables at the end of autoconf such thatMark Kettenis
sysclt(2) and ID register access emulation can share the variables. ok jca@
2024-07-17Sync struct proc P_BITS with reality.Claudio Jeker
Remove "\027XX" (old systrace flag) and "\035SOFTDEP". OK jsg@
2024-07-16match on Atom C3000Jonathan Gray
from and tested by Brendan Shanks
2024-07-15Make the touchpad on the Samsung Galaxy Book4 Edge work.Marcus Glocker
ok patrick@
2024-07-15Add ext4 field definitions. Taken from NetBSD, with some cosmeticMartijn van Duren
changes to keep it in line with our style. OK miod@
2024-07-15Add support for the RK3588 eMMC controller. This is mostly the same, withPatrick Wildt
some HS400 bits that we don't support yet. While there, fix some constants that weren't applied to the correct registers. ok dlg@
2024-07-15Add RK3588 eMMC clocks and resets.Patrick Wildt
ok dlg@
2024-07-15sync PS_BITS with flags; ok claudio@Jonathan Gray
2024-07-14Add missing <machine/elf.h> for compound arches.Miod Vallat
The spice^Wkernel must flow^Wbuild.
2024-07-14Unlock IPv6 sysctl net.inet6.ip6.forwarding from net lock.Alexander Bluhm
Use atomic operations to read ip6_forwarding while processing packets in the network stack. To make clear where actually the router property is needed, use the i_am_router variable based on ip6_forwarding. It already existed in nd6_nbr. Move i_am_router setting up the call stack until all users are independent. The forwarding decisions in pf_test, pf_refragment6, ip6_input do also not interfere. Use a new array ipv6ctl_vars_unlocked to make transition of all the integer sysctls easier. Adapt IPv4 to the new style. OK mvs@
2024-07-14Fix source and drain confusion in socket splicing somove().Alexander Bluhm
If a large mbuf in the source socket buffer does not fit into the drain buffer, split the mbuf. But if the drain buffer still has some data in it, stop moving data and try again later. This skips a potentially expensive mbuf operation. When looking which socket buffer has to be locked, I found that the length of the source send buffer was checked. Change it to drain. As this is a performance optimization for a special corner case, noone noticed the bug. OK sashan@
2024-07-14Only match if we can find a corresponding cpu device. This means theJonathan Matthew
many extra ACPI0007 instances found in current generation servers no longer fill up dmesg with noise. ok kettenis@
2024-07-14For specific hids (currently only ACPI0007, acpicpu(4)), use a printJonathan Matthew
function that always returns QUIET so instances that don't get matched are not reported. ok kettenis@
2024-07-14Actually provide *definitions* for hwcap & hwcap2Jeremie Courreges-Anglas
Double checked by kettenis@ Sorry for the time window with breakage visible on arm64 and riscv64. :-/
2024-07-14Actually set up hwcap AUX_* entries when availableJeremie Courreges-Anglas
Erroneously dropped from the last elf_aux_info(3) diff I sent on tech@. Lack of this chunk would affect arm64 and riscv64 as they're the two architectures providing hwcap*. Should have been ok kettenis@
2024-07-14In addition to setting the PCI power state, also run the appropriate _PSxMark Kettenis
method that matches the target state. ok deraadt@
2024-07-14Upon first suspend, turn off all power resources that haven't beenMark Kettenis
referenced. ok deraadt@
2024-07-14Add elf_aux_info(3)Jeremie Courreges-Anglas
Designed to let userland peek at AT_HWCAP and AT_HWCAP2 using an already existing interface coming from FreeBSD. Headers bits were snatched from there. Input & ok kettenis@ libc bump and sets sync will follow soon
2024-07-14vmm(4)/vmx: update host cr3, invept on cpu migration.Dave Voutila
Since vmm handles nested page faults in the vcpu run loop, trying to avoid trips back to userland, it's possible for the thread to move host cpus. vmm(4) already updates some local cpu state when this happens, but also needs to update the host cr3 in the vmcs to allow vmx to restore the proper cr3 value on the next vm exit. Additionally, we should be flushing the ept cache on the new cpu. If the single context flush is available, use that instead of the global flush. ok mlarkin@
2024-07-13Implement some more suspend/resume Linux compat such that inteldrm(4) canMark Kettenis
achieve RC6 and save a significant amount of power for S0i. ok jsg@
2024-07-13Revert the vdoom change, while it prevents the crashes on joel's goBob Beck
builder and avoids the ufs_inactive problems, bluhm hits panics on shutdown and filesystem unmount on the regress testers. We'll have to try the other approach of detecting the corrupted vnode perhaps.
2024-07-13Add condition to ip_gre.c in files.Alexander Bluhm
Use gre condition in conf/files for compiling netinet/ip_gre.c only if needed. Remove #if NGRE > 0 from ip_gre.c that caused ramdisk build to compile an empty C file. OK kn@ deraadt@; input jsg@
2024-07-13Mark IP protocol GRE as MP safe from socket layer.Alexander Bluhm
The pipex code in gre_send() matches more or less what udp_send() does. This has been MP safe for a long time. rip_send() is already called with PR_MPSOCKET. OK mvs@
2024-07-13Previous commit broke RAMDISK_CD kernel build. Always include udp.hAlexander Bluhm
in ip6_forward.c.
2024-07-13Do not store full IPv6 packet in common forwarding case.Alexander Bluhm
Forwarding IPv6 packets is slower than IPv4. Reason is that m_copym() is done for every packet. Just in case we may have to send an ICMP6 packet, ip6_forward() creates a mbuf copy. After that mbuf cluster is read only, so for the ethernet header another mbuf is allocated. pf NAT and RDR ignores readonly clusters, so it also modifies the potential ICMP6 packet. IPv4 ip_forward() avoids all these problems by copying the leading 68 bytes of the original packets onto the stack. More is not need for ICMP. IPv6 RFC 4443 2.4. (c) requires up to 1232 bytes in the ICMP6 packet. This cannot be copied to the stack. The reason for the difference in the standard seems to be that the ICMP6 packet has to contain the full header chain. If we have a simple TCP, UDP or ESP packet without chain, do a shortcut and just preserve the header for the ICMP6 packet. Small packets already use stack memory, large packets need extra mbuf allocation. Now truncate ICMP6 packet to a reasonable length if the original packets has a final protocol header directly after the IPv6 header. List of suitable protocols contains TCP, UDP, ESP as they cover the common cases and anything behind the header should not be needed for path MTU discovery. OK deraadt@ florian@ mvs@
2024-07-13Backout previous change related to not freeing memory on suspend.Dave Voutila
It broke resume from hibernate. :(
2024-07-12Remove internet PCB mutex.Alexander Bluhm
All incpb locking has been converted to socket receive buffer mutex. Per PCB mutex inp_mtx is not needed anymore. Also delete PRU related locking functions. A flag PR_MPSOCKET indicates whether protocol functions support parallel access with per socket rw-lock. TCP is the only protocol that is not MP capable from the socket layer and needs exclusive netlock. OK mvs@
2024-07-12Switch `so_snd' of udp(4) sockets to the new locking scheme.Vitaliy Makkoveev
udp_send() and following udp{,6}_output() do not append packets to `so_snd' socket buffer. This mean the sosend() and sosplice() sending paths are dummy pru_send() and there is no problems to simultaneously run them on the same socket. Push shared solock() deep down to sesend() and take it only around pru_send(), but keep somove() running unedr exclusive solock(). Since sosend() doesn't modify `so_snd' the unlocked `so_snd' space checks within somove() are safe. Corresponding `sb_state' and `sb_flags' modifications are protected by `sb_mtx' mutex(9). Tested and OK bluhm.
2024-07-12Simplify nvme suspend/resume by resetting queues and not deallocatingDave Voutila
memory. This removes memory allocation from the resume-side of device activation. ok deraadt@
2024-07-12manual ret-clean; ok mlarkinTheo de Raadt
2024-07-12Add pool to allocate individual rtkit task arguments instead of passing aTobias Heider
shared argument. This fixes a race condition where a message could overwrite rtkep->msg of a previously scheduled task resulting in a refcounting error later on causing the screen to stay dark after waking up from suspend. ok kettenis@
2024-07-12Run sysctl net.inet.ip.forwarding without net lock.Alexander Bluhm
The places in packet processing where ip_forwarding is evaluated have been consolidated. The remaining pieces in pf test, ip input, and icmp input do not need consistent information. If the integer value is changed by another CPU, it is harmless. The sysctl syscall sets the value atomically, so add atomic read in network processing and remove the net lock in sysctl IPCTL_FORWARDING. OK claudio@ mvs@
2024-07-12Use dedicated window for access to the PCIe core registers.Mark Kettenis
Based on a diff from Hector Martin for Asahi Linux. ok patrick@, tobhe@
2024-07-12Add vdoom() to fix ufs/ext2fs re-use of invalid vnode.Bob Beck
This was noticed by syzkiller and analyzed in isolaiton by mbuhl@ and visa@ two years ago. As the kernel has become more unlocked it has started to appear more and was being hit regularly by jsing@ on the Go builder. The problem was during reclaim of a inode the corresponding vnode could be picked up by a vget() by another thread while the inode was being cleared out in the ufs_inactive routine and the thread running ufs_inactive slept for i/o. When raced the vnode would then not have zero use count and would not be cleared out on exit from ufs_inactive with a dead/invalid vnode being used. While this could get "fixed" by checking for the race happening and trying again in the inactive routine, or by adding "yet another visible vnode locking flag" we choose to add a vdoom() api for the moment that allows the caller to block future attempts to grab this vnode until it is cleared out fully with vclean. Teste by jsing@ on the Go builder and seems to solve the issue. ok kettenis@, claudio@
2024-07-12drm/amdgpu: silence UBSAN warningJonathan Gray
From Alex Deucher 1ba66b121100862fc208848264821a788a79317f in linux-6.6.y/6.6.39 05d9e24ddb15160164ba6e917a88c00907dc2434 in mainline linux
2024-07-12drm: panel-orientation-quirks: Add quirk for Valve GalileoJonathan Gray
From John Schoenick 33de7c47a19ab1165ee2404f197de4f7e4848f23 in linux-6.6.y/6.6.39 26746ed40bb0e4ebe2b2bd61c04eaaa54e263c14 in mainline linux
2024-07-12drm/amdgpu/atomfirmware: silence UBSAN warningJonathan Gray
From Alex Deucher 004b7fe6ca8c709e8431b400c3082040b80e59cf in linux-6.6.y/6.6.39 d0417264437a8fa05f894cabba5a26715b32d78e in mainline linux