aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 6277a316821e..c7ec0c921c01 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -132,13 +132,12 @@ unsigned long segment_base(u16 selector)
132 if (selector == 0) 132 if (selector == 0)
133 return 0; 133 return 0;
134 134
135 asm("sgdt %0" : "=m"(gdt)); 135 kvm_get_gdt(&gdt);
136 table_base = gdt.base; 136 table_base = gdt.base;
137 137
138 if (selector & 4) { /* from ldt */ 138 if (selector & 4) { /* from ldt */
139 u16 ldt_selector; 139 u16 ldt_selector = kvm_read_ldt();
140 140
141 asm("sldt %0" : "=g"(ldt_selector));
142 table_base = segment_base(ldt_selector); 141 table_base = segment_base(ldt_selector);
143 } 142 }
144 d = (struct desc_struct *)(table_base + (selector & ~7)); 143 d = (struct desc_struct *)(table_base + (selector & ~7));