mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-04 05:09:49 +00:00
hv: Add check to ensure vcpu_make_request and signal_event are
consistent Currently the vcpu_make_request and signal_event in vcpu_lock_instr_emulation does not check whether target VCPU is up and running. This can cause problems because when VCPU is created but not launched, vcpu_make_request will not trigger wait_event on target VCPU, but signal_event may still execute to reduce the counter. This patch adds a check before vcpu_make_request and signal_event to make sure the request and signal are issued after target VCPU is up. Tracked-On: #6502 Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
This commit is contained in:
parent
25ed86e28f
commit
e51837f96d
@ -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]);
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
struct sched_event {
|
||||
spinlock_t lock;
|
||||
int8_t nqueued;
|
||||
int32_t nqueued;
|
||||
struct thread_object* waiting_thread;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user