mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 00:38:28 +00:00
hv: vcpu: wait and signal vcpu event support
Introduce two kinds of events for each vcpu, VCPU_EVENT_IOREQ: for vcpu waiting for IO request completion VCPU_EVENT_VIRTUAL_INTERRUPT: for vcpu waiting for virtual interrupts events vcpu can wait for such events, and resume to run when the event get signalled. This patch also change IO request waiting/notifying to this way. Tracked-On: #4329 Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -103,14 +103,6 @@ int32_t acrn_insert_request(struct acrn_vcpu *vcpu, const struct io_request *io_
|
||||
}
|
||||
clac();
|
||||
|
||||
/* pause vcpu in notification mode , wait for VHM to handle the MMIO request.
|
||||
* TODO: when pause_vcpu changed to switch vcpu out directlly, we
|
||||
* should fix the race issue between req.processed update and vcpu pause
|
||||
*/
|
||||
if (!is_polling) {
|
||||
pause_vcpu(vcpu, VCPU_PAUSED);
|
||||
}
|
||||
|
||||
/* Before updating the vhm_req state, enforce all fill vhm_req operations done */
|
||||
cpu_write_memory_barrier();
|
||||
|
||||
@@ -136,10 +128,8 @@ int32_t acrn_insert_request(struct acrn_vcpu *vcpu, const struct io_request *io_
|
||||
schedule();
|
||||
}
|
||||
}
|
||||
} else if (need_reschedule(pcpuid_from_vcpu(vcpu))) {
|
||||
schedule();
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
wait_event(&vcpu->events[VCPU_EVENT_IOREQ]);
|
||||
}
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
|
Reference in New Issue
Block a user