On Tue, Nov 08, 2022 at 12:18:47PM -0700, David Gwynne wrote:
> CVSROOT:      /cvs
> Module name:  src
> Changes by:   d...@cvs.openbsd.org    2022/11/08 12:18:47
> 
> Modified files:
>       sys/arch/amd64/include: vmmvar.h 
>       sys/arch/amd64/amd64: vmm.c 
> 
> Log message:
> further speed up delivery of interrupts to a running vcpu.
> 
> this records which physical cpu a vcpu is running on. this is used
> by the code that marks a vcpu as having a pending interrupt to check
> if the vcpu is currently running. if it thinks the vcpu is running,
> it sends a nop IPI to the physical cpu it is running on to trigger
> a vmexit, which in turn runs interrupt handling in the guest.
> 
> ok mlarkin@

GENERIC is broken:

        vmm.c:900:3: error: implicit declaration of function 'x86_send_ipi' is 
invalid in C99 [-Werror,-Wimplicit-function-declaration]

Index: vmm.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/vmm.c,v
retrieving revision 1.329
diff -u -p -r1.329 vmm.c
--- vmm.c       8 Nov 2022 19:38:34 -0000       1.329
+++ vmm.c       9 Nov 2022 05:57:26 -0000
@@ -877,7 +877,9 @@ vm_intr_pending(struct vm_intr_params *v
 {
        struct vm *vm;
        struct vcpu *vcpu;
+#ifdef MULTIPROCESSOR
        struct cpu_info *ci;
+#endif
        int error, ret = 0;
 
        /* Find the desired VM */
@@ -894,10 +896,12 @@ vm_intr_pending(struct vm_intr_params *v
                goto out;
        }
 
+#ifdef MULTIPROCESSOR
        vcpu->vc_intr = vip->vip_intr;
        ci = READ_ONCE(vcpu->vc_curcpu);
        if (ci != NULL)
                x86_send_ipi(ci, X86_IPI_NOP);
+#endif
 
        refcnt_rele_wake(&vcpu->vc_refcnt);
 out:

Reply via email to