@@ -80,7 +80,7 @@ UNLIKELY_END(realmode)
mov %rsp,%rdi
call vmx_vmenter_helper
cmp $0,%eax
- jne .Lvmx_vmentry_restart
+ je .Lvmx_vmentry_restart
mov VCPU_hvm_guest_cr2(%rbx),%rax
pop %r15
@@ -4197,7 +4197,8 @@ static void lbr_fixup(void)
bdw_erratum_bdf14_fixup();
}
-int vmx_vmenter_helper(const struct cpu_user_regs *regs)
+/* Return false if the vmentry has to be restarted */
+bool vmx_vmenter_helper(const struct cpu_user_regs *regs)
{
struct vcpu *curr = current;
u32 new_asid, old_asid;
@@ -4206,7 +4207,7 @@ int vmx_vmenter_helper(const struct cpu_user_regs *regs)
/* Shadow EPTP can't be updated here because irqs are disabled */
if ( nestedhvm_vcpu_in_guestmode(curr) && vcpu_nestedhvm(curr).stale_np2m )
- return 1;
+ return false;
if ( curr->domain->arch.hvm_domain.pi_ops.do_resume )
curr->domain->arch.hvm_domain.pi_ops.do_resume(curr);
@@ -4269,7 +4270,7 @@ int vmx_vmenter_helper(const struct cpu_user_regs *regs)
__vmwrite(GUEST_RSP, regs->rsp);
__vmwrite(GUEST_RFLAGS, regs->rflags | X86_EFLAGS_MBS);
- return 0;
+ return true;
}
/*