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>
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;
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);
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();
* 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);
if (selector == 0)
return 0;
- kvm_get_gdt(&gdt);
+ native_store_gdt(&gdt);
table_base = gdt.address;
if (selector & 4) { /* from ldt */