aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-02-28 13:46:53 -0500
committerAvi Kivity <avi@qumranet.com>2007-05-03 03:52:23 -0400
commit06465c5a3aa9948a7b00af49cd22ed8f235cdb0f (patch)
tree2a21941ae6f28445abbb3cc80dd3416cf2241b8d /drivers/kvm/svm.c
parent46fc1477887c41c8e900f2c95485e222b9a54822 (diff)
KVM: Handle cpuid in the kernel instead of punting to userspace
KVM used to handle cpuid by letting userspace decide what values to return to the guest. We now handle cpuid completely in the kernel. We still let userspace decide which values the guest will see by having userspace set up the value table beforehand (this is necessary to allow management software to set the cpu features to the least common denominator, so that live migration can work). The motivation for the change is that kvm kernel code can be impacted by cpuid features, for example the x86 emulator. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r--drivers/kvm/svm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index c35b8c83bf3f..d4b2936479d9 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1101,8 +1101,8 @@ static int task_switch_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_r
1101static int cpuid_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 1101static int cpuid_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
1102{ 1102{
1103 vcpu->svm->next_rip = vcpu->svm->vmcb->save.rip + 2; 1103 vcpu->svm->next_rip = vcpu->svm->vmcb->save.rip + 2;
1104 kvm_run->exit_reason = KVM_EXIT_CPUID; 1104 kvm_emulate_cpuid(vcpu);
1105 return 0; 1105 return 1;
1106} 1106}
1107 1107
1108static int emulate_on_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 1108static int emulate_on_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)