aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2009-07-18 11:00:01 -0400
committerAvi Kivity <avi@redhat.com>2009-09-10 01:33:15 -0400
commitb792c344dfd57ee2cf737440e4a9b4a5bc39d1db (patch)
treef91b48042d1060bd761e7025d2b5c5b2960b4566 /arch/x86/kvm/svm.c
parent46a359e71526909a18a47aaf4347343d6d1d74b2 (diff)
KVM: x86: use kvm_get_gdt() and kvm_read_ldt()
Use kvm_get_gdt() and kvm_read_ldt() to reduce inline assembly code. Cc: Avi Kivity <avi@redhat.com> Cc: kvm@vger.kernel.org Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 8728e514c851..92fc0dab505d 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -290,7 +290,7 @@ static void svm_hardware_enable(void *garbage)
290 290
291 struct svm_cpu_data *svm_data; 291 struct svm_cpu_data *svm_data;
292 uint64_t efer; 292 uint64_t efer;
293 struct desc_ptr gdt_descr; 293 struct descriptor_table gdt_descr;
294 struct desc_struct *gdt; 294 struct desc_struct *gdt;
295 int me = raw_smp_processor_id(); 295 int me = raw_smp_processor_id();
296 296
@@ -310,8 +310,8 @@ static void svm_hardware_enable(void *garbage)
310 svm_data->max_asid = cpuid_ebx(SVM_CPUID_FUNC) - 1; 310 svm_data->max_asid = cpuid_ebx(SVM_CPUID_FUNC) - 1;
311 svm_data->next_asid = svm_data->max_asid + 1; 311 svm_data->next_asid = svm_data->max_asid + 1;
312 312
313 asm volatile ("sgdt %0" : "=m"(gdt_descr)); 313 kvm_get_gdt(&gdt_descr);
314 gdt = (struct desc_struct *)gdt_descr.address; 314 gdt = (struct desc_struct *)gdt_descr.base;
315 svm_data->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS); 315 svm_data->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS);
316 316
317 rdmsrl(MSR_EFER, efer); 317 rdmsrl(MSR_EFER, efer);