Re: move vmm(4) spinout paranoia behind MP_LOCKDEBUG

2022-05-20 Thread Mike Larkin
On Sat, Apr 16, 2022 at 12:09:46PM -0400, Dave Voutila wrote: > This tucks all the spinout paranoia behind `#ifdef MP_LOCKDEBUG` and > uses the same approach used in amd64's pmap's TLB shootdown code. > > Part of me wants to remove this altogether, but I'm not sure it's > outlived its usefulness

Re: vmm: load vmcs before reading vcpu registers

2022-05-20 Thread Mike Larkin
On Wed, May 18, 2022 at 10:27:11AM -0400, Dave Voutila wrote: > > ping...would like to get this in if possible so I can move onto fixing > some things in vmm. > sorry. ok mlarkin > Dave Voutila writes: > > > tech@, > > > > Continuing my vmm/vmd bug hunt, the following diff adapts > >

Re: Picky, but much more efficient arc4random_uniform!

2022-05-15 Thread Mike Larkin
On Sun, May 15, 2022 at 08:40:19PM -0500, Luke Small wrote: > https://marc.info/?l=openbsd-tech=165259528425835=2 > > This one (which is strongly based upon my first of two versions) which I > submitted after Guenther correctly trashed version 2, doesn’t reuse any > part of the sample. It picks up

Re: vmm: give a lonely enum a friend, fixing `vmctl receive`

2022-05-13 Thread Mike Larkin
On Sun, May 08, 2022 at 10:30:46PM -0400, Dave Voutila wrote: > tech@, > > Another vmm/vmd update: fix `vmctl receive` on Intel hosts by adding > another fault enum value to disambiguate fault reasons. > > It's expected that the guest will trigger nested page faults after being > received by vmd.

Re: vmd: fix rebooting a received vm

2022-05-07 Thread Mike Larkin
On Sat, May 07, 2022 at 07:58:15AM -0400, Dave Voutila wrote: > tech@: > > Now that vmd only accounts for memory in bytes [1], this fix is a lot > simpler! > > If you use the send/receive functionality and "receive" a sent vm, it > functions as expected. However, if that vm tries to reboot, it

Re: aml parse error

2022-05-03 Thread Mike Larkin
On Tue, May 03, 2022 at 04:46:55PM +0200, aphekz wrote: > On Mon, May 02, 2022 at 07:05:24PM -0700, Mike Larkin wrote: > > On Mon, May 02, 2022 at 11:42:57PM +0200, aphekz wrote: > > > > > > May 2 21:29:06 dev /bsd: ### AML PARSE ERROR (0x8f3a): Undefined name: >

Re: aml parse error

2022-05-02 Thread Mike Larkin
On Mon, May 02, 2022 at 11:42:57PM +0200, aphekz wrote: > > May 2 21:29:06 dev /bsd: ### AML PARSE ERROR (0x8f3a): Undefined name: OPST > May 2 21:29:06 dev /bsd: error evaluating: \\_SB_.PCI0.LPCB.EC0_._Q14 > May 2 21:29:55 dev /bsd: ### AML PARSE ERROR (0x8f3a): Undefined name: OPST > May 2

Re: migrate vmd/vmm/vmctl to use bytes, not MBs

2022-05-02 Thread Mike Larkin
On Mon, May 02, 2022 at 04:09:19PM -0400, Dave Voutila wrote: > > Dave Voutila writes: > > > tech@, > > > > tl;dr: standardize vmd/vmm/vmctl on counting memory in bytes at all > > times instead of a mix of MiB and bytes. > > > > There's some design friction between vmd(8)/vmctl(8) and vmm(4). > >

Re: DPTF sensors driver

2022-04-25 Thread Mike Larkin
On Sun, Apr 24, 2022 at 08:00:50PM -0500, joshua stein wrote: > Any interest in this? > > acpidptfs0 at acpi0: SEN2, sensor "Sensor 2 USB2" > acpidptfs1 at acpi0: SEN4, sensor "Sensor 4 Ambience" > acpidptfs2 at acpi0: SEN1, sensor "Thermistor CPU SOC" > acpidptfs3 at acpi0: SEN3, sensor "Sensor 3

Re: amdgpio(4) : preserve pin configuration on resume

2022-04-20 Thread Mike Larkin
On Wed, Apr 20, 2022 at 11:39:00AM +0200, Mark Kettenis wrote: > > Date: Tue, 19 Apr 2022 22:02:00 -0700 > > From: Mike Larkin > > > > On at least the Asus ROG Zephyrus 14 (2020), the trackpad fails to generate > > any interrupts after resume. I tracked this down to

amdgpio(4) : preserve pin configuration on resume

2022-04-19 Thread Mike Larkin
On at least the Asus ROG Zephyrus 14 (2020), the trackpad fails to generate any interrupts after resume. I tracked this down to amdgpio(4) not generating interrupts after resume, and started looking at missing soft state. This diff preserves the interrupt pin configurations and restores them

Re: vmd writes corrupt qcow2 images

