diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2007-05-02 13:27:16 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 13:27:16 -0400 |
commit | c5413fbe894924ddb8aa474a4d4da52e7a6c7e0b (patch) | |
tree | 8f317bf2494b6b4bceb5e6d1ee35fabc0eeb9971 /include/asm-i386 | |
parent | 1956c73bb5bf81ee577ed7d3c64e3cad876ad2a5 (diff) |
[PATCH] i386: Fix UP gdt bugs
Fixes two problems with the GDT when compiling for uniprocessor:
- There's no percpu segment, so trying to load its selector into %fs fails.
Use a null selector instead.
- The real gdt needs to be loaded at some point. Do it in cpu_init().
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/asm-i386')
-rw-r--r-- | include/asm-i386/processor.h | 1 | ||||
-rw-r--r-- | include/asm-i386/segment.h | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index ced2da8a0d65..70f3515c3db0 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
@@ -750,6 +750,7 @@ extern void enable_sep_cpu(void); | |||
750 | extern int sysenter_setup(void); | 750 | extern int sysenter_setup(void); |
751 | 751 | ||
752 | extern void cpu_set_gdt(int); | 752 | extern void cpu_set_gdt(int); |
753 | extern void switch_to_new_gdt(void); | ||
753 | extern void cpu_init(void); | 754 | extern void cpu_init(void); |
754 | 755 | ||
755 | extern int force_mwait; | 756 | extern int force_mwait; |
diff --git a/include/asm-i386/segment.h b/include/asm-i386/segment.h index 07e70624d87c..597a47c2515f 100644 --- a/include/asm-i386/segment.h +++ b/include/asm-i386/segment.h | |||
@@ -75,7 +75,11 @@ | |||
75 | #define __ESPFIX_SS (GDT_ENTRY_ESPFIX_SS * 8) | 75 | #define __ESPFIX_SS (GDT_ENTRY_ESPFIX_SS * 8) |
76 | 76 | ||
77 | #define GDT_ENTRY_PERCPU (GDT_ENTRY_KERNEL_BASE + 15) | 77 | #define GDT_ENTRY_PERCPU (GDT_ENTRY_KERNEL_BASE + 15) |
78 | #ifdef CONFIG_SMP | ||
78 | #define __KERNEL_PERCPU (GDT_ENTRY_PERCPU * 8) | 79 | #define __KERNEL_PERCPU (GDT_ENTRY_PERCPU * 8) |
80 | #else | ||
81 | #define __KERNEL_PERCPU 0 | ||
82 | #endif | ||
79 | 83 | ||
80 | #define GDT_ENTRY_DOUBLEFAULT_TSS 31 | 84 | #define GDT_ENTRY_DOUBLEFAULT_TSS 31 |
81 | 85 | ||