#undef HYPERCALL
#undef COMPAT_CALL
-int hvm_do_hypercall(struct cpu_user_regs *regs)
+int hvm_hypercall(struct cpu_user_regs *regs)
{
struct vcpu *curr = current;
struct domain *currd = curr->domain;
return HVM_HCALL_preempted;
if ( unlikely(currd->arch.hvm_domain.qemu_mapcache_invalidate) &&
- test_and_clear_bool(currd->arch.hvm_domain.
- qemu_mapcache_invalidate) )
- return HVM_HCALL_invalidate;
+ test_and_clear_bool(currd->arch.hvm_domain.qemu_mapcache_invalidate) )
+ send_invalidate_req();
return HVM_HCALL_completed;
}
break;
BUG_ON(vcpu_guestmode);
HVMTRACE_1D(VMMCALL, regs->_eax);
- rc = hvm_do_hypercall(regs);
- if ( rc != HVM_HCALL_preempted )
- {
+
+ if ( hvm_hypercall(regs) == HVM_HCALL_completed )
__update_guest_eip(regs, inst_len);
- if ( rc == HVM_HCALL_invalidate )
- send_invalidate_req();
- }
break;
case VMEXIT_DR0_READ ... VMEXIT_DR7_READ:
update_guest_eip(); /* Safe: RDTSC, RDTSCP */
hvm_rdtsc_intercept(regs);
break;
+
case EXIT_REASON_VMCALL:
- {
- int rc;
HVMTRACE_1D(VMMCALL, regs->_eax);
- rc = hvm_do_hypercall(regs);
- if ( rc != HVM_HCALL_preempted )
- {
+
+ if ( hvm_hypercall(regs) == HVM_HCALL_completed )
update_guest_eip(); /* Safe: VMCALL */
- if ( rc == HVM_HCALL_invalidate )
- send_invalidate_req();
- }
break;
- }
+
case EXIT_REASON_CR_ACCESS:
{
__vmread(EXIT_QUALIFICATION, &exit_qualification);
#define HVM_HCALL_completed 0 /* hypercall completed - no further action */
#define HVM_HCALL_preempted 1 /* hypercall preempted - re-execute VMCALL */
-#define HVM_HCALL_invalidate 2 /* invalidate ioemu-dm memory cache */
-int hvm_do_hypercall(struct cpu_user_regs *pregs);
+int hvm_hypercall(struct cpu_user_regs *regs);
void hvm_hlt(unsigned int eflags);
void hvm_triple_fault(void);