summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2023-04-26Implement dt(4) utrace support on amd64 and i386.Claudio Jeker
This adds stacktrace_save_utrace() to extract and save the userland stack which is stubbed out on most archs. alpha and riscv64 do not even implement dt(4) and stacktrace_save_at() so the stubs are excluded there. Additionally add a new ioctl DTIOCGETAUXBASE which allows btrace to fetch the AUX_BASE vallue from the AUX vector of a process. OK mpi@ (some time ago) discussed with kettenis@
2023-04-26Reodrer some things to fix vmctl/vmd builds after the vmm MI/MD splitMike Larkin
2023-04-26Remove +20y old rt_timer_init() commentKlemens Nanni
Obsolete since last year's r1.411 "Rework the rttimer code." OK claudio
2023-04-26Incorporate r1.140 and r1.141 of vmm.c:Mike Larkin
---------------------------- revision 1.341 date: 2023/04/26 09:39:56; author: dv; state: Exp; lines: +3 -3; commitid: 1XztmVbxa8OP2xYi; Unbreak vmm on Intel. Mistakenly enabled CET on non-CET systems. Found by anton@ & jsg@ ---------------------------- revision 1.340 date: 2023/04/24 16:53:57; author: dv; state: Exp; lines: +11 -1; commitid: q9qQ55f7h2gen8N4; vmm(4): allow guests to enable and use supervisor IBT. Why should hosts have all the fun? Conditionally unmask the cpuid bits for IBT and allow r/w access to the supervisor CET msr. Will need revisiting when we introduce usage of userland CET msr.
2023-04-26typofix rttimer commentKlemens Nanni
2023-04-26Integrate r1.339 of vmm.c which I missed during the previous MI/MD splitMike Larkin
--- revision 1.339 date: 2023/04/22 18:27:28; author: guenther; state: Exp; lines: +3 -3; commitid: ajtkYPSAhtJdB488; Rename the XCR0_* #defines to XFEATURE_* and add the new supervisor-state features: while all are appropriate for xsaves/xrstors, the supervisor-state features aren't for xcr0 but rather for the new XSS_MSR, making the current names kinda confusing. Add #defines for masking bits for xcr0 vs XSS. Add and report the new XSAVE_XFD xsave subfeature bit. ---
2023-04-26vmm.c -> vmm_machdep.c (remove old file)Mike Larkin
2023-04-26Fix splassert noticed by sthenBob Beck
Called wrong incore when not holding bio. ok claudio@
2023-04-26Refactor MD/MI parts of vmm.Mike Larkin
ok dv, deraadt
2023-04-26Fix my email address.Mark Kettenis
2023-04-26Properly handle userland branch target traps.Mark Kettenis
ok deraadt@, patrick@
2023-04-26Backout previous commit:Alexander Bluhm
Do not grab the `vmmaplk' recursively, prevent a self-deadlock. It causes panic: uvm_map_pageable_wire: stale map Found by regress/misc/posixtestsuite conformance/interfaces/mmap/18-1 requested by deraadt@
2023-04-26whitespace fixMike Larkin
2023-04-26Don't redeclare s, it's already there.Bob Beck
noticed by miod@ ok kettenis@
2023-04-26Fix missing splbio() needed in nfsBob Beck
ok claudio@ kettenis@
2023-04-26Unbreak vmm on Intel. Mistakenly enabled CET on non-CET systems.Dave Voutila
Found by anton@ & jsg@
2023-04-26Rotate the console in amdgpu when there is an orientation quirk.Anthony J. Bentley
ok jsg@
2023-04-26Fix typo in comment: default scalue values -> default scale valuesAnthony J. Bentley
2023-04-26Declare sendsyslog to match its man pageGreg Steuck
This simplifies syzkaller revival after the removal of __syscall. OK bluhm, millert, deraadt
2023-04-26Also set TSO flag on vlan interfaces.Jan Klemkow
with tweaks from bluhm, claudio and dlg I fine with it from claudio looks good to me from dlg ok bluhm
2023-04-25Fix white space.Alexander Bluhm
2023-04-25regenMark Kettenis
2023-04-25Add RK3588.Mark Kettenis
2023-04-25Rename ps_refcnt to ps_threadcnt in struct process and implementClaudio Jeker
P_HASSIBLING() using this count. OK mvs@ mpi@
2023-04-25zlib: sync with srcTheo Buehler
2023-04-25Exclusive net lock or mutex arp_mtx protect the llinfo_arp fields.Alexander Bluhm
So kernel lock is only needed for changing the route rt_flags. In arpresolve() protect rt_llinfo lookup and llinfo_arp modification with arp_mtx. Grab kernel lock for rt_flags reject modification only when needed. Tested by Hrvoje Popovski; OK patrick@ kn@
2023-04-25When configuring a new address on an interface, an upstream routerPeter Hessler
doesn't know where to send traffic. This will send an unsolicited neighbor advertisement, as described in RFC9131, to the all-routers multicast address so all routers on the same link will learn the path back to the address. This is intended to speed up the first return packet on an IPv6 interface. OK florian@
2023-04-25Do not attempt to write to read-only softraidKlemens Nanni
Bootloaders have no write support for softraid volumes, which manifests in, e.g. /bsd.upgrade not being stripped of its 'x' permission bit to prevent sysupgrade loops in case of upgrade failure. Set a no-write flag handled by libsa to bail out early in write calls. There should be no real behaviour change, writes just fail earlier now. i386 BIOS. Crank minor. Tested inside amd64 vmm.
2023-04-25Enable softraid(4) in the ramdisk kernel aka. make disk crypto install workKlemens Nanni
GENERIC, efiboot and installboot(8) all have softraid enabled, the manual already documents boot support for riscv64, "just" bsd.rd lacks it. (thought I had committed this months ago...) SiFive HiFive Unmatched A00. OK patrick
2023-04-25Do not attempt to write to read-only softraidKlemens Nanni
Bootloaders have no write support for softraid volumes, which manifests in, e.g. /bsd.upgrade not being stripped of its 'x' permission bit to prevent sysupgrade loops in case of upgrade failure. Set a no-write flag handled by libsa to bail out early in write calls. There should be no real behaviour change, writes just fail earlier now. sparc64 ofwboot. Crank minor. Tested on T4-2 guest domain with root on softraid.
2023-04-25vmm(4)/vmd(8): pull struct members out of vmm ioctl create struct.Dave Voutila
The object sent to vmm(4) contained file paths and details the kernel does not need for cpu virtualization as device emulation is in userland. Effectively, "pull up" the struct members from the vm_create_params struct to the parent vmop_create_params struct. This allows us to clean up some of vmd(8) and simplify things for switching to having vmctl(8) open the "kernel" file (SeaBIOS, bsd.rd, etc.) to allow users to boot recovery ramdisk kernels. ok mlarkin@
2023-04-25Do not grab the `vmmaplk' recursively, prevent a self-deadlock.Martin Pieuchot
Change the semantic of vm_map_busy() to be able to completely unlock the `vmmaplk' instead of downgrading it to a read lock in mlock(2). This is necessary because uvm_fault_wire() tries to re-grab the same lock. We now keep track of the thread currently holding the vmmap busy to ensure it can relock & unbusy the vmmap. The new pattern becomes: ....vm_map_lock(map); ....vm_map_busy(map); /* prevent other threads to grab an exclusive lock */ ....vm_map_unlock(map); .... ..../* .... * Do some stuff generally requiring a tsleep(9). .... */ .... ....vm_map_lock(map); ....vm_map_unbusy(map); /* allow other threads to make progress after unlock */ ....vm_map_unlock(map); Fix adapted from NetBSD's r1.249 of uvm/uvm_map.c. Issue reported by Jacqueline Jolicoeur exposed by a "wallet refresh" of the Monero App. Panic hand-copied below: sleep_finish() rw_enter() uvmfault_lookup() uvm_fault_check() uvm_fault() uvm_fault_wire() uvm_map_pageable_wire() sys_mlock() ok kettenis@
2023-04-25Create & use variables MRDISKTYPE and MRMAKEFSARGS like all the other buildKenneth R Westerback
makefiles. Fixes & ok kn@ No intentional functional change.
2023-04-25Enable power management for PCI devices.Patrick Wildt
ok kettenis@
2023-04-25Add suspend/resume support to pwmbl(4), so that when suspending the x13sPatrick Wildt
the display turns off and it actually looks like it's properly suspended. ok kettenis@ tobhe@
2023-04-25Disable keyboard backlight on Apple Silicon laptops on suspend,Tobias Heider
restore on wakeup. ok patrick@ kettenis@
2023-04-25Invalidate ITS caches during suspend/resume cycle to commit the changesPatrick Wildt
to the LPIs. So far we have only flipped the enable bit in the shared memory, but it turns out that the state is actually cached in the ITS. We have to send an invalidation to flush it, both after disabling and enabling the LPI. We probably also should do it after establishing an interrupt, and especially when disestablishing, e.g. for PCIe hotplug. Since we do not currently store the device/event IDs we cannot do a targeted invalidation and have to fall back to sending one that clears the whole cache to each ITS. In the future we should keep some more state per established LPI. Furthermore we currently keep a list of LPIs in each ITS instance, which means in case we have multiple ITS we will re-use LPI numbers. But since there's no relevant HW so far that has those, there's no rish to fix that. This fixes suspend/resume on x13s with NVMe+MSI. ok kettenis@
2023-04-25Do not attempt to write to read-only softraidKlemens Nanni
Bootloaders have no write support for softraid volumes, which manifests in, e.g. /bsd.upgrade not being stripped of its 'x' permission bit to prevent sysupgrade loops in case of upgrade failure. Set a no-write flag handled by libsa to bail out early in write calls. There should be no real behaviour change, writes just fail earlier now. amd64 EFI bits, other architectues to come. Crank minor. "seems sensible" jsing
2023-04-25Do not attempt to write to read-only softraidKlemens Nanni
Bootloaders have no write support for softraid volumes, which manifests in, e.g. /bsd.upgrade not being stripped of its 'x' permission bit to prevent sysupgrade loops in case of upgrade failure. Set a no-write flag handled by libsa to bail out early in write calls. There should be no real behaviour change, writes just fail earlier now. amd64 BIOS bits first, rest to come. Crank minor. "seems sensible" jsing
2023-04-25regenJonathan Gray
2023-04-25add Kingston KC3000 from Paul de WeerdJonathan Gray
and Samsung PM9B1 as found in sthen's t14 gen 3 intel
2023-04-25prof_state_toggle: keep a count of CPUs with profiling enabledScott Soule Cheloha
On MULTIPROCESSOR systems, the following sequence of kgmon(8) invocations leaves the statclock() frequency at stathz when there is still a CPU on the system where the gmon state is GMON_PROF_ON: # kgmon -c 0 -b # kgmon -c 1 -b # kgmon -c 0 -h The problem is that we aren't counting CPUs with profiling enabled. Add "gmon_cpu_count" to keep a count. Call startprofclock() for the first CPU to enable profiling and stopprofclock() for the last CPU to disable profiling.
2023-04-25addupc_intr: support adding multiple profiling ticks at onceScott Soule Cheloha
Add a third parameter to addupc_intr(), "u_long nticks". This will allow us to credit more than one profiling tick to the thread at once. Should be useful in the unusual case where the clock interrupt is masked for an extended period.
2023-04-24vmm(4): allow guests to enable and use supervisor IBT.Dave Voutila
Why should hosts have all the fun? Conditionally unmask the cpuid bits for IBT and allow r/w access to the supervisor CET msr. Will need revisiting when we introduce usage of userland CET msr. ok marlkin@
2023-04-24Remove recursive spl grabbing in vfs_bio.cBob Beck
in preparation for improvements. ok claudio@
2023-04-24Enable MSI if the node contains an msi-map, like we already do in pciecam(4).Patrick Wildt
This will make MSIs work on the Lenovo x13s as soon as an updated device tree is installed. Discussed with kettenis@
2023-04-24Update qcpon(4) compatibles to match on qcom,pmk8350-pon, which is the updatedPatrick Wildt
binding in Linux 6.3 device trees. While there, remove retrieving the register address, as the new binding has an additional register with doesn't work with a single OF_getpropint(), and since we're not using it we don't need to keep it around.
2023-04-24Hoist privilege checks furtherKlemens Nanni
in6.c already has the privilege check as early as possible, make in.c match. For unprivileged IPv4 ioctl calls with invalid args, this changes errno from E* to EPERM. OK bluhm
2023-04-24Enable branch target control flow enforcement on arm64.Mark Kettenis
ok robert@, deraadt@
2023-04-24Abuse the wxallowed flag to decide whether we should enforce branch targetMark Kettenis
or not. The idea is that since /usr/local has wxallowed by default this will enable enforcement for base while leaving ports alone for now. This will help us transition to a state where ports are properly marked and allow us to establish that base is really clean. Also add an exception for chrome. Chrome already appears to be clean on arm64 and this exception can be easily modified for testing other ports. This will screw over people that deliberately disable wxallowed on /usr/local or who don't have a separate partition for /usr/local. We think that is an acceptable compromise for the next months. ok robert@, deraadt@ (who came up with the idea)