repository: /home/avi/kvm/linux-2.6
branch: master
commit d24618db16bd6d6d7ea6129e2de8433416f81823
Author: Avi Kivity <[EMAIL PROTECTED]>
Date:   Wed Nov 21 17:34:40 2007 +0200

    KVM: Replace private 'struct segment descriptor' by x86's desc_struct
    
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>

diff --git a/drivers/kvm/segment_descriptor.h b/drivers/kvm/segment_descriptor.h
deleted file mode 100644
index 56fc4c8..0000000
--- a/drivers/kvm/segment_descriptor.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __SEGMENT_DESCRIPTOR_H
-#define __SEGMENT_DESCRIPTOR_H
-
-struct segment_descriptor {
-       u16 limit_low;
-       u16 base_low;
-       u8  base_mid;
-       u8  type : 4;
-       u8  system : 1;
-       u8  dpl : 2;
-       u8  present : 1;
-       u8  limit_high : 4;
-       u8  avl : 1;
-       u8  long_mode : 1;
-       u8  default_op : 1;
-       u8  granularity : 1;
-       u8  base_high;
-} __attribute__((packed));
-
-#ifdef CONFIG_X86_64
-/* LDT or TSS descriptor in the GDT. 16 bytes. */
-struct segment_descriptor_64 {
-       struct segment_descriptor s;
-       u32 base_higher;
-       u32 pad_zero;
-};
-
-#endif
-#endif
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 4ad60c9..1a7ee02 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -20,7 +20,6 @@
 #include "x86_emulate.h"
 #include "irq.h"
 #include "vmx.h"
-#include "segment_descriptor.h"
 
 #include <linux/module.h>
 #include <linux/kernel.h>
diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index ad1665c..716a0a3 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -17,7 +17,6 @@
 #include "kvm.h"
 #include "x86.h"
 #include "x86_emulate.h"
-#include "segment_descriptor.h"
 #include "irq.h"
 
 #include <linux/kvm.h>
@@ -28,6 +27,7 @@
 
 #include <asm/uaccess.h>
 #include <asm/msr.h>
+#include <asm/desc_defs.h>
 
 #define MAX_IO_MSRS 256
 #define CR0_RESERVED_BITS                                              \
@@ -81,7 +81,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
 unsigned long segment_base(u16 selector)
 {
        struct descriptor_table gdt;
-       struct segment_descriptor *d;
+       struct desc_struct *d;
        unsigned long table_base;
        unsigned long v;
 
@@ -97,13 +97,11 @@ unsigned long segment_base(u16 selector)
                asm("sldt %0" : "=g"(ldt_selector));
                table_base = segment_base(ldt_selector);
        }
-       d = (struct segment_descriptor *)(table_base + (selector & ~7));
-       v = d->base_low | ((unsigned long)d->base_mid << 16) |
-               ((unsigned long)d->base_high << 24);
+       d = (struct desc_struct *)(table_base + (selector & ~7));
+       v = d->base0 | (d->base1 << 16) | (d->base2 << 24);
 #ifdef CONFIG_X86_64
-       if (d->system == 0 && (d->type == 2 || d->type == 9 || d->type == 11))
-               v |= ((unsigned long) \
-                     ((struct segment_descriptor_64 *)d)->base_higher) << 32;
+       if (d->s == 0 && (d->type == 2 || d->type == 9 || d->type == 11))
+               v |= (unsigned long)((struct ldttss_desc *)d)->base3 << 32;
 #endif
        return v;
 }

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-commits mailing list
kvm-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-commits

Reply via email to