summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2021-10-22regenJonathan Gray
2021-10-22add Intel ADL-S and ADL-P graphics ids Mesa matchesJonathan Gray
fix a GMA600 id while here
2021-10-22Remove last dangling usage of CRYPTO_F_NOQUEUE.Anton Lindqvist
ok tb@
2021-10-22Preserve pipe select(2) semantics when the other end of the pipe is gone.Anton Lindqvist
In preparation for implementing select(2) on top of kqueue. ok mpi@
2021-10-22One could end up with the wrong encoding in xenocara while having a uccAnton Lindqvist
keyboard attached and /etc/kbdtype being present. The advertised encoding of a wsmux is a bit fragile as the last attached device will dictate it. If this happens to be a ucc keyboard, KB_US will always be the advertised encoding as its encoding is immutable and /etc/kbdtype is ignored. Instead, do not advertise the encoding for ucc devices when the parent mux queries its attached devices. However, asking the device directly (i.e. bypassing the mux) still returns the encoding as wsconsctl(8) would otherwise report an error. Thanks to landry@ for the report and testing.
2021-10-21Remove more dead code related to crypto task queues.Tobias Heider
2021-10-21Remove code to run crypto operations in a task queue. The code wasTobias Heider
not reachable because all callers had set the CRYPTO_F_NOQUEUE flag. ok patrick@ mvs@ bluhm@
2021-10-21Initialize interrupts to G1NS by configuring IGROUPR and IGRPMODR. ThisPatrick Wildt
makes interrupts work with Parallels on the Apple M1. Tested by patrick@ on Ampere eMAG and MacchiatoBin Tested by fkr@ on Pinebook Pro ok kettenis@
2021-10-21Release solock() before call unp_internalize() and take it within whenVitaliy Makkoveev
access garbage collector data. This is the next step to make UNIX domain sockets locking fine grained. This also moves M_WAIT/M_WAITOK allocations out from `unp_lock' rwlock(9). The lock order between fdplock() and `unp_lock' changed and now fdplock() should be taken first. This was not required, but helps to mpi@'s knote(9) related work. ok bluhm@
2021-10-21regenJonathan Gray
2021-10-21add Gemini Lake MEI; from fkrJonathan Gray
2021-10-21Remove hifn(4), safe(4), and ubsec(4) crypto drivers. They requireAlexander Bluhm
the asynchronous crypto API which makes progress in MP difficult. The hardware is rarely available. They support only obsolete crypto algorithms. Scheduling crypto tasks via PCI is probably slower than the CPU, especailly as modern CPUs have their own accelerators.
2021-10-21Have ampintcmsi(4) go through the list of interrupt controllers to find thePatrick Wildt
correct parent. So far we were directly calling some ampintc(4) code, which is fine for regular hardware. With Parallels on the Apple M1, ampintcmsi(4) is combined with agintc(4), which is quite a surprise. Luckily both types of interrupt controllers use the same API for passing interrupt information, so we can craft one structure and both ampintc(4) and agintc(4) will happily work with it. ok kettenis@
2021-10-21Move vfs_stall_barrier() from the fd layer into vn_lock() and the vfs layer.Claudio Jeker
vfs stalling is used by suspend/resume and by vmt(4) to stall any filesystem operation from altering the state on disk. All these operations will call vn_lock and be stalled. Adjust vfs_stall_barrier() to allow the lock owner to still progress so that suspend can sync the filesystems after stalling vfs operation. OK mpi@
2021-10-21Remove duplicate variable ibytes, use plen instead.Tobias Heider
ok bluhm@
2021-10-20drm/edid: In connector_bad_edid() cap num_of_ext by num_blocks readJonathan Gray
From Douglas Anderson a7b45024f66f9ec769e8dbb1a51ae83cd05929c7 in linux 5.10.y/5.10.75 97794170b696856483f74b47bfb6049780d2d3a0 in mainline linux
2021-10-20revert vnode: remove VLOCKSWORK and check locking when vop_islocked != nullopSebastien Marie
(both kernel and userland bits) GENERIC + VFSLCKDEBUG is broken with it.
2021-10-19vnode: remove VLOCKSWORK and check locking when vop_islocked != nullopSebastien Marie
This flag is currently used to mark or unmark a vnode to actively check vnode locking semantic (when compiled with VFSLCKDEBUG). Currently, VLOCKSWORK flag isn't properly set for several FS implementation which have full locking support. This commit enable proper checking for them too (cd9660, udf, fuse, msdosfs, tmpfs). Instead of using a particular flag, it directly check if v_op->vop_islocked is nullop or not to activate or not the vnode locking checks. ok mpi@
2021-10-19vnode: do not manipulate vnode lock directlySebastien Marie
use VOP_LOCK / VOP_UNLOCK wrappers. VOP_LOCK() is prefered over vn_lock() here in order to keep equivalent code. ok mpi@ visa@ (as part of larger diff)
2021-10-19vnode: deadfs: do not call v_op->vop_lock directly, use VOP_LOCK() wrapperSebastien Marie
ok mpi@ visa@ (as part of larger diff)
2021-10-17km_alloc(9) needs to be passed a size that is a multiple of PAGE_SIZE.Patrick Wildt
ok mpi@
2021-10-17drm/amdgpu: fix gart.bo pin_count leakJonathan Gray
From Leslie Shi 621ddffb70db824eabd63d18ac635180fe9500f9 in linux 5.10.y/5.10.74 66805763a97f8f7bdf742fc0851d85c02ed9411f in mainline linux
2021-10-16Bail out early if the PCIe controller hasn't been initialized by theMark Kettenis
firmware. ok jsg@
2021-10-15Add initial 40MHz support to the iwx(4) driver.Stefan Sperling
Tested: ax200: jmc, phessler, kevlo, hrvoje, sdk, fkr, stsp, Mark Patruck ax201: jcs, stsp, Fredrik Engberg, Eric Auge
2021-10-15Revert "Implement select(2) and pselect(2) on top of kqueue."Martin Pieuchot
It introduced a regression exposed by the ssh tests. Reported by anton@
2021-10-15vnode: remove vop_generic_{,is,un}lock stub functionsSebastien Marie
These functions are only stubs (returning 0). Replace them with nullop function (same behaviour). There is no intented behaviour changes. While here, reorder some vop_islocked member in structs to be next others vop_{,un}lock members. ok visa@
2021-10-14Release solock() before call unp_externalize().Vitaliy Makkoveev
A little step forward to make UNIX domain sockets locking fine grained. The closest goal is to introduce the new rwlock(9) and use it to protect garbage collector data. This leaves existing `unp_lock' rwlock(9) which cowers the whole layer for per-socket data only and allows to replace it with per-socket `so_lock' with further diffs. Except file descriptor table unp_externalize() operates with the garbage collector data only such as `unp_rights', `unp_msgcount' directly and `unp_deferred' through unp_discard(). I want to introduce the new garbage collector rwlock(9) with the separate diff, so `unp_lock' is still taken within unp_externalize() around garbage collector data access. But right now M_WAITOK allocation removed from rwlock(9). Also useless M_WAITOK allocation and fdplock()/fdpunlock() dances removed from the error path. The `unp_lock' and fdplock() are not taken together within unp_externalize() but unp_internalize() still enforces `unp_lock' -> fdplock() lock order. This rests the only place and will be changed with the upcoming unp_internalize() and garbage collector rwlock(9) diffs. ok bluhm@
2021-10-14ip6_output_ipsec_send() may change the route embeded in struct roAlexander Bluhm
during path MTU discovery. ip6_forward() has to update its rt variable to the new route in ro. Otherwise it could operate on a freed route. from markus@
2021-10-14Implement select(2) and pselect(2) on top of kqueue.Martin Pieuchot
The given set of fds are converted to equivalent kevents using EV_SET(2) and passed to the scanning internals of kevent(2): kqueue_scan(). Those events are lazily deleted to reduce the overhard of freeing/allocating them when select(2) is called in a loop. ktrace(1) will now output the converted kevents on top of the usuals set bits to be able to find possible error in the convertion. This switch implies that select(2) and pselect(2) will now query the underlying kqfilters instead of the *_poll() routines. An increase in latency is visible, especially with UDP sockets and NET_LOCK()-contended subsystems and will be addressed in a next step. The various *_poll() routines could be removed as soon as poll(2) and ppoll(2) are also converted. Based on similar work done on DragonFlyBSD with inputs from from visa@, millert@, anton@, cheloha@, thanks! ok claudio@, bluhm@
2021-10-13Remove redundant NULL checks in IPsec which are never reached.Alexander Bluhm
ok mvs@
2021-10-13The function crypto_dispatch() never returns an error. Make itAlexander Bluhm
void and remove error handling in the callers. OK patrick@ mvs@
2021-10-13The function ipip_output() was registered as .xf_output() xformAlexander Bluhm
function. But was is never called via this pointer. It would have immediatley crashed as mp is always NULL when called via .xf_output(). Do not set .xf_output to ipip_output. This allows to pass only the parameters which are actually needed and the control flow is clearer. OK mpi@
2021-10-13The kernel crypto framework sometimes returned an error, sometimesAlexander Bluhm
the callback was called, and sometimes both. So the caller of that API could not release resources correctly. A bunch of errors can or should not happen, replace them with an assert. Remove redundant checks. crypto_invoke() should not return the error, but pass it via callback. Some old hardware drivers keep part of their inconsistency as I cannot test them. OK mpi@
2021-10-12Remove misleading uvm reference counting that isn't actually used.Mark Kettenis
Make sure uvm_obj_init() is only called once. Call uvm_obj_destroy() when we release the GEM object that wraps an uvm object for which we called uvm_obj_init(). ok mpi@, jsg@
2021-10-12Introduce a dummy uvm_obj_destroy() interface. This function will beMark Kettenis
used in the near future (by mpi@) to improve the locking for uvm objects. Introducing this function now will me allow me to call it in the appropriate place in the drm code. ok mpi@, jsg@
2021-10-12Add (minimal) accounting for wired pages in userland pmaps.Mark Kettenis
This enables enforcing of RLIMIT_MEMLOCK on powerpc64. ok mpi@
2021-10-12iwm(4): revert to use firmware v17 on Intel AC 7265.Landry Breuil
fixes instability issues seen on X1 carbon gen3 (hw rev 0x210) by anton@, mpi@ and myself. diff from stsp@ ok mpi@ stsp@
2021-10-12Make our old BSSID available to iwx_newstate_task() when roaming.Stefan Sperling
ic_bss->ni_bssid has already been overwritten once we enter iwx_newstate_task() to perform the state transitions necessary for roaming to our new access point (RUN->AUTH->ASSOC->RUN). We do however use the BSSID in commands sent to firmware. Cache our BSSID in struct iwx_node such that firmware commands keep using the old BSSID while we are still tearing things down. Switch to the new BSSID only once we start back up in iwx_auth(). This should be consistent from the firmware's point of view. Same fix as committed for iwm(4) recently.
2021-10-12Explicitly stop iwx(4) Rx block ack when roaming between access points.Stefan Sperling
This is similar to a recent fix committed to iwm(4). Unlike iwm(4) we do not need to disable Tx aggregation queues in iwx(4). Attempting to do so would cause fatal firmware errors. Tested by jmc@ and myself.
2021-10-12Remove code which was needed to support old firmware images from iwx(4).Stefan Sperling
Tested with cc-a0-63 and QuZ-a0-hr-b0-63 firmware by myself. Tested with Qu-c0-hr-b0-63 firmware by Fredrik Engberg.
2021-10-12Fix the deadlock between uvn_io() and uvn_flush() by restarting the fault.Martin Pieuchot
Do not allow a faulting thread to sleep on a contended vnode lock to prevent lock ordering issues with upcoming per-uobj lock. Also reduce the sleep value for VM_PAGER_AGAIN from 1sec to 5nsec to not add visible slowdown when starting a multi-threaded application with threads that fault on the same vnode (chromium, firefox, etc). Tested by anton@, tb@, robert@ and gnezdo@ ok anton@, tb@ Reported-by: syzbot+e63407b35dff08dbee02@syzkaller.appspotmail.com
2021-10-12Revert the fix for the deadlock between uvn_io() and uvn_flush().Martin Pieuchot
This fix (ab)use the vnode lock to serialize access to some fields of the corresponding pages associated with UVM vnode object and this will create new deadlocks with the introduction of a per-uobj lock. ok anton@
2021-10-11Add support for 802.11n 40MHz channels to the iwm(4) driver.Stefan Sperling
According to 11n MCS index tables our maximum data rate is now 300 Mbit/s at MCS 15, excluding protocol overhead. I have measured up to 200Mbit/s of effective throughput on clean 5GHz channels. The driver enables use of 40MHz channels automatically as long as the access point announces support for such channels in its beacons. In case 40MHz transmissions fail we ask firmware to retry with a 20MHz transmission. There is no integration with ifconfig yet, so use of 40MHz is not yet displayed there. In the meantime, tcpdump(8) can be used to check if the current access point supports 40MHz: tcpdump -n -i iwm0 -v -y IEEE802_11_RADIO -s 4096 type mgt and subtype beacon Channel width is displayed in the HT operation information element, where a 40MHz channels looks like this: htop=<40MHz chan X:Y ...> Tested: 7260: florian, bcallah 7265: landry 8260: bket 8265: stsp, abieber, Matthias Schmidt, Josh Rickmar, empee on mastodon 9560: stsp
2021-10-11Monitor 20/40 MHz channel width changes in beacons sent by our access pointStefan Sperling
and notify drivers when the channel width has changed.
2021-10-11Add support for 40MHz channels to net80211 RA.Stefan Sperling
For the moment we use either the 40MHz rate set or the 20 MHz one, depending on whether our peer supports 40MHz channels. If this turns out to be suboptimal we could probe the 40MHz and 20MHz rate sets separately to detect which one works better. The same applies to use of the short guard interval (SGI), which is either always on or off at the moment. Again, probing for this could be added later if needed.
2021-10-10Don't advertise MSI support if we don't have an MSI interrupt controller.Mark Kettenis
ok patrick@
2021-10-10Only check whether we have an MSI interrupt controller when we try toMark Kettenis
establish an MSI or MSI-X interrupt. Fixes establishing legacy INTx interrupts on machines without a (usable) MSI interrupt controller. ok patrick@
2021-10-10Apparently it is possible for firmware to indicate that SMCCC_VERSION isMark Kettenis
implemented but have that call return NOT_SUPPORTED. Makes no sense, but the SMCCC standard documents this and tells us to treat this as v1.0. Change the code accordingly. Turn a few checks that should always be true into KASSERTs to keep the control flow simple. ok patrick@
2021-10-09placing the same vnd underneath a vnd (with VNDIOCSET) is a lock violation,Theo de Raadt
but other circumstances are also bad, so let's block all vnd on top of vnd. While here, fix some toctou multiple-copyin of the path, and restructure the ioctl defer all softc updates to the end. ok mpi
2021-10-09No need to enable bus mastering, it's already done for us.Jonathan Matthew
from Brad