From 867228adfb0b4bbab1ff33e31ec607f5671c9047 Mon Sep 17 00:00:00 2001 From: Patrick Mooney Date: Wed, 17 Mar 2021 22:33:51 +0000 Subject: 13645 bhyve queues wrong SIPI Reviewed by: Yuri Pankov Reviewed by: Hans Rosenfeld Approved by: Robert Mustacchi --- usr/src/uts/i86pc/io/vmm/vmm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/usr/src/uts/i86pc/io/vmm/vmm.c b/usr/src/uts/i86pc/io/vmm/vmm.c index 1cd0b23a1c..047c6e0887 100644 --- a/usr/src/uts/i86pc/io/vmm/vmm.c +++ b/usr/src/uts/i86pc/io/vmm/vmm.c @@ -39,7 +39,7 @@ * * Copyright 2015 Pluribus Networks Inc. * Copyright 2018 Joyent, Inc. - * Copyright 2020 Oxide Computer Company + * Copyright 2021 Oxide Computer Company */ #include @@ -2922,7 +2922,15 @@ vm_inject_init(struct vm *vm, int vcpuid) vcpu = &vm->vcpu[vcpuid]; vcpu_lock(vcpu); vcpu->run_state |= VRS_PEND_INIT; + /* + * As part of queuing the INIT request, clear any pending SIPI. It + * would not otherwise survive across the reset of the vCPU when it + * undergoes the requested INIT. We would not want it to linger when it + * could be mistaken as a subsequent (after the INIT) SIPI request. + */ + vcpu->run_state &= ~VRS_PEND_SIPI; vcpu_notify_event_locked(vcpu, VCPU_NOTIFY_EXIT); + vcpu_unlock(vcpu); return (0); } -- cgit v1.2.3