summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/desc_defs.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-08-28 08:47:42 +0200
committerIngo Molnar <mingo@kernel.org>2017-08-29 12:07:25 +0200
commit87cc037674342cbf6213829b2cc59bb71be60777 (patch)
treee66f2e790f39b9c87d7b18c10d93a8e3b3a6d81f /arch/x86/include/asm/desc_defs.h
parent38e9e81f4c81c75799b002d5811de7241b307676 (diff)
downloadlinux-stable-87cc037674342cbf6213829b2cc59bb71be60777.tar.gz
linux-stable-87cc037674342cbf6213829b2cc59bb71be60777.tar.bz2
linux-stable-87cc037674342cbf6213829b2cc59bb71be60777.zip
x86/ldttss: Clean up 32-bit descriptors
Like the IDT descriptors, the LDT/TSS descriptors are pointlessly different on 32 and 64 bit kernels. Unify them and get rid of the duplicated code. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/20170828064958.289634692@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/desc_defs.h')
-rw-r--r--arch/x86/include/asm/desc_defs.h27
1 files changed, 12 insertions, 15 deletions
diff --git a/arch/x86/include/asm/desc_defs.h b/arch/x86/include/asm/desc_defs.h
index 1b9494e006a1..346d252029b7 100644
--- a/arch/x86/include/asm/desc_defs.h
+++ b/arch/x86/include/asm/desc_defs.h
@@ -49,24 +49,21 @@ enum {
DESCTYPE_S = 0x10, /* !system */
};
-/* LDT or TSS descriptor in the GDT. 16 bytes. */
-struct ldttss_desc64 {
- u16 limit0;
- u16 base0;
- unsigned base1 : 8, type : 5, dpl : 2, p : 1;
- unsigned limit1 : 4, zero0 : 3, g : 1, base2 : 8;
- u32 base3;
- u32 zero1;
-} __attribute__((packed));
-
+/* LDT or TSS descriptor in the GDT. */
+struct ldttss_desc {
+ u16 limit0;
+ u16 base0;
+ u16 base1 : 8, type : 5, dpl : 2, p : 1;
+ u16 limit1 : 4, zero0 : 3, g : 1, base2 : 8;
#ifdef CONFIG_X86_64
-typedef struct ldttss_desc64 ldt_desc;
-typedef struct ldttss_desc64 tss_desc;
-#else
-typedef struct desc_struct ldt_desc;
-typedef struct desc_struct tss_desc;
+ u32 base3;
+ u32 zero1;
#endif
+} __attribute__((packed));
+
+typedef struct ldttss_desc ldt_desc;
+typedef struct ldttss_desc tss_desc;
struct idt_bits {
u16 ist : 3,