summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
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
2024-07-12drm/amdgpu: fix the warning about the expression (int)size - lenJonathan Gray
From Jesse Zhang 3fac5aecb59336c9ae808a2cf4733f9f185e3fa2 in linux-6.6.y/6.6.39 ea686fef5489ef7a2450a9fdbcc732b837fb46a8 in mainline linux
2024-07-12drm/amdgpu: fix uninitialized scalar variable warningJonathan Gray
From Tim Huang 7e0fbceae1e671af9d91e338cc8608c9bfb7d2f1 in linux-6.6.y/6.6.39 9a5f15d2a29d06ce5bd50919da7221cda92afb69 in mainline linux
2024-07-12drm/amd/display: Fix uninitialized variables in DMJonathan Gray
From Alex Hung 8e5cbc820ab4a0029e0765b47cb2b38354b02527 in linux-6.6.y/6.6.39 f95bcb041f213a5da3da5fcaf73269bd13dba945 in mainline linux
2024-07-12drm/amd/display: Skip finding free audio for unknown engine_idJonathan Gray
From Alex Hung 95ad20ee3c4efbb91f9a4ab08e070aa3697f5879 in linux-6.6.y/6.6.39 1357b2165d9ad94faa4c4a20d5e2ce29c2ff29c3 in mainline linux
2024-07-12drm/amd/display: Check pipe offset before setting vblankJonathan Gray
From Alex Hung 96bf81cc1bd058bb8af6e755a548e926e934dfd1 in linux-6.6.y/6.6.39 5396a70e8cf462ec5ccf2dc8de103c79de9489e6 in mainline linux
2024-07-12drm/amd/display: Check index msg_id before read or writeJonathan Gray
From Alex Hung 9933eca6ada0cd612e19522e7a319bcef464c0eb in linux-6.6.y/6.6.39 59d99deb330af206a4541db0c4da8f73880fba03 in mainline linux
2024-07-12drm/amdgpu: Initialize timestamp for some legacy SOCsJonathan Gray
From Ma Jun e55077badb9054630856cbefc099ad148a446648 in linux-6.6.y/6.6.39 2e55bcf3d742a4946d862b86e39e75a95cc6f1c0 in mainline linux
2024-07-12drm/amdgpu: Using uninitialized value *size when calling amdgpu_vce_cs_relocJonathan Gray
From Jesse Zhang 855ae72c20310e5402b2317fc537d911e87537ef in linux-6.6.y/6.6.39 88a9a467c548d0b3c7761b4fd54a68e70f9c0944 in mainline linux
2024-07-12drm/amdgpu: Fix uninitialized variable warningsJonathan Gray
From Ma Jun 646e13f0a65b1930a4fa838f31bf763dbb4307a3 in linux-6.6.y/6.6.39 60c448439f3b5db9431e13f7f361b4074d0e8594 in mainline linux
2024-07-11Use atomic operations to access integers in sysctl(2).Alexander Bluhm
In sysctl_int_bounded() use atomic operations to load, store, or swap integer values. By using volatile pointers this will result in a single assembly instruction, no matter how over optimizing compilers will become. Note that this does not solve data dependency problems, nor MP problems in the kernel code using these integers. For full MP safety additional considerations, memory barriers, or locks will be needed where the values are used. But for simple integer in- and output volatile is enough. If new and old value pointers are given to sysctl, atomic swapping guarantees that userlands sees the same old value only once. There are more sysctl_int() functions that have to be adapted. OK deraadt@ kettenis@
2024-07-11Turn FBINFO_xxx defines into proper flags. Gets rid of an unwantedMark Kettenis
warning introduced by a recent commit to drm_fbdev_dma.c. ok jsg@
2024-07-11Use FEAT_RNG to feed entropy into the random subsystem like we do on amd64.Mark Kettenis
ok patrick@, deraadt@
2024-07-11umoddi3.c is now needed for libzTheo de Raadt
2024-07-10Extend DMA constraints override to include all SC8280XP and X1E80100 basedPatrick Wildt
machines. The shipped hardware containing ath11k and ath12k WiFi cards all need to have 32-bit DMA constraints enforced. ok kettenis@
2024-07-10Use AMD SEV C-bit in inital page tables setup by locore0.Alexander Bluhm
Similar to the NX-bit apply the C-bit to the PTEs built by locore0. Right now, pg_crypt is initialized to 0, so nothing will change. from hshoexer@; OK mlarkin@
2024-07-10Kill the runfast and run label and inline those bits. No functional change.Claudio Jeker
OK mpi@
2024-07-10Implement support for deeper idle states offered by PSCI. Reduces theMark Kettenis
idle power usage of the Vivobook S15 by almost 50%. ok patrick@
2024-07-10Hook up the Qualcomm UEFI Secure Application that handles EFI variables toMark Kettenis
efi(4) such that we can access EFI variables through ioctls on /dev/efi. ok patrick@
2024-07-10Missed some files in previous commit to split vmd into mi/md.Dave Voutila
Forgot `cvs add` and sys/dev/vmm/vmm.h changes.
2024-07-10use better endian swaps for populating the irq map requestJonathan Matthew
from NetBSD's if_iavf.c r1.1
2024-07-10Split vmd into mi/md parts.Dave Voutila
Makes as much of the core of vmd mi, pushing x86-isms into separate compilation units. Adds build logic for arm64, but no emulation yet. (You can build vmd, but it won't have a vmm device to connect to.) Some more cleanup probably needed around interrupt controller abstraction, but that can come as we implement more than the i8259. ok mlarkin@
2024-07-10iaq_datalen is 16 bits, so always use htole16 to populate itJonathan Matthew
from NetBSD's if_iavf.c r1.2
2024-07-10Sweep up another softdep crumb.Kenneth R Westerback
Remove #if notyet/#endif chunk that references the never-defined STATFS_SOFTUPD. ok jsg@
2024-07-10as per if_ixl.c r1.88, protect the admin queue with a muteXJonathan Matthew
cVS: ----------------------------------------------------------------------
2024-07-09Prepare pmap for using the AMD SEV C-bit to encrypt guest memory.Alexander Bluhm
The C-bit in a page table entry is used by a SEV guest to specify, which pages are to be encrypted and which not. The latter is needed to share pages with the hypervisor for virtio(4). The actual position of the C-bit within a PTE is CPU implementation dependend and needs to be determined dynamically at system boot. The position of the C-bit also determines the actual size of page frame mask. This will be provided by a separate change. To be able to use the same kernel as both host and guest, the C-bit is provided as variable similar to the NX-bit. Same holds for the page frame masks. Right now, pg_crypt is set to 0, pg_frame an pg_lgframe to PG_FRAME and PG_LGFRAME respectively. Thus the kernel works as a host system same as before. Also introduce a PMAP_NOCRYPT flag. A guest will use this with busdma to establish unencrypted mappings that can be shared with the hypervisor. from hshoexer@; OK mlarkin@
2024-07-09netlock is no longer held for SIOCSIFMEDIA and SIOCGIFMEDIA, so rely onJonathan Matthew
the kernel lock instead, as done in if_ixl.c r1.84. from Yuichiro NAITO