apicv: cancel event injection if vcpu is scheduled out

And re-inject the event after vcpu is scheduled in.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
Yin Fengwei
2018-02-28 19:33:13 +08:00
committed by Jack Ren
parent c8d2cdccda
commit 189329e0de
4 changed files with 48 additions and 0 deletions

View File

@@ -147,6 +147,9 @@ static void context_switch_out(struct vcpu *vcpu)
if (vcpu == NULL)
return;
/* cancel event(int, gp, nmi and exception) injection */
cancel_event_injection(vcpu);
atomic_store_rel_32(&vcpu->running, 0);
/* do prev vcpu context switch out */
/* For now, we don't need to invalid ept.