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.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index b7c32f63671d..a063f449a12e 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -15,7 +15,6 @@
15 */ 15 */
16 16
17#include <linux/kvm_host.h> 17#include <linux/kvm_host.h>
18#include "segment_descriptor.h"
19#include "irq.h" 18#include "irq.h"
20#include "mmu.h" 19#include "mmu.h"
21 20
@@ -29,6 +28,7 @@
29 28
30#include <asm/uaccess.h> 29#include <asm/uaccess.h>
31#include <asm/msr.h> 30#include <asm/msr.h>
31#include <asm/desc.h>
32 32
33#define MAX_IO_MSRS 256 33#define MAX_IO_MSRS 256
34#define CR0_RESERVED_BITS \ 34#define CR0_RESERVED_BITS \
@@ -94,7 +94,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
94unsigned long segment_base(u16 selector) 94unsigned long segment_base(u16 selector)
95{ 95{
96 struct descriptor_table gdt; 96 struct descriptor_table gdt;
97 struct segment_descriptor *d; 97 struct desc_struct *d;
98 unsigned long table_base; 98 unsigned long table_base;
99 unsigned long v; 99 unsigned long v;
100 100
@@ -110,13 +110,12 @@ unsigned long segment_base(u16 selector)
110 asm("sldt %0" : "=g"(ldt_selector)); 110 asm("sldt %0" : "=g"(ldt_selector));
111 table_base = segment_base(ldt_selector); 111 table_base = segment_base(ldt_selector);
112 } 112 }
113 d = (struct segment_descriptor *)(table_base + (selector & ~7)); 113 d = (struct desc_struct *)(table_base + (selector & ~7));
114 v = d->base_low | ((unsigned long)d->base_mid << 16) | 114 v = d->base0 | ((unsigned long)d->base1 << 16) |
115 ((unsigned long)d->base_high << 24); 115 ((unsigned long)d->base2 << 24);
116#ifdef CONFIG_X86_64 116#ifdef CONFIG_X86_64
117 if (d->system == 0 && (d->type == 2 || d->type == 9 || d->type == 11)) 117 if (d->s == 0 && (d->type == 2 || d->type == 9 || d->type == 11))
118 v |= ((unsigned long) \ 118 v |= ((unsigned long)((struct ldttss_desc64 *)d)->base3) << 32;
119 ((struct segment_descriptor_64 *)d)->base_higher) << 32;
120#endif 119#endif
121 return v; 120 return v;
122} 121}