Commit bce66ca4 authored by Leonard Norrgard's avatar Leonard Norrgard Committed by Linus Torvalds

[PATCH] KVM: SVM: Fix SVM idt confusion

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: default avatarUri Lublin <uril@qumranet.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4b89eed9
...@@ -680,14 +680,14 @@ static void svm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l) ...@@ -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) static void svm_get_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt)
{ {
dt->limit = vcpu->svm->vmcb->save.ldtr.limit; dt->limit = vcpu->svm->vmcb->save.idtr.limit;
dt->base = vcpu->svm->vmcb->save.ldtr.base; dt->base = vcpu->svm->vmcb->save.idtr.base;
} }
static void svm_set_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) 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.idtr.limit = dt->limit;
vcpu->svm->vmcb->save.ldtr.base = dt->base ; vcpu->svm->vmcb->save.idtr.base = dt->base ;
} }
static void svm_get_gdt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) static void svm_get_gdt(struct kvm_vcpu *vcpu, struct descriptor_table *dt)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment