hv_main: Remove the continue in vcpu_thread

To avoid acrn_handle_pending_request called twice within one vmexit,
we remove the error-prone "continue" in vcpu_thread.

And make vcpu shecheduled out if fatal error happens with vcpu.

Tracked-On: #3387
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Yin, Fengwei 2019-07-09 18:02:57 +08:00 committed by wenlingz
parent f0e1c5e55f
commit 12955fa80f

View File

@ -34,7 +34,6 @@ void vcpu_thread(struct sched_object *obj)
/* Don't open interrupt window between here and vmentry */ /* Don't open interrupt window between here and vmentry */
if (need_reschedule(vcpu->pcpu_id)) { if (need_reschedule(vcpu->pcpu_id)) {
schedule(); schedule();
continue;
} }
/* Check and process pending requests(including interrupt) */ /* Check and process pending requests(including interrupt) */
@ -42,7 +41,8 @@ void vcpu_thread(struct sched_object *obj)
if (ret < 0) { if (ret < 0) {
pr_fatal("vcpu handling pending request fail"); pr_fatal("vcpu handling pending request fail");
pause_vcpu(vcpu, VCPU_ZOMBIE); pause_vcpu(vcpu, VCPU_ZOMBIE);
continue; /* Fatal error happened (triple fault). Stop the vcpu running. */
schedule();
} }
profiling_vmenter_handler(vcpu); profiling_vmenter_handler(vcpu);
@ -52,7 +52,8 @@ void vcpu_thread(struct sched_object *obj)
if (ret != 0) { if (ret != 0) {
pr_fatal("vcpu resume failed"); pr_fatal("vcpu resume failed");
pause_vcpu(vcpu, VCPU_ZOMBIE); pause_vcpu(vcpu, VCPU_ZOMBIE);
continue; /* Fatal error happened (resume vcpu failed). Stop the vcpu running. */
schedule();
} }
basic_exit_reason = vcpu->arch.exit_reason & 0xFFFFU; basic_exit_reason = vcpu->arch.exit_reason & 0xFFFFU;
TRACE_2L(TRACE_VM_EXIT, basic_exit_reason, vcpu_get_rip(vcpu)); TRACE_2L(TRACE_VM_EXIT, basic_exit_reason, vcpu_get_rip(vcpu));