CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: d...@cvs.openbsd.org2020/07/06 22:42:36 Modified files: sys/dev/pci: if_mcx.c Log message: add kstat support for some of the counters the chip maintains. 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.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: chel...@cvs.openbsd.org 2020/07/06 22:05:25 Modified files: sys/dev/pci/drm/include/linux: ktime.h timekeeping.h Log message: drm: use hi-res time to implement ktime_get(), ktime_get_real() 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@
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: dera...@cvs.openbsd.org 2020/07/06 20:47:21 Modified files: usr.bin/ssh: monitor.c session.c Log message: correct recently broken comments
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: d...@cvs.openbsd.org2020/07/06 20:45:58 Modified files: sys/dev/pci: if_ixl.c Log message: don't try and be too clever in the kstat update timeout.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: d...@cvs.openbsd.org2020/07/06 20:42:02 Modified files: sys/dev/pci: if_ixl.c Log message: remove some old code from a previous version of the kstat diff. ixl(4) is only enabled on 64bit archs, so we don't need a 32bit fallback for the 48 and 64 bit counter reads.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: d...@cvs.openbsd.org2020/07/06 20:38:56 Modified files: sys/dev/pci: if_ixl.c Log message: add kstat support for reading hardware counters. 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.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: j...@cvs.openbsd.org2020/07/06 20:13:13 Modified files: sys/arch/amd64/amd64: efifb.c Log message: Get rid of some rasops callbacks in efifb that only call rasops functions in them and let rasops call them directly. >From John Carmack ok kettenis
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: dera...@cvs.openbsd.org 2020/07/06 20:01:43 Modified files: sys/kern : kern_exec.c Log message: small typo
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: d...@cvs.openbsd.org2020/07/06 19:36:49 Modified files: sys/dev/pci: if_vmx.c if_vmxreg.h Log message: add kstat support for reading the "hardware" counters for each ring. 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
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: d...@cvs.openbsd.org2020/07/06 18:00:03 Modified files: sys/net: ifq.c ifq.h Log message: add kstats for rx queues (ifiqs) and transmit queues (ifqs). 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
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: kette...@cvs.openbsd.org2020/07/06 15:41:56 Modified files: sys/kern : kern_exec.c Log message: Wire down the timekeep page. If we don't do this, the pagedaemon may 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)
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: m...@cvs.openbsd.org2020/07/06 14:37:51 Modified files: sys/net: if_pppx.c pipex.c pipex.h pipex_local.h Log message: Protect the whole pipex(4) layer by NET_LOCK(). pipex(4) was 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@
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: st...@cvs.openbsd.org 2020/07/06 14:29:41 Modified files: distrib/sets/lists/comp: md.alpha md.amd64 md.arm64 md.armv7 md.hppa md.i386 md.landisk md.loongson md.luna88k md.macppc md.octeon md.powerpc64 md.sgi md.sparc64 mi Log message: sync; various $ARCH/timetc.h files to md.*
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: m...@cvs.openbsd.org2020/07/06 14:28:38 Modified files: sys/net: pipex.c Log message: pipex_rele_session() frees memory pointed by `old_session_keys'. Use it in pipex_destroy_session() instead of pool_put(9) to prevent memory leak. ok mpi@
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: dera...@cvs.openbsd.org 2020/07/06 13:22:41 Modified files: sys/uvm: uvm_map.c Log message: fix spelling
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: dera...@cvs.openbsd.org 2020/07/06 11:54:14 Modified files: distrib/sets/lists/comp: mi Log message: sync
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: kette...@cvs.openbsd.org2020/07/06 11:43:23 Modified files: sys/arch/powerpc64/include: signal.h sys/arch/powerpc64/powerpc64: machdep.c Log message: Save and restore FPU around signal handlers.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: schwa...@cvs.openbsd.org2020/07/06 11:25:00 Modified files: lib/libc/stdio : printf.3 Log message: Minor tweaks in the description of %g: 1. Clarify that %G uses %F, not %f; noticed by millert@. 2. Mention that %g originally meant "general notation", see: https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/libc/stdio/doprnt.s Triggered by a somewhat different patch from Ian . Feedback and OK millert@ and jmc@.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: dera...@cvs.openbsd.org 2020/07/06 11:11:29 Modified files: usr.bin/ftp: util.c Log message: in 2014 I added this annotation: /* XXX floating point printf in signal handler */ our snprintf is reentrant safe except for floating point. Break the double apart into integer.integer notation, to avoid that. ok kettenis millert
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: k...@cvs.openbsd.org2020/07/06 10:28:00 Modified files: usr.bin/top: machine.c Log message: Use mnemonic KERN_PROC_ALL not literal zero No object change.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: kette...@cvs.openbsd.org2020/07/06 09:47:42 Modified files: sys/arch/powerpc64/include: pmap.h Log message: Hide most of the contents behind #ifdef _KERNEL. Reorganize the file a bit to achieve this with a single #ifdef/#endif pair.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: t...@cvs.openbsd.org2020/07/06 09:24:11 Modified files: regress/usr.bin/rcs: Makefile Log message: Add a few ${.CURDIR} to make the new RCS tests work with obj/ and obj@. ok stsp
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: kette...@cvs.openbsd.org2020/07/06 09:18:04 Modified files: sys/dev/ofw: fdt.c openfirm.h sys/arch/arm/arm: openprom.c sys/arch/arm64/arm64: openprom.c sys/arch/octeon/octeon: openprom.c sys/arch/powerpc64/powerpc64: openprom.c Log message: IEEE1275 (Open Firmware) defines that parameter name strings can have a 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 ) 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@
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: n...@cvs.openbsd.org2020/07/06 03:14:20 Modified files: usr.bin/tmux : cmd-refresh-client.c control.c server-client.c tmux.1 tmux.h Log message: Add a way for control mode clients to subscribe to a format and be notified of changes rather than having to poll. GitHub issue 2242.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: j...@cvs.openbsd.org2020/07/06 08:50:19 Modified files: sys/dev/pci/drm: drm_fb_helper.c Log message: defer access of fb_info pointer in drm_fb_helper_hotplug_event() Fixes a regression from rev 1.24 which lead to a page fault reported by Martin Ziemer. ok stsp@
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: piro...@cvs.openbsd.org 2020/07/06 07:33:09 Modified files: lib/libc/arch/aarch64/gen: Makefile.inc lib/libc/arch/alpha/gen: Makefile.inc lib/libc/arch/amd64/gen: Makefile.inc lib/libc/arch/arm/gen: Makefile.inc lib/libc/arch/hppa/gen: Makefile.inc lib/libc/arch/i386/gen: Makefile.inc lib/libc/arch/m88k/gen: Makefile.inc lib/libc/arch/mips64/gen: Makefile.inc lib/libc/arch/powerpc/gen: Makefile.inc lib/libc/arch/sh/gen: Makefile.inc lib/libc/arch/sparc64/gen: Makefile.inc lib/libc/asr : asr.c lib/libc/crypt : bcrypt.c lib/libc/dlfcn : init.c lib/libc/gen : auth_subr.c time.c times.c timespec_get.c lib/libc/hidden/sys: time.h lib/libc/hidden: time.h lib/libc/net : res_random.c lib/libc/rpc : auth_unix.c clnt_tcp.c clnt_udp.c svc_tcp.c lib/libc/sys : Makefile.inc lib/libc/thread: synch.h sys/arch/alpha/alpha: clock.c sys/arch/amd64/amd64: tsc.c sys/arch/amd64/isa: clock.c sys/arch/arm/cortex: amptimer.c sys/arch/arm64/dev: agtimer.c sys/arch/armv7/omap: gptimer.c sys/arch/armv7/sunxi: sxitimer.c sys/arch/hppa/dev: clock.c sys/arch/i386/isa: clock.c sys/arch/i386/pci: geodesc.c gscpm.c ichpcib.c sys/arch/loongson/loongson: generic3a_machdep.c sys/arch/luna88k/luna88k: clock.c sys/arch/macppc/macppc: clock.c sys/arch/mips64/mips64: mips64_machdep.c sys/arch/octeon/octeon: machdep.c sys/arch/sgi/sgi: ip27_machdep.c sys/arch/sgi/xbow: xheart.c sys/arch/sparc64/dev: psycho.c sys/arch/sparc64/sparc64: clock.c sys/dev/acpi : acpihpet.c acpitimer.c sys/dev/pci: amdpm.c viapm.c sys/dev/pv : hyperv.c pvclock.c sys/kern : exec_elf.c kern_exec.c kern_tc.c sys/sys: exec_elf.h proc.h time.h timetc.h sys/uvm: uvm_unix.c Added files: lib/libc/arch/aarch64/gen: usertc.c lib/libc/arch/alpha/gen: usertc.c lib/libc/arch/amd64/gen: usertc.c lib/libc/arch/arm/gen: usertc.c lib/libc/arch/hppa/gen: usertc.c lib/libc/arch/i386/gen: usertc.c lib/libc/arch/m88k/gen: usertc.c lib/libc/arch/mips64/gen: usertc.c lib/libc/arch/powerpc/gen: usertc.c lib/libc/arch/sh/gen: usertc.c lib/libc/arch/sparc64/gen: usertc.c lib/libc/hidden/sys: timetc.h lib/libc/sys : microtime.c w_clock_gettime.c w_gettimeofday.c regress/lib/libc/timekeep: Makefile test_clock_gettime.c test_gettimeofday.c test_time_skew.c sys/arch/alpha/include: timetc.h sys/arch/amd64/include: timetc.h sys/arch/arm/include: timetc.h sys/arch/arm64/include: timetc.h sys/arch/armv7/include: timetc.h sys/arch/hppa/include: timetc.h sys/arch/i386/include: timetc.h sys/arch/landisk/include: timetc.h sys/arch/loongson/include: timetc.h sys/arch/luna88k/include: timetc.h sys/arch/m88k/include: timetc.h sys/arch/macppc/include: timetc.h sys/arch/mips64/include: timetc.h sys/arch/octeon/include: timetc.h sys/arch/powerpc/include: timetc.h sys/arch/powerpc64/include: timetc.h sys/arch/sgi/include: timetc.h sys/arch/sh/include: timetc.h sys/arch/sparc64/include: timetc.h Log message: Add support for timeconting in userland. This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: piro...@cvs.openbsd.org 2020/07/06 07:31:26 src/regress/lib/libc/timekeep Update of /cvs/src/regress/lib/libc/timekeep In directory cvs.openbsd.org:/tmp/cvs-serv15893/timekeep Log Message: Directory /cvs/src/regress/lib/libc/timekeep added to the repository
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: dera...@cvs.openbsd.org 2020/07/06 06:44:03 Modified files: distrib/sets/lists/comp: md.powerpc64 mi Log message: sync
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: d...@cvs.openbsd.org2020/07/06 05:48:03 Modified files: share/man/man9 : Makefile Added files: share/man/man9 : kstat_create.9 kstat_kv_init.9 Log message: make a very quick and dirty pass on a manpage for the kstat api.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: s...@cvs.openbsd.org2020/07/06 05:28:51 Modified files: sys/dev/ic : ar5008.c athn.c Log message: Repair athn(4) in client mode against WPA2 access points. Client mode was subtly broken after support for CCMP offload was added. In client mode we should be using the first key table slot for our CCMP pairwise key, not an arbitrary slot based on our association ID (as is done in hostap mode). When the interface came up again after being reset the CCMP hardware engine was left in a non-working state. Apparently the key table was messed up or contained stale entries. Fix a potential timing issue in the code path which attempts to clear the key table on device power-up. For good measure, also clear the key table before the device is powered down. While here, fix off-by-ones in key table slot range checks. Problems reported by Tim Chase, Kevin Chadwick, Austin Hook, Stefan Kapfhammer. Fix tested by me on AR9280 (PCI) and AR9271 (USB) and Kevin Chadwick on AR9280
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: j...@cvs.openbsd.org2020/07/06 04:38:54 Modified files: sys/dev/usb: if_urtwn.c Log message: match on D-Link DWA-121 rev B1 from Miguel Landaeta
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: j...@cvs.openbsd.org2020/07/06 04:36:19 Modified files: sys/dev/usb: usbdevs.h usbdevs_data.h Log message: regen
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: j...@cvs.openbsd.org2020/07/06 04:35:42 Modified files: sys/dev/usb: usbdevs Log message: add D-Link DWA-121 rev B1 from Miguel Landaeta
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: n...@cvs.openbsd.org2020/07/06 04:07:02 Modified files: usr.bin/tmux : screen-write.c Log message: Do not eliminate redundant clears, the code is wrong and doing it correctly wouldn't be worth it. GitHub issue 2298.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: kette...@cvs.openbsd.org2020/07/06 01:31:51 Modified files: regress/sys/ptrace: ptrace.c Log message: Make this build on powerpc64.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: kette...@cvs.openbsd.org2020/07/06 01:31:20 Modified files: regress/sys/kern/noexec: Makefile testfly.S Log message: Make this build on powerpc/powerpc64. Only test on powerpc64 for now since this is expected to fail on most 32-bit PowerPC CPUs given the lack of a proper permission bit.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: n...@cvs.openbsd.org2020/07/06 01:27:39 Modified files: usr.bin/tmux : cmd-list-keys.c key-string.c tty-keys.c Log message: Always send xterm-style keys for M-Left and M-Right. GitHub issue 2296.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: kette...@cvs.openbsd.org2020/07/06 01:26:40 Modified files: sys/arch/powerpc64/powerpc64: pmap.c Log message: Fix pmap_pted_ro() such that it actually takes away PROT_EXEC when asked to do so.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: d...@cvs.openbsd.org2020/07/06 01:09:50 Added files: usr.bin/kstat : Makefile kstat.c Log message: add kstat(8), the userland side of kstat(4). this currently just dumps all the kstats it can find and prints out their current values. in the future i want to be able to pass what kstats im intersted in as arguments, and tell it to poll stats and show rates instead of current values when appropriate.
CVS: cvs.openbsd.org: src
CVSROOT:/cvs Module name:src Changes by: d...@cvs.openbsd.org2020/07/06 01:06:52 src/usr.bin/kstat Update of /cvs/src/usr.bin/kstat In directory cvs.openbsd.org:/tmp/cvs-serv26885/kstat Log Message: Directory /cvs/src/usr.bin/kstat added to the repository