mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 02:08:04 +00:00
io_emul: remove pending_pre_work
Now we do not need pending_pre_work anymore, as we can make sure IO request VCPU resume from where it paused. Now only three fixed points will try to do schedule: - vcpu_thread: before vm entry, will check reschedule flag and to it if needed - default_idle: loop check reschedule flag to see if need switch out - io request: if IO REQ need DM's handle, it will schedule out Tracked-On: #2394 Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Xu, Anthony <anthony.xu@intel.com>
This commit is contained in:
@@ -8,23 +8,12 @@
|
||||
#include <schedule.h>
|
||||
#include <softirq.h>
|
||||
|
||||
static void run_vcpu_pre_work(struct acrn_vcpu *vcpu)
|
||||
{
|
||||
uint64_t *pending_pre_work = &vcpu->pending_pre_work;
|
||||
|
||||
if (bitmap_test_and_clear_lock(ACRN_VCPU_MMIO_COMPLETE, pending_pre_work)) {
|
||||
dm_emulate_mmio_post(vcpu);
|
||||
}
|
||||
}
|
||||
|
||||
void vcpu_thread(struct sched_object *obj)
|
||||
{
|
||||
struct acrn_vcpu *vcpu = list_entry(obj, struct acrn_vcpu, sched_obj);
|
||||
uint32_t basic_exit_reason = 0U;
|
||||
int32_t ret = 0;
|
||||
|
||||
run_vcpu_pre_work(vcpu);
|
||||
|
||||
do {
|
||||
/* If vcpu is not launched, we need to do init_vmcs first */
|
||||
if (!vcpu->launched) {
|
||||
@@ -46,15 +35,7 @@ void vcpu_thread(struct sched_object *obj)
|
||||
}
|
||||
|
||||
if (need_reschedule(vcpu->pcpu_id)) {
|
||||
/*
|
||||
* In extrem case, schedule() could return. Which
|
||||
* means the vcpu resume happens before schedule()
|
||||
* triggered by vcpu suspend. In this case, we need
|
||||
* to do pre work and continue vcpu loop after
|
||||
* schedule() is return.
|
||||
*/
|
||||
schedule();
|
||||
run_vcpu_pre_work(vcpu);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -154,6 +154,8 @@ int32_t acrn_insert_request_wait(struct acrn_vcpu *vcpu, const struct io_request
|
||||
}
|
||||
asm_pause();
|
||||
}
|
||||
} else if (need_reschedule(vcpu->pcpu_id)) {
|
||||
schedule();
|
||||
}
|
||||
ret = 0;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user