summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2019-12-26enable shrinker for ttmJonathan Gray
ok kettenis@
2019-12-25Replace macros knote_alloc() and knote_free() with direct use ofVisa Hankala
pool_get() and pool_put(). This makes it clearer that the knote allocation cannot fail and that the error check is unnecessary. OK anton@, kettenis@, mpi@
2019-12-25Use FOREACH macro to iterate over mnt_vnodelist.Alexander Bluhm
OK millert@ visa@ benno@
2019-12-25WSDISPLAYIO_GTYPE is u_int not intJonathan Gray
2019-12-25Hook up the shrinker for inteldrm(4). This is a "light" version that onlyMark Kettenis
drops graphics buffers that are cached and not in active use. Help from beck@ for pointing out how to hook this up to our pagedaemon. ok jsg@
2019-12-25Condense a few multi line comments into single line ones. While hereanton
turn them into proper sentences. Gets rid of 27 lines in total.
2019-12-25Protect remaining fields of `struct pipe' using the pipe_lock. In orderanton
to simplify the locking pattern, revert back to using a hand-rolled I/O lock just like FreeBSD and NetBSD does. The state of pipes is quite different compared to when I made use of a rwlock for the I/O lock in revision 1.96. Most notably, the pipe_lock can now be used while sleeping. This does imply that witness(4) tracking of the I/O lock is lost but the implementation ends up being simpler. ok visa@
2019-12-25TIMEOUT_INITIALIZER(9): C99 initializerscheloha
2019-12-25timeout(9): new flag: TIMEOUT_SCHEDULED, new statistic: tos_scheduledcheloha
This flag is set whenever a timeout is put on the wheel and cleared upon (a) running, (b) deletion, and (c) readdition. It serves two purposes: 1. Facilitate distinguishing scheduled and rescheduled timeouts. When a timeout is put on the wheel it is "scheduled" for a later softclock(). If this happens two or more times it is also said to be "rescheduled". The tos_rescheduled value thus indicates how many distant timeouts have been cascaded into a lower wheel level. 2. Eliminate false late timeouts. A timeout is not late if it is due before softclock() has had a chance to schedule it. To track this we need additional state, hence a new flag. rprocter@ raises some interesting questions. Some answers: - This interface is not stable and name changes are possible at a later date. - Although rescheduling timeouts is a side effect of the underlying implementation, I don't forsee us using anything but a timeout wheel in the future. Other data structures are too slow in practice, so I doubt that the concept of a rescheduled timeout will be irrelevant any time soon. - I think the development utility of gathering these sorts of statistics is high. Watching the distribution of timeouts under a given workflow is informative. ok visa@
2019-12-24Fill in names for consbufsize and consbuf sysctl for nicer kdump(1)Alexander Bluhm
output.
2019-12-24The console buffer is allocated during startup. initconsbuf() isAlexander Bluhm
only called from main(). There allocation must not fail, so better use M_WAITOK and remove error handling. As it is not a temporary buffer, M_TTYS is more appropriate. OK deraadt@ mpi@
2019-12-24regenVisa Hankala
2019-12-24Unlock nanosleep(2).Visa Hankala
OK cheloha@, anton@, mpi@
2019-12-23fix broken tree. sorry for inconveniences.Alexandr Nedvedicky
2019-12-23rdr-to with loopback destination should work even thoughAlexandr Nedvedicky
IP forwarding is disabled. Issue reported by Daniel Jakots (danj@) OK bluhm@
2019-12-23Machines with many CPUs and long feature lists fill up the dmesg(8)Alexander Bluhm
during kernel startup before syslogd(8) can receive it. Increase message buffer size from 94k to 128k on amd64. reported by Hrvoje Popovski; OK deraadt@
2019-12-23The boot loader allows to inspect memory with the hexdump command.Alexander Bluhm
Document the new feature in boot(8) man page. OK jmc@ deraadt@
2019-12-23when aggr(4) comes up, check port link state to push the rxm forward.David Gwynne
this lets aggr come up on boot if there's a race with it being brought up and the ports being up. reported by holger glaess on misc@ and debugged with hrvoje popovski. tested by hrvoje popovski too.
2019-12-23Add amdgpio(4), a driver for the GPIO controller found on newer AMDMark Kettenis
AMD SoCs/chipsets. From James Hastings
2019-12-22midi(4): *sleep(9) -> *sleep_nsec(9)cheloha
These are straightforward except for the tsleep(9) conversion. ratchov@ had a bit to say about that code: https://marc.info/?l=openbsd-tech&m=157665936017373&w=2 > The problem is that close(2) may reset the transmitter before the few > bytes of its internal buffer is sent on the wire; there's no "wait for > completion" feature in such simple hardware, so we just wait few > milliseconds. > > The transmitter buffer size is around 16 bytes, the byte rate is 3125 > bytes/second. So if we wait at least 16B / 3125B/s = 5.12ms, we're > safe. Waiting 10ms-20ms is enough and is unnoticeable. Hence, in this diff we wait a flat 20ms in that situation. ok ratchov@
2019-12-22Wire up ipmi(4).Mark Kettenis
ok deraadt@
2019-12-22drm/radeon: fix r1xx/r2xx register checker for POT texturesJonathan Gray
From Alex Deucher 33c1d3bc1d5e1062844a31acc85eb50f9447f006 in linux 4.19.y/4.19.91 008037d4d972c9c47b273e40e52ae34f9d9e33e7 in mainline linux
2019-12-21Fix DDR4 DIMM size calculation.Mark Kettenis
ok claudio@
2019-12-20Convert various boolean_t/TRUE/FALSE to int/1/0 in mips64 memory code.Visa Hankala
OK mpi@
2019-12-20Replace a lonely TRUE.Visa Hankala
OK mpi@
2019-12-20Convert boolean_t/TRUE/FALSE to int/1/0 in mips64 pmap.Visa Hankala
Rename variables for clarity while here. OK mpi@
2019-12-20Fix build.Visa Hankala
2019-12-20Make iwm(4) clear/set selected bits in the HW_IF_CONFIG register, ratherStefan Sperling
than writing a hard-coded bit pattern to this register. Matches what Intel's Linux driver does, so it should be the right thing to do. Tested on 8265 by Tracey Emery and myself.
2019-12-20Make athn(4) use a constant Tx retry rate while MiRA is probing.Stefan Sperling
Matches what iwm(4) has been doing for a long time to ensure that a good initial Tx rate will be chosen. Tested by Tracey Emery on AR9281.
2019-12-20Ignore new Rx block ack agreements until the WPA handshake is done.Stefan Sperling
Some peers will eagerly try to negotiate block ack (asking us to reserve buffer space) before they are done authenticating themselves. No thanks. Just let them try again later. ok mpi@
2019-12-20Have net80211 actually update the Rx block ack sequence number window,Stefan Sperling
as well as pulling frames off the Rx block ack reordering queue, when an incoming frame above the current seqnum window forces us to slide the window forward, potentially losing frames within the old window. Leaving the seqnum window out of sync with the queue would cause needlessly long stalls in traffic until the window moved again for some other reason. Problem observed on lossy wifi whenever netstat -W indicated an increasing "input block ack window slides" counter. With this fix, stalled frames can be observed only for a relatively short amount of time whenever one or more frames in the current window are lost. ok mpi@
2019-12-20Disable TSX when MSR_ARCH_CAPABILITIES sets TSX_CTRL.Jonathan Gray
Even with the latest microcode this is not set on all CPUs with TSX, but is set on CPUs which don't need MDS mitigations. MDS mitigations also mitigate TSX Asynchronous Abort (TAA) but aren't done if the CPU claims to not be affected by MDS (MDS_NO). According to "Deep Dive: Intel Transactional Synchronization Extensions (Intel TSX) Asynchronous Abort" CPUs requiring additional mitigations for this are: 06-8e-0c Whiskey Lake (ULT refresh) 06-55-0{6,7} 2nd Gen Xeon Scalable Processors based on Cascade Lake 06-9e-0d Coffee Lake R Currently TSX is disabled unconditionally when possible even if TAA_NO is set. We don't currently do MDS mitigations on i386. Attempt to disable TSX regardless to match amd64.
2019-12-20Disable TSX when MSR_ARCH_CAPABILITIES sets TSX_CTRL.Jonathan Gray
Even with the latest microcode this is not set on all CPUs with TSX, but is set on CPUs which don't need MDS mitigations. MDS mitigations also mitigate TSX Asynchronous Abort (TAA) but aren't done if the CPU claims to not be affected by MDS (MDS_NO). According to "Deep Dive: Intel Transactional Synchronization Extensions (Intel TSX) Asynchronous Abort" CPUs requiring additional mitigations for this are: 06-8e-0c Whiskey Lake (ULT refresh) 06-55-0{6,7} 2nd Gen Xeon Scalable Processors based on Cascade Lake 06-9e-0d Coffee Lake R Currently TSX is disabled unconditionally when possible even if TAA_NO is set. ok bluhm@ guenther@ deraadt@ tested by bluhm@ on i5-8365U (06-8e-0c).
2019-12-19spelling; from bryan stensonJason McIntyre
2019-12-19Start protecting the pipe_peer member of `struct pipe' using theanton
pipe_lock. This add a potential sleeping point in the kqueue filter routines which should be fine by now thanks to changes made to the kqueue subsystem by visa. ok visa@
2019-12-19Convert boolean_t/TRUE/FALSE to int/1/0 for coherency with the rest ofMartin Pieuchot
the kernel. ok patrick@
2019-12-19Convert boolean_t/TRUE/FALSE to int/1/0 for coherency with the rest ofMartin Pieuchot
the kernel. ok mlarkin@, visa@
2019-12-19Convert boolean_t/TRUE/FALSE to int/1/0 for coherency with the rest ofMartin Pieuchot
the kernel. ok mlarkin@, visa@
2019-12-19Convert infinite sleeps to {m,t}sleep_nsec(9).Martin Pieuchot
ok visa@
2019-12-19poll handlers must return a poll(2) revents value, not errno(2) values.Reyk Floeter
Some drivers have returned ENXIO (6) if the device is not available which incorrectly translates into POLLPRI|POLLOUT (2|4) in userland. Change it to POLLERR for now, but it might as well be POLLHUP. OK mpi@
2019-12-19Add size for free() in vio(4).Frederic Cambus
There is an existing allocsize variable tracking size of allocations, turns out we can pass it to free in the error path. OK florian@, mpi@
2019-12-19Use bus_size_t as the type for the base address.Mark Kettenis
ok deraadt@, dlg@
2019-12-18Set vm_map's pmap in uvm_map_setup().Visa Hankala
OK guenther@, kettenis@, mpi@
2019-12-18Mask high bits of iwm(4) firmware SYSASSERT codes before matchingStefan Sperling
against codes in the known-codes table, like Linux does it. Mark the known-codes table static so it won't ever collide with symbols declared elsewhere in the kernel. Also add some more cause codes found in iwlwifi. I still keep hitting firmware SYSASSERT codes that aren't declared in this table, though :( These changes only affect IWM_DEBUG builds.
2019-12-18Re-enable firmware-based Tx retries at lower rates for iwm(4).Stefan Sperling
Firmware-based Tx retries were disabled when it was found that MiRA makes better choices while probing with a constant Tx retry rate. Before that change, high Tx rates looked better than they actually were. The change resulted in less retries and thus higher throughput because a lower, but actually working, initial Tx rate eventually became the preferred choice. However, disallowing retries at lower rates also resulted in increased amounts of observable packet loss, especially while the connection to the AP was still fresh and bad Tx rates had not been discovered yet. To get the best of both worlds, use a constant Tx rate for retries while MiRA is probing and otherwise allow firmware fallback to lower rates. tested by Tracey Emery, pamela, jasper, and myself, on 7265/8265/9260
2019-12-18Allow pagefault_disable() to be called recursively, something that may happenMark Kettenis
in inteldrm(4). ok guenther@
2019-12-18Use separate rwlock initializations for userland ("vmspace") and kernelMark Kettenis
maps. This lets witness know that these really are different classes avoiding false positives when detecting lock order reversals. ok guenther@, visa@, mpi@
2019-12-18typoTheo de Raadt
2019-12-18undo assumptions about MI .h inclusionsTheo de Raadt
2019-12-18audio(4): msleep(9) -> msleep_nsec(9)cheloha
ok ratchov@