diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-02-19 07:37:47 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-03-04 04:12:40 -0500 |
commit | c21415e84334af679630f6450ceb8929a5234fad (patch) | |
tree | 6f9ce30c9fd97a3fc94e79e1450fda86f612b56e /drivers/kvm | |
parent | 102d8325a1d2f266d3d0a03fdde948544e72c12d (diff) |
KVM: Add host hypercall support for vmx
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm')
-rw-r--r-- | drivers/kvm/vmx.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 0198d400037f..ca79e594ea6e 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -1657,6 +1657,20 @@ static int handle_halt(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
1657 | return 0; | 1657 | return 0; |
1658 | } | 1658 | } |
1659 | 1659 | ||
1660 | static int handle_vmcall(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | ||
1661 | { | ||
1662 | kvm_run->exit_reason = KVM_EXIT_DEBUG; | ||
1663 | printk(KERN_DEBUG "got vmcall at RIP %08lx\n", vmcs_readl(GUEST_RIP)); | ||
1664 | printk(KERN_DEBUG "vmcall params: %08lx, %08lx, %08lx, %08lx\n", | ||
1665 | vcpu->regs[VCPU_REGS_RAX], | ||
1666 | vcpu->regs[VCPU_REGS_RCX], | ||
1667 | vcpu->regs[VCPU_REGS_RDX], | ||
1668 | vcpu->regs[VCPU_REGS_RBP]); | ||
1669 | vcpu->regs[VCPU_REGS_RAX] = 0; | ||
1670 | vmcs_writel(GUEST_RIP, vmcs_readl(GUEST_RIP)+3); | ||
1671 | return 1; | ||
1672 | } | ||
1673 | |||
1660 | /* | 1674 | /* |
1661 | * The exit handlers return 1 if the exit was handled fully and guest execution | 1675 | * The exit handlers return 1 if the exit was handled fully and guest execution |
1662 | * may resume. Otherwise they set the kvm_run parameter to indicate what needs | 1676 | * may resume. Otherwise they set the kvm_run parameter to indicate what needs |
@@ -1675,6 +1689,7 @@ static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu, | |||
1675 | [EXIT_REASON_MSR_WRITE] = handle_wrmsr, | 1689 | [EXIT_REASON_MSR_WRITE] = handle_wrmsr, |
1676 | [EXIT_REASON_PENDING_INTERRUPT] = handle_interrupt_window, | 1690 | [EXIT_REASON_PENDING_INTERRUPT] = handle_interrupt_window, |
1677 | [EXIT_REASON_HLT] = handle_halt, | 1691 | [EXIT_REASON_HLT] = handle_halt, |
1692 | [EXIT_REASON_VMCALL] = handle_vmcall, | ||
1678 | }; | 1693 | }; |
1679 | 1694 | ||
1680 | static const int kvm_vmx_max_exit_handlers = | 1695 | static const int kvm_vmx_max_exit_handlers = |