summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2020-07-10Add "Spleen 6x12" to wsfont, a font targetted at OLED displays.Frederic Cambus
Similar to "Spleen 5x8" it only contains the printable ASCII characters (96 glyphes). The font is 2-Clause BSD licensed and is my original creation. OK patrick@
2020-07-09Move sc->sc_link initialization closer to config_found() invocationKenneth R Westerback
like all the cool drivers do.
2020-07-09Move sc->sc_link initialization closer to config_found() invocationKenneth R Westerback
like all the cool drivers do.
2020-07-09On some laptops that have a Windows Precision Touchpad (imt) andJoshua Stein
also a trackstick or separate physical buttons, imt was claiming all report ids of the ihidev device preventing the trackstick/buttons from attaching as a separate ims device on other report ids. Just claim the report ids that imt needs and let ims attach to others it may find. Fixes two Dell Latitude laptops and tested in snaps for a bit.
2020-07-09Some touchpads don't have the "maximum number of contacts" orJoshua Stein
"button type" usages, so assume some reasonable defaults rather than failing to attach. Fixes two Dell Latitude laptops and tested in snaps for a bit.
2020-07-09Fix a warning false positive from clang 10.Todd C. Miller
blf_enc() takes a number of 64-bit blocks to encrypt, but using sizeof(uint64_t) in the calculation triggers a warning from clang 10 because the actual data type is uint32_t. Pass BCRYPT_WORDS / 2 for the number of blocks like libc bcrypt(3) does. OK kettenis@
2020-07-09another excess fileTheo de Raadt
2020-07-09drm/amdgpu/atomfirmware: fix vram_info fetching for renoirJonathan Gray
From Alex Deucher fceff9423f428a62a20bb8fb8f66e6a9f906f12c in linux 5.7.y/5.7.8 d7a6634a4cfba073ff6a526cb4265d6e58ece234 in mainline linux
2020-07-09drm/amdgpu: use %u rather than %d for sclk/mclkJonathan Gray
From Alex Deucher c337fc540bb99e476e33153a9196eba4749a707a in linux 5.7.y/5.7.8 beaf10efca64ac824240838ab1f054dfbefab5e6 in mainline linux
2020-07-09drm/amd/display: Only revalidate bandwidth on medium and fast updatesJonathan Gray
From Nicholas Kazlauskas fcb408a7282302bd8b8afc6ef8db42b4eece23ee in linux 5.7.y/5.7.8 6eb3cf2e06d22b2b08e6b0ab48cb9c05a8e1a107 in mainline linux
2020-07-09drm/amd/powerplay: Fix NULL dereference in lock_bus() on Vega20 w/o RASJonathan Gray
From Ivan Mironov 13b2fe391cac70c7746e2cb68e73d99002f1cd00 in linux 5.7.y/5.7.8 7e89e4aaa9ae83107d059c186955484b3aa6eb23 in mainline linux
2020-07-09drm/i915: Include asm sources for {ivb, hsw}_clear_kernel.cJonathan Gray
From Rodrigo Vivi 95e961c6c23c35bb9f190f8d6bd13f1606de5a48 in linux 5.7.y/5.7.8 55fd7e0222ea01246ef3e6aae28b5721fdfb790f in mainline linux
2020-07-09drm/amdgpu: fix kernel page fault issue by ras recovery on sGPUJonathan Gray
From Guchun Chen 18b1cf2968e1baa883dbdf6adef6213626beaa0f in linux 5.7.y/5.7.8 12c17b9d62663c14a5343d6742682b3e67280754 in mainline linux
2020-07-09drm/amdgpu: fix non-pointer dereference for non-RAS supportedJonathan Gray
From Evan Quan 9c33bf981fab14ffbde2635d6e3d7d0818bac5a8 in linux 5.7.y/5.7.8 a9d82d2f91297679cfafd7e61c4bccdca6cd550d in mainline linux
2020-07-09drm/amdgpu: disable ras query and iject during gpu resetJonathan Gray
From John Clements 50a8cfb0e71644f2882dbfaf93150184094245bd in linux 5.7.y/5.7.8 61380faa4b4cc577df8a7ff5db5859bac6b351f7 in mainline linux
2020-07-09drm/i915/gt: Mark timeline->cacheline as destroyed after rcu grace periodJonathan Gray
From Chris Wilson 18ad3ad0b9b35370182ae4a7dbd89a77168df19e in linux 5.7.y/5.7.8 8e87e0139aff59c5961347ab1ef06814f092c439 in mainline linux
2020-07-09drm/amd/display: Fix ineffective setting of max bpc propertyJonathan Gray
From Stylon Wang b903524c8a60a3e9d5eede7fc87f1012332b929f in linux 5.7.y/5.7.8 fa7041d9d2fc7401cece43f305eb5b87b7017fc4 in mainline linux
2020-07-09drm/amd/display: Fix incorrectly pruned modes with deep colorJonathan Gray
From Stylon Wang 60c60af1adffdc4a34f4b13acc44a02ec33169b1 in linux 5.7.y/5.7.8 cbd14ae7ea934fd9d9f95103a0601a7fea243573 in mainline linux
2020-07-09Enable spleen16x32 and spleen32x64 on armv7 for GENERIC kernels.Frederic Cambus
OK kettenis@, deraadt@, patrick@
2020-07-09adjfreq(2): limit adjustment to [-500000, +500000] ppmcheloha
When we recompute the scaling factor during tc_windup() there is an opportunity for arithmetic overflow if the active timecounter's adjfreq(2) adjustment is too large. If we limit the adjustment to [-500000, +500000] ppm the statement in question cannot overflow. In particular, we are concerned with the following bit of code: scale = (u_int64_t)1 << 63; scale += \ ((th->th_adjustment + th->th_counter->tc_freq_adj) / 1024) * 2199; scale /= th->th_counter->tc_frequency; th->th_scale = scale * 2; where scale is an int64_t. Overflow when we do: scale += (...) / 1024 * 2199; as th->th_counter->tc_freq_adj is currently unbounded. th->th_adjustment is limited to [-5000ppm, 5000ppm]. To see that overflow is prevented with the new bounds, consider the new edge case where th->th_counter->tc_freq_adj is 500000ppm and th->th_adjustment is 5000ppm. Both are of type int64_t. We have: int64_t th_adjustment = (5000 * 1000) << 32; /* 21474836480000000 */ int64_t tc_freq_adj = 500000000LL << 32; /* 2147483648000000000 */ scale = (u_int64_t)1 << 63; /* 9223372036854775808 */ scale += (th_adjustment + tc_freq_adj) / 1024 * 2199; /* scale += 2168958484480000000 / 1024 * 2199; */ /* scale += 4657753620480000000; */ 9223372036854775808 + 4657753620480000000 = 13881125657334775808, which less than 18446744073709551616, so we don't have overflow. On the opposite end, if th->th_counter->tc_freq_adj is -500000ppm and th->th_adjustment is -5000ppm we would have -4657753620480000000. 9223372036854775808 - 4657753620480000000 = 4565618416374775808. Again, no overflow. 500000ppm and -500000ppm are extreme adjustments. otto@ says ntpd(8) would never arrive at them naturally, so we are not at risk of breaking a working setup by imposing these restrictions. Documentation input from kettenis@. No complaints from otto@.
2020-07-09do not need this one eitherTheo de Raadt
2020-07-09a couple of small tweaks that shrink the kstat code.David Gwynne
saves a few hundred bytes on both amd64 and sparc64
2020-07-08Info leaks in semctl SEM_GET, the pads (unknown old contents) and base (aTheo de Raadt
RW page within allocateable space) were leaked. report from adam@grimm-co ok millert
2020-07-08Handle a few more Hypervisor traps.Mark Kettenis
2020-07-08Make membar_consumer() a plain compiler barrier in kernel on octeon.Visa Hankala
The processor does not perform speculative reads and only one of its execution pipes should issue memory accesses. As a result, loads should happen in the correct order without barrier instructions. Tested on CN5020, CN6120, CN7130 and CN7360. This diff has been in use on the octeon-based mips64 bulk build cluster for several months. Also tested in snaps for a while.
2020-07-08do not need these versions of timetc.hTheo de Raadt
2020-07-08Use CPU_IS_PRIMARY macro in identifycpu() on amd64.Frederic Cambus
OK deraadt@
2020-07-08Userland timecounter implementation for sparc64.Mark Kettenis
ok deraadt@, pirofti@
2020-07-08Clean up the amd64 userland timecounter implementation a bit:Mark Kettenis
* We don't need TC_LAST * Make internal functions static to avoid namespace pollution in libc.a * Use a switch statement to harmonize with architectures providing multiple timecounters ok deraadt@, pirofti@
2020-07-07Add opalsens(4), a driver for sensors provided by the OPAL firmware.Mark Kettenis
2020-07-07fix a copy pasto.David Gwynne
from netbsd if_ixl.c r1.39 by yamaguchi
2020-07-07Switch iwx(4) from -46 to -48 firmware.Stefan Sperling
The -48 firmware image has been available via fw_update(4) for about 4 weeks by now. It is contained in iwx-firmware-20191022p1.
2020-07-07apparently vmx(4) needs a power of 2 number of interrupts.David Gwynne
so we pass INTRMAP_POWEROF2 to intrmap_create and things are better. reported by and fixed by mark patruck. thanks :)
2020-07-07add kstat support for some of the counters the chip maintains.David Gwynne
mcx keeps a bunch of different counters relating to the port. this diff adds support for reading them off the hardware and then unpacking them into kstat_kv structs for userland to look at. jmatthew@ checked over it.
2020-07-07drm: use hi-res time to implement ktime_get(), ktime_get_real()cheloha
There seems to have been some confusion about the granularity of certain time interfaces in the Linux kernel when our DRM compatibility layer was written. To be clear: the Linux ktime_get() and ktime_get_real() interfaces are *high resolution* clocks. We should to implement them with high resolution interfaces from our own kernel. Thus, use microuptime(9) to implement ktime_get() and microtime(9) to implement ktime_get_real(). While here, ktime_get_raw_ns() should use ktime_get_raw(), not ktime_get(). Discussed with kettenis@ and jsg@. ok jsg@
2020-07-07don't try and be too clever in the kstat update timeout.David Gwynne
2020-07-07remove some old code from a previous version of the kstat diff.David Gwynne
ixl(4) is only enabled on 64bit archs, so we don't need a 32bit fallback for the 48 and 64 bit counter reads.
2020-07-07add kstat support for reading hardware counters.David Gwynne
this chip is annoyingly complicated, which is reflected in how complicated it is to read counters off the chip. while we just use ixl as a normal network interface, the chip is capable of being a switch with physical ports, virtual ports and all sorts of other functionality, and there are counters in different places for all these different pieces. in our simple setup the driver interface is mapped to a single physical port which we talk to via a single virtual switch interface. this diff adds counters on each interface for the physical port and for the virtual switch interface (vsi). the port counters show what the hardware is doing, while the vsi counters show how the driver is interacting with the chip. for things like packet counters, these numbers tend to correlate strongly, but there are some differences. if the chip drops packets cos there's no descriptors on the rx ring, that's shown in the vsi counters. problems talking to the physical network (eg, packet corruption off the wire) are reported on the port counters. on top of the chip just being complicated, reading the counters is a complicated activity on its own. because the counters can be read by multiple consumers in a virtualised environment, the counters never really get reset. they are also stored in annoyingly small fields. this means you basically have to poll the chip periodically and calculate differences between the polls to avoid losing numbers if they overflow too quickly.
2020-07-07Get rid of some rasops callbacks in efifb that only call rasopsJoshua Stein
functions in them and let rasops call them directly. From John Carmack ok kettenis
2020-07-07small typoTheo de Raadt
2020-07-07add kstat support for reading the "hardware" counters for each ring.David Gwynne
the counters happen to be a series of uint64_t values in memory, so we treat them as arrays that get mapped to a series of kstat_kv structs that are set up as 64 bit counters with either packet or byte counters as appropriate. this helps keep the code size down. while we export the counters as separate kstats per rx and tx ring, you request an update from the hypervisor at the controller level. this code ratelimits these requests to 1 per second per interface to try and debounce this a bit so each kstat read doesnt cause a vmexit. here's an example of the stats. note that we get to see how many packets that rx ring moderation drops for the first time. see the "no buffers" stat. vmx0:0:rxq:5 packets: 2372483 packets bytes: 3591909057 bytes qdrops: 0 packets errors: 0 packets qlen: 0 packets ... vmx0:0:txq:5 packets: 1316856 packets bytes: 86961577 bytes qdrops: 0 packets errors: 0 packets qlen: 1 packets maxqlen: 512 packets oactive: false ... vmx0:0:vmx-rxstats:5 LRO packets: 0 packets LRO bytes: 0 bytes ucast packets: 2372483 packets ucast bytes: 3591909053 bytes mcast packets: 0 packets mcast bytes: 0 bytes bcast packets: 0 packets bcast bytes: 0 bytes no buffers: 696 packets errors: 0 packets ... vmx0:0:vmx-txstats:5 TSO packets: 0 packets TSO bytes: 0 bytes ucast packets: 1316839 packets ucast bytes: 86960455 bytes mcast packets: 0 packets mcast bytes: 0 bytes bcast packets: 0 packets bcast bytes: 0 bytes errors: 0 packets discards: 0 packets
2020-07-07add kstats for rx queues (ifiqs) and transmit queues (ifqs).David Gwynne
this means you can observe what the network stack is trying to do when it's working with a nic driver that supports multiple rings. a nic with only one set of rings still gets queues though, and this still exports their stats. here is a small example of what kstat(8) currently outputs for these stats: em0:0:rxq:0 packets: 2292 packets bytes: 229846 bytes qdrops: 0 packets errors: 0 packets qlen: 0 packets em0:0:txq:0 packets: 1297 packets bytes: 193413 bytes qdrops: 0 packets errors: 0 packets qlen: 0 packets maxqlen: 511 packets oactive: false
2020-07-06Wire down the timekeep page. If we don't do this, the pagedaemon mayMark Kettenis
page it out and bad things will happen when we try to page it back in from within the clock interrupt handler. While there, make sure we set timekeep_object back to NULL if we fail to make the timekeep page into kernel space. ok deraadt@ (who had a very similar diff)
2020-07-06Protect the whole pipex(4) layer by NET_LOCK(). pipex(4) wasmvs
simultaneously protected by KERNEL_LOCK() and NET_LOCK() and now we have the only lock for it. This step reduces locking mess in this layer. ok mpi@
2020-07-06pipex_rele_session() frees memory pointed by `old_session_keys'. Use it inmvs
pipex_destroy_session() instead of pool_put(9) to prevent memory leak. ok mpi@
2020-07-06fix spellingTheo de Raadt
2020-07-06Save and restore FPU around signal handlers.Mark Kettenis
2020-07-06Hide most of the contents behind #ifdef _KERNEL. Reorganize the file aMark Kettenis
bit to achieve this with a single #ifdef/#endif pair.
2020-07-06IEEE1275 (Open Firmware) defines that parameter name strings can have aMark Kettenis
length of up to 31 characters. This limit is also present in the flattened device tree specification/ Unfortunately this limit isn't enforced by the tooling and there are systems in the wild that use longer strings. This includes the device trees used on POWER9 systems and has been seen on some ARM systems as well. So bump the buffer size from 32 bytes (31 + terminating NUL) to 64 bytes. Centrally define OFMAXPARAM to this value (in <dev/ofw/openfirm.h>) replacing the various OPROMMAXPARAM definition scattered around the tree to make sure the FDT implementation of OF_nextprop() uses the same buffer size as its consumers. Eliminate the static buffer in various openprom(4) implementations on FDT systems. Makes it possible to dump the full device tree on POWER9 systems using eeprom -p. ok deraadt@, visa@
2020-07-06defer access of fb_info pointer in drm_fb_helper_hotplug_event()Jonathan Gray
Fixes a regression from rev 1.24 which lead to a page fault reported by Martin Ziemer. ok stsp@