Skip to content

Commit

Permalink
[PATCH] KVM: SVM: Fix SVM idt confusion
Browse files Browse the repository at this point in the history
There's an obvious typo in svm_{get,set}_idt, causing it to access the ldt
instead.

Because these functions are only called for save/load on AMD, the bug does not
impact normal operation.  With the fix, save/load works as expected on AMD
hosts.

Signed-off-by: Uri Lublin <uril@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Leonard Norrgard authored and Linus Torvalds committed Jan 26, 2007
1 parent 4b89eed commit bce66ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,14 +680,14 @@ static void svm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l)

static void svm_get_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt)
{
dt->limit = vcpu->svm->vmcb->save.ldtr.limit;
dt->base = vcpu->svm->vmcb->save.ldtr.base;
dt->limit = vcpu->svm->vmcb->save.idtr.limit;
dt->base = vcpu->svm->vmcb->save.idtr.base;
}

static void svm_set_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt)
{
vcpu->svm->vmcb->save.ldtr.limit = dt->limit;
vcpu->svm->vmcb->save.ldtr.base = dt->base ;
vcpu->svm->vmcb->save.idtr.limit = dt->limit;
vcpu->svm->vmcb->save.idtr.base = dt->base ;
}

static void svm_get_gdt(struct kvm_vcpu *vcpu, struct descriptor_table *dt)
Expand Down

0 comments on commit bce66ca

Please sign in to comment.