summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-02-19 14:37:47 +0200
committerAvi Kivity <avi@qumranet.com>2007-03-04 11:12:41 +0200
commit02e235bc8eebf8a6fef10d46479b3c18f3e9c4f2 (patch)
tree7adc652e23ef451c059f8dfb736b59b27d108747
parentc21415e84334af679630f6450ceb8929a5234fad (diff)
downloadkernel-crypto-02e235bc8eebf8a6fef10d46479b3c18f3e9c4f2.tar.gz
kernel-crypto-02e235bc8eebf8a6fef10d46479b3c18f3e9c4f2.tar.xz
kernel-crypto-02e235bc8eebf8a6fef10d46479b3c18f3e9c4f2.zip
KVM: Add hypercall host support for svm
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r--drivers/kvm/svm.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index f6e86528f03..aaa6742089e 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1076,6 +1076,20 @@ static int halt_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
return 0;
}
+static int vmmcall_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
+{
+ printk(KERN_DEBUG "got vmmcall at RIP %08llx\n",
+ vcpu->svm->vmcb->save.rip);
+ printk(KERN_DEBUG "vmmcall params: %08llx, %08lx, %08lx, %08lx\n",
+ vcpu->svm->vmcb->save.rax,
+ vcpu->regs[VCPU_REGS_RCX],
+ vcpu->regs[VCPU_REGS_RDX],
+ vcpu->regs[VCPU_REGS_RBP]);
+ vcpu->svm->vmcb->save.rax = 0;
+ vcpu->svm->vmcb->save.rip += 3;
+ return 1;
+}
+
static int invalid_op_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
{
inject_ud(vcpu);
@@ -1276,7 +1290,7 @@ static int (*svm_exit_handlers[])(struct kvm_vcpu *vcpu,
[SVM_EXIT_TASK_SWITCH] = task_switch_interception,
[SVM_EXIT_SHUTDOWN] = shutdown_interception,
[SVM_EXIT_VMRUN] = invalid_op_interception,
- [SVM_EXIT_VMMCALL] = invalid_op_interception,
+ [SVM_EXIT_VMMCALL] = vmmcall_interception,
[SVM_EXIT_VMLOAD] = invalid_op_interception,
[SVM_EXIT_VMSAVE] = invalid_op_interception,
[SVM_EXIT_STGI] = invalid_op_interception,