diff --git a/hypervisor/arch/x86/guest/lock_instr_emul.c b/hypervisor/arch/x86/guest/lock_instr_emul.c index dd47b3bee..bfc0ec9ce 100644 --- a/hypervisor/arch/x86/guest/lock_instr_emul.c +++ b/hypervisor/arch/x86/guest/lock_instr_emul.c @@ -45,7 +45,7 @@ void vcpu_kick_lock_instr_emulation(struct acrn_vcpu *cur_vcpu) get_vm_lock(cur_vcpu->vm); foreach_vcpu(i, cur_vcpu->vm, other) { - if (other != cur_vcpu) { + if ((other != cur_vcpu) && (other->state == VCPU_RUNNING)) { vcpu_make_request(other, ACRN_REQUEST_SPLIT_LOCK); } } @@ -59,7 +59,7 @@ void vcpu_complete_lock_instr_emulation(struct acrn_vcpu *cur_vcpu) if (cur_vcpu->vm->hw.created_vcpus > 1U) { foreach_vcpu(i, cur_vcpu->vm, other) { - if (other != cur_vcpu) { + if ((other != cur_vcpu) && (other->state == VCPU_RUNNING)) { signal_event(&other->events[VCPU_EVENT_SPLIT_LOCK]); } } diff --git a/hypervisor/include/common/event.h b/hypervisor/include/common/event.h index 2aba27b32..98a8b0055 100644 --- a/hypervisor/include/common/event.h +++ b/hypervisor/include/common/event.h @@ -4,7 +4,7 @@ struct sched_event { spinlock_t lock; - int8_t nqueued; + int32_t nqueued; struct thread_object* waiting_thread; };