diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-02-25 05:43:07 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-04-25 06:53:32 -0400 |
commit | d6ab1ed44627c91d0a857a430b7ec4ed8648c7a5 (patch) | |
tree | d029c6a5644b336148036a2a98d77273595d9487 | |
parent | f5c9803173848864d0c56108b9e102db0bf601de (diff) |
KVM: Drop kvm_get_gdt() in favor of generic linux function
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>
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 5 | ||||
-rw-r--r-- | arch/x86/kvm/svm.c | 2 | ||||
-rw-r--r-- | arch/x86/kvm/vmx.c | 4 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 2 |
4 files changed, 4 insertions, 9 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 502fff123e29..e3167224d936 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -723,11 +723,6 @@ static inline void kvm_get_idt(struct desc_ptr *table) | |||
723 | asm("sidt %0" : "=m"(*table)); | 723 | asm("sidt %0" : "=m"(*table)); |
724 | } | 724 | } |
725 | 725 | ||
726 | static inline void kvm_get_gdt(struct desc_ptr *table) | ||
727 | { | ||
728 | asm("sgdt %0" : "=m"(*table)); | ||
729 | } | ||
730 | |||
731 | static inline unsigned long kvm_read_tr_base(void) | 726 | static inline unsigned long kvm_read_tr_base(void) |
732 | { | 727 | { |
733 | u16 tr; | 728 | u16 tr; |
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 38f1fceefea1..6882be5b9267 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -368,7 +368,7 @@ static int svm_hardware_enable(void *garbage) | |||
368 | sd->max_asid = cpuid_ebx(SVM_CPUID_FUNC) - 1; | 368 | sd->max_asid = cpuid_ebx(SVM_CPUID_FUNC) - 1; |
369 | sd->next_asid = sd->max_asid + 1; | 369 | sd->next_asid = sd->max_asid + 1; |
370 | 370 | ||
371 | kvm_get_gdt(&gdt_descr); | 371 | native_store_gdt(&gdt_descr); |
372 | gdt = (struct desc_struct *)gdt_descr.address; | 372 | gdt = (struct desc_struct *)gdt_descr.address; |
373 | sd->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS); | 373 | sd->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS); |
374 | 374 | ||
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 61f03980adae..68712bdf0407 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -603,7 +603,7 @@ static void reload_tss(void) | |||
603 | struct desc_ptr gdt; | 603 | struct desc_ptr gdt; |
604 | struct desc_struct *descs; | 604 | struct desc_struct *descs; |
605 | 605 | ||
606 | kvm_get_gdt(&gdt); | 606 | native_store_gdt(&gdt); |
607 | descs = (void *)gdt.address; | 607 | descs = (void *)gdt.address; |
608 | descs[GDT_ENTRY_TSS].type = 9; /* available TSS */ | 608 | descs[GDT_ENTRY_TSS].type = 9; /* available TSS */ |
609 | load_TR_desc(); | 609 | load_TR_desc(); |
@@ -767,7 +767,7 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu) | |||
767 | * processors. | 767 | * processors. |
768 | */ | 768 | */ |
769 | vmcs_writel(HOST_TR_BASE, kvm_read_tr_base()); /* 22.2.4 */ | 769 | vmcs_writel(HOST_TR_BASE, kvm_read_tr_base()); /* 22.2.4 */ |
770 | kvm_get_gdt(&dt); | 770 | native_store_gdt(&dt); |
771 | vmcs_writel(HOST_GDTR_BASE, dt.address); /* 22.2.4 */ | 771 | vmcs_writel(HOST_GDTR_BASE, dt.address); /* 22.2.4 */ |
772 | 772 | ||
773 | rdmsrl(MSR_IA32_SYSENTER_ESP, sysenter_esp); | 773 | rdmsrl(MSR_IA32_SYSENTER_ESP, sysenter_esp); |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index d0b184b5c248..e07b243055f8 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -233,7 +233,7 @@ unsigned long segment_base(u16 selector) | |||
233 | if (selector == 0) | 233 | if (selector == 0) |
234 | return 0; | 234 | return 0; |
235 | 235 | ||
236 | kvm_get_gdt(&gdt); | 236 | native_store_gdt(&gdt); |
237 | table_base = gdt.address; | 237 | table_base = gdt.address; |
238 | 238 | ||
239 | if (selector & 4) { /* from ldt */ | 239 | if (selector & 4) { /* from ldt */ |