KVM: Drop kvm_get_gdt() in favor of generic linux function
authorGleb Natapov <gleb@redhat.com>
Thu, 25 Feb 2010 10:43:07 +0000 (12:43 +0200)
committerAvi Kivity <avi@redhat.com>
Sun, 25 Apr 2010 10:53:32 +0000 (13:53 +0300)
Linux now has native_store_gdt() to do the same. Use it instead of
kvm local version.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c

index 502fff123e2955b3d46c0447b37150bb40d66e60..e3167224d93696ae60f7187937eb3338b3a6a5fc 100644 (file)
@@ -723,11 +723,6 @@ static inline void kvm_get_idt(struct desc_ptr *table)
        asm("sidt %0" : "=m"(*table));
 }
 
-static inline void kvm_get_gdt(struct desc_ptr *table)
-{
-       asm("sgdt %0" : "=m"(*table));
-}
-
 static inline unsigned long kvm_read_tr_base(void)
 {
        u16 tr;
index 38f1fceefea1cd71a1831e19ac1d78a586ba3c11..6882be5b926798e5bf06548904ef43749dff47a9 100644 (file)
@@ -368,7 +368,7 @@ static int svm_hardware_enable(void *garbage)
        sd->max_asid = cpuid_ebx(SVM_CPUID_FUNC) - 1;
        sd->next_asid = sd->max_asid + 1;
 
-       kvm_get_gdt(&gdt_descr);
+       native_store_gdt(&gdt_descr);
        gdt = (struct desc_struct *)gdt_descr.address;
        sd->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS);
 
index 61f03980adaee2b4983127a21a661f3575466c29..68712bdf040703742ccef2256308fafe8c519e51 100644 (file)
@@ -603,7 +603,7 @@ static void reload_tss(void)
        struct desc_ptr gdt;
        struct desc_struct *descs;
 
-       kvm_get_gdt(&gdt);
+       native_store_gdt(&gdt);
        descs = (void *)gdt.address;
        descs[GDT_ENTRY_TSS].type = 9; /* available TSS */
        load_TR_desc();
@@ -767,7 +767,7 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
                 * processors.
                 */
                vmcs_writel(HOST_TR_BASE, kvm_read_tr_base()); /* 22.2.4 */
-               kvm_get_gdt(&dt);
+               native_store_gdt(&dt);
                vmcs_writel(HOST_GDTR_BASE, dt.address);   /* 22.2.4 */
 
                rdmsrl(MSR_IA32_SYSENTER_ESP, sysenter_esp);
index d0b184b5c2480e2cd72c931e876e611cf95cbe8a..e07b243055f835a35ee8db9f1a2b932dfc601208 100644 (file)
@@ -233,7 +233,7 @@ unsigned long segment_base(u16 selector)
        if (selector == 0)
                return 0;
 
-       kvm_get_gdt(&gdt);
+       native_store_gdt(&gdt);
        table_base = gdt.address;
 
        if (selector & 4) {           /* from ldt */