diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-02-16 03:51:48 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-04-25 05:27:28 -0400 |
commit | 89a27f4d0e042a2fa3391a76b652aec3e16ef200 (patch) | |
tree | d2cf954c066c6f5fbd51a15a439b63d1dba53edd /arch/x86/kvm/svm.c | |
parent | 679613442f84702c06a80f2320cb8a50089200bc (diff) |
KVM: use desc_ptr struct instead of kvm private descriptor_table
x86 arch defines desc_ptr for idt/gdt pointers, no need to define
another structure in kvm code.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 2ba58206812a..77fa2e3053b5 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -319,7 +319,7 @@ static int svm_hardware_enable(void *garbage) | |||
319 | 319 | ||
320 | struct svm_cpu_data *sd; | 320 | struct svm_cpu_data *sd; |
321 | uint64_t efer; | 321 | uint64_t efer; |
322 | struct descriptor_table gdt_descr; | 322 | struct desc_ptr gdt_descr; |
323 | struct desc_struct *gdt; | 323 | struct desc_struct *gdt; |
324 | int me = raw_smp_processor_id(); | 324 | int me = raw_smp_processor_id(); |
325 | 325 | ||
@@ -345,7 +345,7 @@ static int svm_hardware_enable(void *garbage) | |||
345 | sd->next_asid = sd->max_asid + 1; | 345 | sd->next_asid = sd->max_asid + 1; |
346 | 346 | ||
347 | kvm_get_gdt(&gdt_descr); | 347 | kvm_get_gdt(&gdt_descr); |
348 | gdt = (struct desc_struct *)gdt_descr.base; | 348 | gdt = (struct desc_struct *)gdt_descr.address; |
349 | sd->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS); | 349 | sd->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS); |
350 | 350 | ||
351 | wrmsrl(MSR_EFER, efer | EFER_SVME); | 351 | wrmsrl(MSR_EFER, efer | EFER_SVME); |
@@ -936,36 +936,36 @@ static int svm_get_cpl(struct kvm_vcpu *vcpu) | |||
936 | return save->cpl; | 936 | return save->cpl; |
937 | } | 937 | } |
938 | 938 | ||
939 | static void svm_get_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) | 939 | static void svm_get_idt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) |
940 | { | 940 | { |
941 | struct vcpu_svm *svm = to_svm(vcpu); | 941 | struct vcpu_svm *svm = to_svm(vcpu); |
942 | 942 | ||
943 | dt->limit = svm->vmcb->save.idtr.limit; | 943 | dt->size = svm->vmcb->save.idtr.limit; |
944 | dt->base = svm->vmcb->save.idtr.base; | 944 | dt->address = svm->vmcb->save.idtr.base; |
945 | } | 945 | } |
946 | 946 | ||
947 | static void svm_set_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) | 947 | static void svm_set_idt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) |
948 | { | 948 | { |
949 | struct vcpu_svm *svm = to_svm(vcpu); | 949 | struct vcpu_svm *svm = to_svm(vcpu); |
950 | 950 | ||
951 | svm->vmcb->save.idtr.limit = dt->limit; | 951 | svm->vmcb->save.idtr.limit = dt->size; |
952 | svm->vmcb->save.idtr.base = dt->base ; | 952 | svm->vmcb->save.idtr.base = dt->address ; |
953 | } | 953 | } |
954 | 954 | ||
955 | static void svm_get_gdt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) | 955 | static void svm_get_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) |
956 | { | 956 | { |
957 | struct vcpu_svm *svm = to_svm(vcpu); | 957 | struct vcpu_svm *svm = to_svm(vcpu); |
958 | 958 | ||
959 | dt->limit = svm->vmcb->save.gdtr.limit; | 959 | dt->size = svm->vmcb->save.gdtr.limit; |
960 | dt->base = svm->vmcb->save.gdtr.base; | 960 | dt->address = svm->vmcb->save.gdtr.base; |
961 | } | 961 | } |
962 | 962 | ||
963 | static void svm_set_gdt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) | 963 | static void svm_set_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) |
964 | { | 964 | { |
965 | struct vcpu_svm *svm = to_svm(vcpu); | 965 | struct vcpu_svm *svm = to_svm(vcpu); |
966 | 966 | ||
967 | svm->vmcb->save.gdtr.limit = dt->limit; | 967 | svm->vmcb->save.gdtr.limit = dt->size; |
968 | svm->vmcb->save.gdtr.base = dt->base ; | 968 | svm->vmcb->save.gdtr.base = dt->address ; |
969 | } | 969 | } |
970 | 970 | ||
971 | static void svm_decache_cr0_guest_bits(struct kvm_vcpu *vcpu) | 971 | static void svm_decache_cr0_guest_bits(struct kvm_vcpu *vcpu) |