diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2010-04-22 06:33:08 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 05:19:18 -0400 |
commit | 2041a06a50a2ef4062c8454482aa06e25f6cccde (patch) | |
tree | fa40065df7293dc8057db6ba098256f3fd05dbfd /arch/x86 | |
parent | 924584ccb08c338ebd2f40936ff2321c1cce6a6d (diff) |
KVM: SVM: Make sure rip is synced to vmcb before nested vmexit
This patch fixes a bug where a nested guest always went over
the same instruction because the rip was not advanced on a
nested vmexit.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/svm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index ec205847be6a..c480d7f64a60 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -2960,6 +2960,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) | |||
2960 | u16 gs_selector; | 2960 | u16 gs_selector; |
2961 | u16 ldt_selector; | 2961 | u16 ldt_selector; |
2962 | 2962 | ||
2963 | svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX]; | ||
2964 | svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP]; | ||
2965 | svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP]; | ||
2966 | |||
2963 | /* | 2967 | /* |
2964 | * A vmexit emulation is required before the vcpu can be executed | 2968 | * A vmexit emulation is required before the vcpu can be executed |
2965 | * again. | 2969 | * again. |
@@ -2967,10 +2971,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) | |||
2967 | if (unlikely(svm->nested.exit_required)) | 2971 | if (unlikely(svm->nested.exit_required)) |
2968 | return; | 2972 | return; |
2969 | 2973 | ||
2970 | svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX]; | ||
2971 | svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP]; | ||
2972 | svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP]; | ||
2973 | |||
2974 | pre_svm_run(svm); | 2974 | pre_svm_run(svm); |
2975 | 2975 | ||
2976 | sync_lapic_to_cr8(vcpu); | 2976 | sync_lapic_to_cr8(vcpu); |