diff options
author | Dave Voutila <dv@cvs.openbsd.org> | 2023-09-06 03:35:58 +0000 |
---|---|---|
committer | Dave Voutila <dv@cvs.openbsd.org> | 2023-09-06 03:35:58 +0000 |
commit | 81461bcd25c5b0d032bd0d62acfd23547ab31cfa (patch) | |
tree | a614656d39944c0c34c30260d0d84293879ab7fc /usr.sbin | |
parent | 5cb453cd883bad737622d14237fa05bb39d618f4 (diff) |
vmm(4)/vmd(8): include pending interrupt in vm_run_parmams.
To remove an ioctl(2) from the vcpu thread hotpath in vmd(8), add
a flag in the vm_run_params structure to indicate if there's another
interrupt pending. This reduces latency in vcpu work related to
i/o as we save a trip into the kernel just to flip the interrupt
pending flag on or off.
Tested by phessler@, mbuhl@, stsp@, and Mischa Peters.
ok mlarkin@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/vmd/vm.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/usr.sbin/vmd/vm.c b/usr.sbin/vmd/vm.c index 5f598bcc14a..15c1dd992df 100644 --- a/usr.sbin/vmd/vm.c +++ b/usr.sbin/vmd/vm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm.c,v 1.90 2023/07/13 18:31:59 dv Exp $ */ +/* $OpenBSD: vm.c,v 1.91 2023/09/06 03:35:57 dv Exp $ */ /* * Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org> @@ -1610,22 +1610,8 @@ vcpu_run_loop(void *arg) } else vrp->vrp_irq = 0xFFFF; - /* Still more pending? */ - if (i8259_is_pending()) { - /* - * XXX can probably avoid ioctls here by providing intr - * in vrp - */ - if (vcpu_pic_intr(vrp->vrp_vm_id, - vrp->vrp_vcpu_id, 1)) { - fatal("can't set INTR"); - } - } else { - if (vcpu_pic_intr(vrp->vrp_vm_id, - vrp->vrp_vcpu_id, 0)) { - fatal("can't clear INTR"); - } - } + /* Still more interrupts pending? */ + vrp->vrp_intr_pending = i8259_is_pending(); if (ioctl(env->vmd_fd, VMM_IOC_RUN, vrp) == -1) { /* If run ioctl failed, exit */ |