summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2021-12-23Fix endless loop in the interrupt handler. When iterating over eachPatrick Wildt
GPIO base register we must not replace the iterator variable with the index of the pin inside the register. ok kettenis@
2021-12-23syncPhilip Guenther
2021-12-23Roll the syscalls that have an off_t argument to remove the explicit padding.Philip Guenther
Switch libc and ld.so to the generic stubs for these calls. WARNING: reboot to updated kernel before installing libc or ld.so! Time for a story... When gcc (back in 1.x days) first implemented long long, it didn't (always) pass 64bit arguments in 'aligned' registers/stack slots, with the result that argument offsets didn't match structure offsets. This affected the nine system calls that pass off_t arguments: ftruncate lseek mmap mquery pread preadv pwrite pwritev truncate To avoid having to do custom ASM wrappers for those, BSD put an explicit pad argument in so that the off_t argument would always start on a even slot and thus be naturally aligned. Thus those odd wrappers in lib/libc/sys/ that use __syscall() and pass an extra '0' argument. The ABIs for different CPUs eventually settled how things should be passed on each and gcc 2.x followed them. The only arch now where it helps is landisk, which needs to skip the last argument register if it would be the first half of a 64bit argument. So: add new syscalls without the pad argument and on landisk do that skipping directly in the syscall handler in the kernel. Keep compat support for the existing syscalls long enough for the transition. ok deraadt@
2021-12-23IPsec is not MP safe yet. To allow forwarding in parallel withoutAlexander Bluhm
dirty hacks, it is better to protect IPsec input and output with kernel lock. Not much is lost as crypto needs the kernel lock anyway. From here we can refine the lock later. Note that there is no kernel lock in the SPD lockup path. Goal is to keep that lock free to allow fast forwarding with non IPsec traffic. tested by Hrvoje Popovski; OK tobhe@
2021-12-23Get rid of unused next battery level argument.Anton Lindqvist
2021-12-23Use TAILQ_FOREACH to traverse the disk list in sysctl_diskinit().Alexander Bluhm
OK anton@
2021-12-23Disk lock was held when returning to userland. Add a missing unlockAlexander Bluhm
in vnd ioctl error path. Reported-by: syzbot+6dde3fda33074a256318@syzkaller.appspotmail.com OK jsg@ anton@
2021-12-23Template for option WITNESS is in the architecture GENERIC.MP fileAlexander Bluhm
if it is supported. Remove it from the global GENERIC config. OK visa@ claudio@
2021-12-23make array bounds in unix2dosfn() prototype match functionJonathan Gray
missed when unix2dosfn() was changed with msdosfs_conv.c rev 1.15 in 2012
2021-12-23give et_setmulti() more chance of workingJonathan Gray
ok claudio@
2021-12-22While malloc sleeps, the disk list could change during sysctl. ThenAlexander Bluhm
allocated memory could be too short for the list of disks. Retry allocating enough space until it did not change. The disk list and duid memory are protected by kernel lock. Use asserts to mark this explicitly. Reported-by: syzbot+807423f6868bbfb836bc@syzkaller.appspotmail.com OK anton@ mpi@
2021-12-22Disable minimum power consumption in hostap mode. This improves connectionTobias Heider
reliability when bwfm is used as an access point. ok patrick@
2021-12-22Consolidate enc_getif() lookups in IPsec input path to save one lookupTobias Heider
per packet and improve readability. ok bluhm@
2021-12-22drm/amdgpu: correct register access for RLC_JUMP_TABLE_RESTOREJonathan Gray
From Le Ma aec5897b277b13acd8f913d777654d4d092a24f1 in linux 5.10.y/5.10.88 f3a8076eb28cae1553958c629aecec479394bbe2 in mainline linux
2021-12-22drm/amd/pm: fix a potential gpu_metrics_table memory leakJonathan Gray
From Lang Yu 222cebd995cdf11fe0d502749560f65e64990e55 in linux 5.10.y/5.10.88 aa464957f7e660abd554f2546a588f6533720e21 in mainline linux
2021-12-22%Lx -> %llx kernel printf does not support %LxJonathan Gray
2021-12-21Fix a typo in mlock(2) error path triggering a double-free.Martin Pieuchot
Pass the correct entry to uvm_fault_unwire_locked(). Reported-by: syzbot+bb2f63f076618e9ed0d3@syzkaller.appspotmail.com ok kettenis@, deraadt@
2021-12-21Move checks on attach arguments from attach into match.Mark Kettenis
ok anton@, deraadt@
2021-12-21knf nitsAnton Lindqvist
2021-12-21Do not print "dt: 451 probes" at boot in dmesg. Btrace device dt(4)Alexander Bluhm
is enabled by default, this line does not provide much information. requested by kettenis@ deraadt@; OK mpi@
2021-12-21avoid returning uninitialised var in hidpp_send_report()Jonathan Gray
ok anton@
2021-12-21Let malloc return an error as opposed of panicking when sysctlAnton Lindqvist
kern.shminfo.shmseg is set to something ridiculously large. ok kettenis@ millert@ Reported-by: syzbot+9f1b201cdbc97b19c7f5@syzkaller.appspotmail.com
2021-12-21Fix another vnd race pointed out by mpi@ and make sure to not unlock theAnton Lindqvist
vnode twice in the error path. Tested in snaps for a couple of days.
2021-12-21Ensure that the disk has been initialized after acquiring the lock andAnton Lindqvist
not before as we might end up sleeping while acquiring the lock, introducing a potential race. Tested in snaps for a couple of days. ok mpi@ Reported-by: syzbot+c87cdc2905b441c20d39@syzkaller.appspotmail.com
2021-12-21Rename local variable intrfn to intr, matches what dev/fdt/com_fdt.cAnton Lindqvist
already does.
2021-12-21Do not attach com at acpi when there's no address or irq present. FixesAnton Lindqvist
a regression caused by the recent change to start attaching com at acpi as it turns out that Libreboot exposes console devices lacking crucial data in their acpi tables. The same console attaches fine over isa, therefore restore this behavior. Problem reported by <cipher-hearts at riseup dot net> on bugs@ ok deraadt@ kettenis@
2021-12-21errno overhaul, getting rid of some ambiguity. In the hopes of trackingAnton Lindqvist
down a rare but annoying problem related to remote coverage exposed by syzkaller.
2021-12-20Remove useless suser assert from dt(4). The ioctl(2) path checksAlexander Bluhm
the user anyway and close(2) may crash after setuid(2). Reported-by: syzbot+90e094f33d329fb2c3ab@syzkaller.appspotmail.com OK deraadt@
2021-12-20bus_dmamem_unmap() should not be called from interrupt context, so freePatrick Wildt
and close flowrings using bwfm_do_async(). Reported by and ok kettenis@
2021-12-20Remove unused variable 'clen'.Tobias Heider
ok bluhm@
2021-12-20Make filt_dead() selectively inactive with EVFILT_EXCEPTVisa Hankala
When a knote uses the dead event filter, the knote's file descriptor is not supposed to point to an object with pending out-of-band data. Make the knote inactive so that userspace will not receive a spurious event. However, kqueue-based poll(2) should still receive HUP notifications. This lets the system use dead_filtops with less strings attached relative to the filter type.
2021-12-20Let poll(2) register EVFILT_EXCEPT filter with dead vnodesVisa Hankala
This enables the system deliver POLLHUP when pollfd.events == 0.
2021-12-20Run seltrue/dead event filter in modify and process callbacksVisa Hankala
Do not assume event status in the modify and process callbacks. Instead always run the event filter so that it has a chance to set knote flags. The filter can also indicate event inactivity.
2021-12-20Use per-CPU counters for tunnel descriptor block (TDB) statistics.Vitaliy Makkoveev
'tdb_data' struct became unused and was removed. Tested by Hrvoje Popovski. ok bluhm@
2021-12-20Fix function name in panic string.Alexander Bluhm
2021-12-20Make iwm(4) attach to PCI devices with product ID 0x31dc.Stefan Sperling
This device is part of the 9560 chip family. With a small device-specific quirk we can make iwm(4) attach and provide a working wifi interface. Problem reported and fix tested by Joao Victor.
2021-12-20regenStefan Sperling
2021-12-20Change a PCI device string: The "Gemini Lake CNVi" is an iwm(4) "AC 9560".Stefan Sperling
ok hastings@ (who submitted the original string, based on a datasheet)
2021-12-20Make mtw(4) known to the config(8) framework.hastings
Not enabled yet. Pending firmware availability. ok stsp@ jmatthew@
2021-12-20Add mtw(4), a driver for MediaTek MT7601U wifi devices.hastings
Ported from run(4) with legacy chipsets removed. Not yet enabled in the build. ok stsp@ jmatthew@
2021-12-20Rework the tx path to use the consumer and producer positions to work outJonathan Matthew
the number of slots available, and to put packets on the ring until fewer than DWGE_NTXSEGS slots are left, making dwge_start() and dwge_txeof() work independently. While here, only write to GMAC_TX_POLL_DEMAND once per call to dwge_start() rather than once per packet. Adjust the rx interrupt path to check the number of slots in use and return slots once per interrupt. Add interrupt and ifq barriers before taking the interface down. With all of this done, we can mark dwge(4) mpsafe. ok dlg@ patrick@
2021-12-19Add an implementation for the protocol to communicate with coprocessorsMark Kettenis
running firmware based Apple's RTKit OS. Use this code to bring up the storage controller that implements Apple's flavour of NVMe. ok dlg@, patrick@
2021-12-19There are occasions where the walker function in tdb_walk() mightAlexander Bluhm
sleep. So holding the tdb_sadb_mtx() when calling walker() is not allowed. Move the TDB from the TDB-Hash to a temporary list that is protected by netlock. Then unlock tdb_sadb_mtx and traverse the list to call the walker. OK mvs@
2021-12-19Enable aplmbox(4).Mark Kettenis
2021-12-19whitespaceMark Kettenis
2021-12-19Reduce the overhead of all trace routines by returning as early asAnton Lindqvist
possible in kd_curproc().
2021-12-19fix setting palette with 8bpp fb used on 8mb partsJonathan Gray
2021-12-19fix radeondrm console colours on sparc64Jonathan Gray
Directly do register writes in the sparc64 specific radeondrm_setcolor() instead of trying to pass colour values via crtc->gamma_store. With these changes the console changes from white text on a black background to black text on a white background. Only older radeon families are handled and crtc selection is skipped as with radeonfb. Both of the sun radeon parts fall into this family < CHIP_RS600 path. xvr-100 (0x1002:0x5159 pci rv100) xvr-300 (0x1002:0x5b64 pcie rv380) Tested on a Sun Blade 100 with XVR-100 by Ted Bullock who also helped with the patch.
2021-12-19drm/amd/display: add connector type check for CRC source setJonathan Gray
From Perry Yuan f35f7f04aa80587bfe00c5e679df054918e79a63 in linux 5.10.y/5.10.87 2da34b7bb59e1caa9a336e0e20a76b8b6a4abea2 in mainline linux
2021-12-19drm/amd/display: Fix for the no Audio bug with Tiled DisplaysJonathan Gray
From Mustapha Ghaddar dd3cea3425226565c959a1a6b1a1cce2e3394713 in linux 5.10.y/5.10.87 5ceaebcda9061c04f439c93961f0819878365c0f in mainline linux