2022-04-18 Thread Mike Larkin
On Mon, Apr 18, 2022 at 12:21:39PM -0400, Dave Voutila wrote: > > "Thomas L." writes: > > > Hi, > > > > I recently tried to use qemu-img with qcow2 images of my VMs and > > qemu-img finds them corrupted. I can reproduce the issue in the > > following way (on -current, but is the same on -stable;

Re: VMM avoid duplication and reduce atack surface with octboot(4)

2022-03-22 Thread Mike Larkin
On Wed, Mar 23, 2022 at 04:27:40AM +, Alexis wrote: > Indeed I understood both octboot and vmm seabios/uefi initialazation process. > > But has its done with kexec and linuxboot coreboot payload octboot could be > ported to act in the same way. Explaining now again for the 3rd time, to >

Re: VMM avoid duplication and reduce atack surface with octboot(4)

2022-03-22 Thread Mike Larkin
On Wed, Mar 23, 2022 at 12:58:41AM +, Alexis wrote: > Have vmm/vmd core developers ever thought of using octboot has a way to u > se openbsd has a bootloader to avoid stack duplication, and attached atack > surface reduction. Avoiding to maintain 2 stacks, seabios/uefi and host > vm, could be

Re: initial 11ac support for iwm(4)

2022-03-17 Thread Mike Larkin
On Wed, Mar 16, 2022 at 11:17:47PM +0100, Stefan Sperling wrote: > On Wed, Mar 16, 2022 at 04:11:41PM +0100, Stefan Sperling wrote: > > This patch adds initial 11ac support to the iwm(4) driver. > > It allows use of 80 MHz channels and VHT MCS. > > Updated patch. Fixes a fatal firmware error on

Re: initial iwx(4) 11ac patch for testing

2022-03-09 Thread Mike Larkin
On Wed, Mar 09, 2022 at 01:07:47PM +0100, Stefan Sperling wrote: > This patch adds initial 11ac support to the iwx(4) driver. > This means that 80MHz channels can be used. No other 11ac features > are enabled yet. > > This is not yet a patch which could be committed. Apart from debug > prints

Re: Properly check if ACPI devices are enabled

2022-01-27 Thread Mike Larkin
On Mon, Jan 24, 2022 at 12:15:58PM -0800, Philip Guenther wrote: > On Mon, Jan 24, 2022 at 11:41 AM Mark Kettenis > wrote: > > > > Date: Mon, 24 Jan 2022 20:19:46 +0100 > > > From: Anton Lindqvist > > > > > > On Mon, Jan 24, 2022 at 05:31:49PM +0100, Mark Kettenis wrote: > > > > Currently we

Re: dt: make vmm tracepoints amd64 only

2022-01-17 Thread Mike Larkin
On Mon, Jan 17, 2022 at 10:10:26AM -0300, Crystal Kolipe wrote: > On Mon, Jan 17, 2022 at 01:00:44PM +, Klemens Nanni wrote: > > These don't hurt on !VMM architectures but I was still surprised to see > > them on e.g. sparc64: > > > > # arch -s ; btrace -l | grep vmm > > sparc64 > >

Re: Silence vmd rtc_update_rega non-32KHz timebase spam

2022-01-15 Thread Mike Larkin
On Wed, Dec 08, 2021 at 07:45:50PM -0600, Brian Conway wrote: > Ping with complete diff. Thanks. > > Brian Conway > Catching up on old emails. Committed. Thanks. -ml > diff --git usr.sbin/vmd/mc146818.c usr.sbin/vmd/mc146818.c > index e3599c685..001c1a055 100644 > --- usr.sbin/vmd/mc146818.c >

Re: mpsafe dwxe(4)

2022-01-04 Thread Mike Larkin
On Mon, Jan 03, 2022 at 09:24:15PM +1000, Jonathan Matthew wrote: > This is almost identical to the changes I made to dwge(4) recently, since > these drivers are very closely related. Unfortunately the only machine I > have with dwxe(4) in it is armv7, so I can't test this properly, but it > does

Re: Remove gtp from amd64 GENERIC kernel

2022-01-03 Thread Mike Larkin
On Mon, Jan 03, 2022 at 06:43:29PM -0800, Greg Steuck wrote: > Crystal Kolipe writes: > > > The gpt driver was completely deleted from the tree in 2016, and removed > > from the i386 GENERIC config in revision 1.819. > > > > It has, however, remained in the amd64 GENERIC config commented out, >

Re: vmm(4): restore vmcs after sleep points [vmx 2/3]

2021-12-03 Thread Mike Larkin
On Mon, Nov 29, 2021 at 08:41:22PM -0500, Dave Voutila wrote: > > Dave Voutila writes: > > > This diff removes instability from VMX-based hosts by either removing > > the possibility of the process sleeping while the VMCS is active or > > reloading it if we had no choice. > > > > A mutex is added

Re: vmm(4): bump vmclear spinout [vmx 1/3]

2021-11-28 Thread Mike Larkin
On Sun, Nov 28, 2021 at 10:32:47PM -0500, Dave Voutila wrote: > Smallest of the VMX/VMCS stability diffs. This bumps the spinout to be > the same number of ticks used by the mplock debug. This is needed on > older/slower hosts. > > ok? > > -dv > > diff e8c587551f20ba6fdaa0f483ea768aade9f66f7d >

Re: vmm(4): copyout guest regs, irqready on VM_EXIT_NONE

2021-11-21 Thread Mike Larkin
On Sat, Nov 20, 2021 at 09:14:31PM -0500, Dave Voutila wrote: > The below diff fixes an issue reported by kn@ on bugs@ [1]. joshe@ also > observed the issue and confirmed the below diff resolves it. > > The symptoms were quite odd: errors from fdc(4) during an OpenBSD guest > booting under

Re: vmd(8): fix broken bootorder for cdrom

2021-11-04 Thread Mike Larkin
On Thu, Nov 04, 2021 at 08:09:16PM +0100, Jan Klemkow wrote: > On Thu, Nov 04, 2021 at 10:43:46AM -0400, Dave Voutila wrote: > > Jan Klemkow writes: > > > This fix [1] in seabios breaks our "boot device cdrom" feature. > > > > > > # vmctl start -Lc -d disk.img -r cd70.iso -B cdrom vm > > > ... >

Re: More pchgpio(4)

2021-10-21 Thread Mike Larkin
On Tue, Oct 12, 2021 at 01:19:55PM -0700, Mike Larkin wrote: > On Sun, Oct 10, 2021 at 11:42:31PM +0200, Mark Kettenis wrote: > > > Date: Sat, 9 Oct 2021 22:27:52 +0200 (CEST) > > > From: Mark Kettenis > > > > > > > Date: Sat, 9 Oct 2021 20:55:1

Re: More pchgpio(4)

2021-10-12 Thread Mike Larkin
On Sun, Oct 10, 2021 at 11:42:31PM +0200, Mark Kettenis wrote: > > Date: Sat, 9 Oct 2021 22:27:52 +0200 (CEST) > > From: Mark Kettenis > > > > > Date: Sat, 9 Oct 2021 20:55:10 +0200 (CEST) > > > From: Mark Kettenis > > > > > > This time adding support for Sunrisepoint-H and Sunrisepoint-LP. > >

Re: vmm(4): set global vcpu limit to 512

2021-09-11 Thread Mike Larkin
On Sat, Sep 11, 2021 at 01:44:33PM -0400, Dave Voutila wrote: > Syzbot recently discovered that since we don't have any bounds in place > for number of vms or vcpus it's possible to completely exhuast kernel > memory or at least put the system in a state where malloc(9) or > km_alloc(9) fail in

Re: updated patch for iwx(4) Tx aggregation

2021-09-11 Thread Mike Larkin
On Sat, Sep 11, 2021 at 02:04:32PM +0200, Stefan Sperling wrote: > On Fri, Sep 10, 2021 at 06:49:49PM +0200, Stefan Sperling wrote: > > Here is another attempt at adding Tx aggregation to iwx(4). > > This patch is based on the latest state in CVS (if_iwx.c r1.107, which > > I have committed a

Re: let iwx(4) resume in the acpi thread

2021-09-10 Thread Mike Larkin
On Fri, Sep 10, 2021 at 11:12:45AM +0200, Stefan Sperling wrote: > On Fri, Sep 10, 2021 at 10:59:25AM +0200, Stefan Sperling wrote: > > On Fri, Sep 10, 2021 at 10:58:47AM +0200, Stefan Sperling wrote: > > > All those changes are shown below. My device is still happy with this. > > > I will reply

Re: iwx(4) firmware memory fixes

2021-09-09 Thread Mike Larkin
On Wed, Sep 08, 2021 at 02:08:36PM +0200, Stefan Sperling wrote: > Add a missing call to iwx_ctxt_info_free_fw_img() in an error path > of iwx_ctxt_info_init() which should always free on error. > > Also, free firmware paging DMA memory in case loading firmware has failed. > If we don't free

Re: let iwx(4) resume in the acpi thread

2021-09-09 Thread Mike Larkin
On Wed, Sep 08, 2021 at 03:25:20PM +0200, Stefan Sperling wrote: > On Wed, Sep 08, 2021 at 02:19:00PM +0200, Stefan Sperling wrote: > > This patch applies on top of all the other iwx(4) diffs I've sent today. > > It makes iwx(4) initialize the device completely in the acpi thread. > > > > We now

Re: riscv64/trap.c debug printfs

2021-09-03 Thread Mike Larkin
On Fri, Sep 03, 2021 at 04:38:55PM +0200, Jeremie Courreges-Anglas wrote: > > This one is a bit too chatty whenever you run a program under egdb. > But the other printfs in this file seem ok, thus I'm not touching them. > > ok? > > > Index: trap.c >

Re: Incorrect IPL when pool_get(9) is called under rwlock

2021-09-01 Thread Mike Larkin
On Wed, Sep 01, 2021 at 08:53:35AM +0200, Martin Pieuchot wrote: > syzkaller reported [0] the following lock ordering issue: > > db{0}> trace > db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:440 > panic(82464b8f) at panic+0x177 sys/kern/subr_prf.c:202 >

Re: Incorrect IPL when pool_get(9) is called under rwlock

2021-09-01 Thread Mike Larkin
On Wed, Sep 01, 2021 at 08:53:35AM +0200, Martin Pieuchot wrote: > syzkaller reported [0] the following lock ordering issue: > > db{0}> trace > db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:440 > panic(82464b8f) at panic+0x177 sys/kern/subr_prf.c:202 >

Re: ddb: machine sysregs for amd64

2021-08-31 Thread Mike Larkin
On Tue, Aug 31, 2021 at 06:30:40PM +1000, Alex Wilson wrote: > Hi, > > This is a short diff to add "machine sysregs" to ddb on amd64 (plus it also > prints out gsbase/kgsbase). This command is available on i386 but not amd64. > I swear I remember discussing this with mlarkin at some point but I

Re: vmd(8): simplify vcpu logic, removing uart & net reads

2021-07-15 Thread Mike Larkin
On Sun, Jul 11, 2021 at 08:10:42AM -0400, Dave Voutila wrote: > > Ping...looking for OK. Would like to get this committed this week. > Sorry this took so long. ok mlarkin. Thanks to the numerous testers who ran with this for the past few weeks. > Dave Voutila writes: > > > Looking for an OK for

Re: vmd: spurious VM restarts

2021-06-26 Thread Mike Larkin
On Sat, Jun 26, 2021 at 03:26:55PM +0200, Thomas L. wrote: > On Wed, 7 Apr 2021 17:00:00 -0700 > Mike Larkin wrote: > > Depends on the exact content that got swapped out (as we didn't handle > > TLB flushes correctly), so a crash was certainly a possibility. > > Th

Re: vmd(8): add barebones vioblk GET_ID support

2021-06-17 Thread Mike Larkin
On Thu, Jun 17, 2021 at 12:07:10PM -0400, Dave Voutila wrote: > > Dave Voutila writes: > > > The virtio spec has had a de facto command for drivers to read the > > serial number off a virtual block device. QEMU introduced this feature > > years ago. Last November, the virtio governing group voted

Re: Document missing pledge promises

2021-06-11 Thread Mike Larkin
On Fri, Jun 11, 2021 at 09:16:46AM -0600, Theo de Raadt wrote: > Dave Voutila wrote: > > > Theo de Raadt writes: > > > > > Regarding the vmm chunk -- as I said in my other reply, these > > > explanations are too precise. They risk becoming outdated as things > > > change. Furthermore, some of

Re: Update vmctl(8) to use TERMINATE_VM_EVENTs

2021-06-10 Thread Mike Larkin
On Thu, Jun 10, 2021 at 09:19:45AM -0400, Dave Voutila wrote: > > Still looking for an OK or feedback on the below. This is finishing work > to fixes made previously to vmd(8)/vmctl(8) regarding vm > stopping/running state corruption when using vmctl(8) to wait for a vm > to stop. > Sorry for the

Re: limit MSR_INT_PEN_MSG use to < family 16h

2021-06-10 Thread Mike Larkin
On Wed, Jun 09, 2021 at 10:35:48PM -0700, Mike Larkin wrote: > On Thu, Jun 10, 2021 at 03:19:43PM +1000, Jonathan Gray wrote: > > Ilya Voronin sent a diff to misc to limit MSR_INT_PEN_MSG use to > > < AMD family 17h prompted by a problem with an AWS t3a instance. > >

Re: limit MSR_INT_PEN_MSG use to < family 16h

2021-06-09 Thread Mike Larkin
On Thu, Jun 10, 2021 at 03:19:43PM +1000, Jonathan Gray wrote: > Ilya Voronin sent a diff to misc to limit MSR_INT_PEN_MSG use to > < AMD family 17h prompted by a problem with an AWS t3a instance. > > https://marc.info/?l=openbsd-misc=162120066715633=2 > > Digging some more the 16h bkdgs have it

Re: vmm(4): use monotonic base for pvclock

2021-06-01 Thread Mike Larkin
On Tue, Jun 01, 2021 at 08:03:43PM -0500, Scott Cheloha wrote: > The documentation for the Linux pvclock is pretty sparse but I am > pretty sure we want to use a monotonic base for ti_system_time. We > also have a function for converting a timespec into a 64-bit count of > nanoseconds we can use.

Re: vio.4: mention support provided by vmd(8)

2021-05-24 Thread Mike Larkin
On Sun, May 23, 2021 at 09:50:46PM -0400, Dave Voutila wrote: > Seems only right that vio.4 mention it's the driver used for the virtio > networking device provided by vmd(8). > > OK? > ok mlarkin > > Index: vio.4 > === > RCS file:

Re: vmd(8): add MTU feature support to vionet device

2021-05-24 Thread Mike Larkin
On Mon, May 24, 2021 at 08:25:04AM +0200, Claudio Jeker wrote: > On Sun, May 23, 2021 at 10:25:38PM -0400, Dave Voutila wrote: > > The following diff adds in virtio 1.1's VIRTIO_NET_F_MTU feature support > > to vmd(8)'s virtio networking device. This allows for communicating an MTU > > to the

Re: vmd(8): skip inspecting non-udp packets on local ifs

2021-05-23 Thread Mike Larkin
On Sat, May 22, 2021 at 10:20:37AM -0400, Dave Voutila wrote: > tech@ & krw (since your code in question was imported to vmd), > > I found strange behavior running tcpbench(1) to measure the connection > between a vmd guest and my host, as well as guest-to-guest. In short, > it's some bogus logic

Re: vmm(4): Mask TSC_ADJUST cpu feature

2021-05-20 Thread Mike Larkin
On Thu, May 20, 2021 at 07:36:23AM -0400, Dave Voutila wrote: > We don't currently emulate all TSC related features yet. While hacking > on other issues, I've found some more obnoxious guests (*cough* debian > *cough*) constantly try to read the IA32_TSC_ADJUST msr every second, > not getting the

Re: patch: new fix for vmctl create

2021-05-12 Thread Mike Larkin
On Mon, Mar 15, 2021 at 08:21:56AM +, James Cook wrote: > Hi tech@, > > The below patch removes calls to realpath(3) when looking up a qcow2 > base image. Previous thread: > https://marc.info/?t=16156249642=1=2 > > In short, the calls were failing inside vmctl, because of unveil. The >

Re: potentially uninitialized string printed by vmd

2021-05-11 Thread Mike Larkin
On Mon, Mar 15, 2021 at 09:29:29AM +, James Cook wrote: > > The array "base" which is passed to log_warnx might be uninitialized: > > virtio_get_base doesn't necessarily touch it if it returns -1. Maybe it > > would be better just omit base from the output, e.g. > > > > log_warnx("vm

Re: vmd(8): init debug logging before using logging

2021-05-03 Thread Mike Larkin
On Mon, May 03, 2021 at 08:50:36PM -0400, Dave Voutila wrote: > If debug state in the logging routines isn't set, messages from > fatal{,x} and warn{,x} don't get flushed to stderr, so running vmd > un-daemonized can result in the process exiting at startup with no > discernable message reason

Re: added support for precompressed static files on httpd(so sorry about my other email that was unreadable)

2021-05-01 Thread Mike Larkin
On Sat, May 01, 2021 at 09:26:39PM +, alloca wrote: > This patch adds a serve_gzip option. When enabled, If the client requests > path, then serve path.gz if it exists and the client accepts > Content-Encoding: gzip. > > man style > diff -up httpd.orig/config.c httpd/config.c > ---

Re: vmd(8): remove duplicate struct definition

2021-04-29 Thread Mike Larkin
On Thu, Apr 29, 2021 at 03:24:42PM -0400, Dave Voutila wrote: > Found this while running ctags(1)... vioqcow2.c has struct qcheader > already defined at L53 (which stylistically is where it should be). > > This diff just removes the duplicate definition inside > virtio_qcow2_create(). > > OK? > >

Re: km_alloc(9) for i386 pmap

2021-04-23 Thread Mike Larkin
On Fri, Apr 23, 2021 at 08:07:43PM +0200, Martin Pieuchot wrote: > Diff below convert the last uses of uvm_km_alloc(9) and uvm_km_zalloc(9) > to km_alloc(9). > > One of the allocations below uses `kp_pageable' instead of `kp_zero' > because the mapping for `pm_pdir_intel' is lost when PAE is

Re: umm_map returns unaligned address?

2021-04-23 Thread Mike Larkin
On Fri, Apr 23, 2021 at 01:55:14PM +0200, Alessandro Pistocchi wrote: > Hi all, > > I am fairly new to openbsd so if this is something obvious that I missed > please be understanding. > > I am adding a syscall to openbsd 6.8. I am working on a raspberry pi. > > During the syscall I allocate some

Re: vmd: spurious VM restarts

2021-04-07 Thread Mike Larkin
On Wed, Apr 07, 2021 at 07:47:28PM -0400, Dave Voutila wrote: > > Thomas L. writes: > > >> > Thomas: I looked at your host dmesg and your provided vm.conf. It > >> > looks like 11 vm's with the default 512M memory and one (minecraft) > >> > with 8G. Your host seems to have only 16GB of memory,

Re: vmd: spurious VM restarts

2021-04-07 Thread Mike Larkin
On Wed, Apr 07, 2021 at 09:23:14AM -0400, Dave Voutila wrote: > > Dave Voutila writes: > > > Mike Larkin writes: > > > >> On Wed, Apr 07, 2021 at 12:22:23AM +0200, Thomas L. wrote: > >>> On Tue, 6 Apr 2021 14:28:09 -0700 > >>> Mike Larkin w

Re: vmd: spurious VM restarts

2021-04-07 Thread Mike Larkin
On Wed, Apr 07, 2021 at 07:26:41AM -0400, Dave Voutila wrote: > > Mike Larkin writes: > > > On Wed, Apr 07, 2021 at 12:22:23AM +0200, Thomas L. wrote: > >> On Tue, 6 Apr 2021 14:28:09 -0700 > >> Mike Larkin wrote: > >> > >> > On

Re: vmd: spurious VM restarts

2021-04-06 Thread Mike Larkin
On Wed, Apr 07, 2021 at 12:22:23AM +0200, Thomas L. wrote: > On Tue, 6 Apr 2021 14:28:09 -0700 > Mike Larkin wrote: > > > On Tue, Apr 06, 2021 at 09:15:10PM +0200, Thomas L. wrote: > > > On Tue, 6 Apr 2021 11:11:01 -0700 > > > Mike Larkin wrote: >

Re: vmd: spurious VM restarts

2021-04-06 Thread Mike Larkin
On Tue, Apr 06, 2021 at 09:15:10PM +0200, Thomas L. wrote: > On Tue, 6 Apr 2021 11:11:01 -0700 > Mike Larkin wrote: > > Anything in the host's dmesg? > *host* dmesg. I think you misread what I was after... > Below is the dmesg and latest syslog from one of the VMs. > >

Re: vmd(8): send correct response on unpause error

2021-04-06 Thread Mike Larkin
On Fri, Apr 02, 2021 at 07:14:34PM -0400, Dave Voutila wrote: > If vmctl(8) sends an unpause request for a vm that doesn't exist, vmd(8) > should be responding with the IMSG_VMDOP_UNPAUSE_VM_RESPONSE imsg_type > with an ENOENT error code. (Similarly if the request comes from a user > without

Re: vmd: spurious VM restarts

2021-04-06 Thread Mike Larkin
On Tue, Apr 06, 2021 at 07:47:52PM +0200, Thomas L. wrote: > Hi, > > I'm running OpenBSD 6.8 as hypervisor with multiple OpenBSD VMs. > Regularly, it happens that all VM are restarted, not at the same time > but clustered. The indication that this happend is reduced uptime on the > VMs, some

Re: amd64: add MSR_TSC_ADJUST

2021-04-06 Thread Mike Larkin
On Mon, Apr 05, 2021 at 07:37:51PM -0500, Scott Cheloha wrote: > Intel calls it "IA32_TSC_ADJUST". Is "MSR_TSC_ADJUST" fine or should > it be "MSR_IA32_TSC_ADJUST"? > > We have a feature flag for this one already, SEFF0EBX_TSC_ADJUST. > > Index: specialreg.h >

Re: monotonic time going back by wrong skews

2021-04-05 Thread Mike Larkin
On Sat, Apr 03, 2021 at 10:21:02PM -0500, Scott Cheloha wrote: > On Fri, Apr 02, 2021 at 10:37:36AM -0700, Mike Larkin wrote: > > On Thu, Apr 01, 2021 at 06:43:30PM -0500, Scott Cheloha wrote: > > > > > > [...] > > > > > > Hmmm. Being able to work a

Re: vmm.4: document supported ioctls

2021-04-02 Thread Mike Larkin
On Fri, Apr 02, 2021 at 03:24:55AM +0200, Klemens Nanni wrote: > On Thu, Apr 01, 2021 at 08:34:37PM -0400, Dave Voutila wrote: > > I've updated the diff using your feedback. See below. > Thanks, OK kn > ok mlarkin@ also

Re: monotonic time going back by wrong skews

2021-04-02 Thread Mike Larkin
On Thu, Apr 01, 2021 at 06:43:30PM -0500, Scott Cheloha wrote: > On Thu, Apr 01, 2021 at 03:41:24PM -0400, Josh Rickmar wrote: > > On Thu, Apr 01, 2021 at 03:22:00PM -0400, Josh Rickmar wrote: > > > On Thu, Apr 01, 2021 at 02:15:48PM -0500, Scott Cheloha wrote: > > > > On Sat, Mar 27, 2021 at

Re: vmctl: off-by-one error handling mixing -a with a VM id

2021-03-29 Thread Mike Larkin
On Fri, Mar 26, 2021 at 07:24:32AM -0400, Dave Voutila wrote: > > Theo Buehler writes: > > > On Thu, Mar 25, 2021 at 08:07:53PM +0100, Preben Guldberg wrote: > >> Dave Voutila wrote: > >> > Preben Guldberg writes: > >> > > The patch below addresses an off-by-one error reading argv when > >> > >

Re: patch: vamm(4) IA32_EPT_VPID_CAP_XO_TRANSLATIONS specified incorrectly.

2021-03-29 Thread Mike Larkin
On Sat, Mar 27, 2021 at 10:15:27AM -0400, Dave Voutila wrote: > > Adam Steen writes: > > > Hi > > > > IA32_EPT_VPID_CAP_XO_TRANSLATIONS is specified incorrectly, see the > > patch below. > > Adam's diff looks correct to me based on reading Intel SDM Vol 3D, > Appendix A.10 (VPID and EPT

Re: vmm(4): fix boot issue for 9front guests

2021-03-29 Thread Mike Larkin
On Sun, Mar 28, 2021 at 09:28:11AM -0400, Bryan Steele wrote: > On Sun, Mar 28, 2021 at 08:38:13AM -0400, Dave Voutila wrote: > > abieber@ found the latest 9front release ends up in a boot loop if > > hosted on an AMD system. I tracked it down to 9front (oddly) trying to > > read the PAT msr prior

Re: UVM return(val)

2021-03-23 Thread Mike Larkin
On Tue, Mar 23, 2021 at 01:52:20PM +0100, Martin Pieuchot wrote: > Diff below convert multiple "return(val)" and "return (val)" to > "return val". I only changed those that help decrease the size > of the diff with NetBSD or didn't change anything. > > ok? > I read through these and agree this

Re: Remove booting from kernels in raw/qcow2 images in vmd(8)

2021-03-17 Thread Mike Larkin
On Wed, Mar 17, 2021 at 10:29:32PM +0100, Klemens Nanni wrote: > On Sun, Mar 14, 2021 at 11:00:22AM -0400, Dave Voutila wrote: > > Any takers? > Yes, I plan to commit the updated diff at the end until friday > unless someone objects. > no objection, thanks everyone. ok mlarkin > > Here's an

Re: vmm crash on 6.9-beta

2021-03-13 Thread Mike Larkin
On Wed, Mar 10, 2021 at 08:30:32PM +0100, Mischa wrote: > On 10 Mar at 18:59, Mike Larkin wrote: > > On Wed, Mar 10, 2021 at 03:08:21PM +0100, Mischa wrote: > > > Hi All, > > > > > > Currently I am running 6.9-beta on one of my hosts to test > > &g

Re: Remove booting from kernels in raw/qcow2 images in vmd(8)

2021-03-11 Thread Mike Larkin
On Thu, Mar 11, 2021 at 06:11:03PM -0500, Dave Voutila wrote: > tl;dr: tedu vmboot.{c,h}, ufs.c from vmd(8) to remove broken ability to > exract and boot a kernel image from a raw or qcow2 disk image > > The following diff removes the ability to boot directly from a disk > image containing a FFS

Re: vmm crash on 6.9-beta

2021-03-10 Thread Mike Larkin
On Wed, Mar 10, 2021 at 03:08:21PM +0100, Mischa wrote: > Hi All, > > Currently I am running 6.9-beta on one of my hosts to test veb(4)/vport(4). > > root@server14:~ # sysctl kern.version > kern.version=OpenBSD 6.9-beta (GENERIC.MP) #385: Mon Mar 8 12:57:12 MST 2021 >

Re: veb(4) support for vmd(8)?

2021-02-26 Thread Mike Larkin
On Sat, Feb 27, 2021 at 09:44:03AM +1000, David Gwynne wrote: > > > > On 27 Feb 2021, at 7:50 am, Klemens Nanni wrote: > > > > On Sat, Feb 27, 2021 at 07:30:56AM +1000, David Gwynne wrote: > >> i think this is enough to let vmd wire guests up to veb interfaces. > > But please update vm.conf(5) to

Re: uvm_fault: Comments & style cleanup

2021-02-15 Thread Mike Larkin
On Mon, Feb 15, 2021 at 01:15:33PM +0100, Martin Pieuchot wrote: > On 15/02/21(Mon) 11:47, Martin Pieuchot wrote: > > Diff below includes non-functional changes: > > > > - Sync comments with NetBSD including locking details. > > - Remove superfluous parenthesis and spaces. > > - Add brackets, even

Re: Increase timeout length for VMs trying to fully shutdown

2021-01-05 Thread Mike Larkin
On Tue, Jan 05, 2021 at 12:49:29PM -0700, Tracey Emery wrote: > Hello tech@, > > Some of us have been having shutdown issues with our VMs on OpenBSDAms. > I tracked down the problem to too short of a timeout for the shutdown > event. > > If there are an additional 1 or 2 package daemons running on

Re: PATCH: Fix PCI Config Space union size on VMM

2020-09-09 Thread Mike Larkin
On Mon, Sep 07, 2020 at 06:03:00PM -0500, Jordan Hargrave wrote: > This code fixes the pci device union for accessing PCI config space >= 0x40 > > Running pcidump -xxx in a virtual machine would return garbage data due to > union overlap > Thanks, looks good from my perspective. -ml > On Mon,

Re: amd64: add tsc_delay(), a TSC-based delay(9) implementation

2020-08-25 Thread Mike Larkin
On Tue, Aug 25, 2020 at 12:12:36PM -0700, Mike Larkin wrote: > On Mon, Aug 24, 2020 at 01:55:45AM +0200, Mark Kettenis wrote: > > > Date: Sun, 23 Aug 2020 18:11:12 -0500 > > > From: Scott Cheloha > > > > > > Hi, > > > > > > Other BSDs

Re: amd64: add tsc_delay(), a TSC-based delay(9) implementation

2020-08-25 Thread Mike Larkin
On Mon, Aug 24, 2020 at 12:29:15AM -0500, Scott Cheloha wrote: > On Sun, Aug 23, 2020 at 11:45:22PM -0500, Scott Cheloha wrote: > > > > [...] > > > > > > This patch (or something equivalent) is a prerequisite to running the > > > > lapic timer in oneshot or TSC deadline mode. Using the lapic

Re: amd64: add tsc_delay(), a TSC-based delay(9) implementation

2020-08-25 Thread Mike Larkin
On Mon, Aug 24, 2020 at 01:55:45AM +0200, Mark Kettenis wrote: > > Date: Sun, 23 Aug 2020 18:11:12 -0500 > > From: Scott Cheloha > > > > Hi, > > > > Other BSDs use the TSC to implement delay(9) if the TSC is constant > > and invariant. Here's a patch to add something similar to our kernel. > >

Re: kernel crash in setrunqueue

2020-07-29 Thread Mike Larkin
On Wed, Jul 29, 2020 at 10:14:11PM +0200, Mark Kettenis wrote: > > Date: Wed, 29 Jul 2020 13:03:43 -0700 > > From: Mike Larkin > > > > Hi, > > > > I'm seeing crashes on amd64 GENERIC.MP on a few VMs recently. This happens > > on GENERIC.MP regardless of

Re: kernel crash in setrunqueue

2020-07-29 Thread Mike Larkin
On Wed, Jul 29, 2020 at 01:03:43PM -0700, Mike Larkin wrote: > Hi, > > I'm seeing crashes on amd64 GENERIC.MP on a few VMs recently. This happens > on GENERIC.MP regardless of whether or not the VM has one cpu or more than > one. It does not happen on GENERIC kernels. > >

kernel crash in setrunqueue

2020-07-29 Thread Mike Larkin
Hi, I'm seeing crashes on amd64 GENERIC.MP on a few VMs recently. This happens on GENERIC.MP regardless of whether or not the VM has one cpu or more than one. It does not happen on GENERIC kernels. The crash will happen fairly quickly after the kernel starts executing processes. Sometimes it

Re: Edgerouter 4 available for any OpenBSD dev that needs an octeon

2020-07-29 Thread Mike Larkin
On Tue, Jul 28, 2020 at 06:16:01PM -0700, Mike Larkin wrote: > Someone (can't recall who) gave me an ER4. I found it while cleaning > out my closet. Since I'm not active anymore, if any openbsd developer > wants it, reach out to me privately and I'll see about sending it > to you

Edgerouter 4 available for any OpenBSD dev that needs an octeon

2020-07-28 Thread Mike Larkin
Someone (can't recall who) gave me an ER4. I found it while cleaning out my closet. Since I'm not active anymore, if any openbsd developer wants it, reach out to me privately and I'll see about sending it to you. Thanks. -ml

Re: amd64: lapic: refactor lapic timer programming

2020-07-06 Thread Mike Larkin
On Fri, Jul 03, 2020 at 07:41:45PM -0500, Scott Cheloha wrote: > Hi, > > I want to run the lapic timer in one-shot mode on amd64 as we do with > other interrupt clocks on other platforms. I aim to make the clock > interrupt code MD where possible. > > However, nobody is going to test my MD clock

Re: 11n Tx aggregation for iwm(4)

2020-06-26 Thread Mike Larkin
On Fri, Jun 26, 2020 at 09:01:03PM -0700, Mike Larkin wrote: > On Fri, Jun 26, 2020 at 02:45:53PM +0200, Stefan Sperling wrote: > > This patch adds support for 11n Tx aggregation to iwm(4). > > > > Please help with testing if you can by running the patch and using wifi > &g

Re: 11n Tx aggregation for iwm(4)

2020-06-26 Thread Mike Larkin
On Fri, Jun 26, 2020 at 02:45:53PM +0200, Stefan Sperling wrote: > This patch adds support for 11n Tx aggregation to iwm(4). > > Please help with testing if you can by running the patch and using wifi > as usual. Nothing should change, except that Tx speed may potentially > improve. If you have

Re: vmm(4): unterminated vm_name after strncpy

2020-03-15 Thread Mike Larkin
On Thu, Mar 12, 2020 at 10:31:13PM +0100, Tobias Heider wrote: > vmm uses 'strncpy(vm->vm_name, vcp->vcp_name, VMM_MAX_NAME_LEN)' to copy > to buffers of size VMM_MAX_NAME_LEN, which can leave the resulting string > unterminated. > From strncpy(3): > strncpy() only NUL terminates the destination

Re: [PATCH] Fixing an uninitialized variable that can lead to #GP.

2020-02-09 Thread Mike Larkin
On Sun, Feb 09, 2020 at 06:17:47PM -0800, Anthony Steinhauser wrote: > In the current implementation of the TAA mitigation if the cpuid_level > is 6 and it's an Intel CPU, the sefflags_edx variable is used without > being initialized. If the SEFF0EDX_ARCH_CAP bit is accidentally flipped > in it,

Re: Add mprotect_ept ioctl to vmm(4)

2020-02-07 Thread Mike Larkin
On Fri, Feb 07, 2020 at 01:25:38PM -0800, Mike Larkin wrote: > On Fri, Feb 07, 2020 at 04:20:16AM +, Adam Steen wrote: > > Hi > > > > Please see the attached patch to add an 'IOCTL handler to sets the access > > protections of the ept' > > > >

vmm(4): wrong comment

2020-02-07 Thread Mike Larkin
Free commit for someone. Noticed last night by my student team that is working on vmm(4) virtio memory ballooning support as we were adding the viomb(4) stats queue. -ml Index: vmm.c === RCS file:

Re: Add mprotect_ept ioctl to vmm(4)

2020-02-07 Thread Mike Larkin
On Fri, Feb 07, 2020 at 04:20:16AM +, Adam Steen wrote: > Hi > > Please see the attached patch to add an 'IOCTL handler to sets the access > protections of the ept' > > vmd(8) does not make use of this change, but solo5, which uses vmm(4) as > a backend hypervisor. The code calling

Re: vmm(4) patch - iniatialise eptp to zero for vmx like svm

2020-02-06 Thread Mike Larkin
On Thu, Feb 06, 2020 at 01:05:01AM -0800, Mike Larkin wrote: > On Thu, Feb 06, 2020 at 02:34:47AM +, Adam Steen wrote: > > Hi > > > > Again while working on a larger patch i noticed that the eptp for vmx > > was not getting initialised to zero like

Re: vmm(4) patch - iniatialise eptp to zero for vmx like svm

2020-02-06 Thread Mike Larkin
On Thu, Feb 06, 2020 at 02:34:47AM +, Adam Steen wrote: > Hi > > Again while working on a larger patch i noticed that the eptp for vmx > was not getting initialised to zero like the svm code path, as part of > a VMM_IOC_RESETCPU ioctl call. > > please see the attach patch to initialise eptp

Re: em(4) diff to test

2020-01-31 Thread Mike Larkin
On Thu, Jan 30, 2020 at 09:15:35AM +0100, Martin Pieuchot wrote: > On 21/01/20(Tue) 12:31, Martin Pieuchot wrote: > > On 20/01/20(Mon) 16:42, Martin Pieuchot wrote: > > > Diff below is a refactoring of the actual em(4) code and defines that > > > will allows me to present a shorter diff to

Re: Remove unused code from vmm

2020-01-30 Thread Mike Larkin
On Fri, Jan 31, 2020 at 01:40:14AM +, Adam Steen wrote: > Hi > > While working on a patch, i noticed that vmm_get_guest_faulttype was > incorrect for amd (VMM_MODE_RVI) cpus, apon further inspection realised > it was unused. Please see the patch below to remove it. > > cheers > Adam >

Re: ldomctl: download: select new configuration

2020-01-06 Thread Mike Larkin
On Fri, Jan 03, 2020 at 08:27:21PM +0100, Mark Kettenis wrote: > > Date: Mon, 30 Dec 2019 21:07:59 +0100 > > From: Klemens Nanni > > > > The example in the manual implies that the download command also selects > > it: > > > > # ldomctl init-system ldom.conf > > # cd .. > > # ldomctl

Re: vmctl: print root user in status owner field

2019-12-15 Thread Mike Larkin
On Sat, Dec 14, 2019 at 02:16:20AM +0100, Klemens Nanni wrote: > With "owner root:wheel" (any group) the `vmctl status' output > will omit the "root" part in the OWNER column: > > vm "generic" { > owner "root:vms" > ... > } > > $ vmctl status >

  1   2   3   4   5   6   >