mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
[PATCH] x86: fix broken SMP boot sequence
Recent GDT changes broke the SMP boot sequence if the booting CPU is numbered anything other than zero. There's also a subtle source of error in that the boot time CPU now uses cpu_gdt_table (which is actually the GDT for booting CPUs in head.S). This patch fixes both problems by making GDT descriptors themselves allocated from a per_cpu area and switching to them in cpu_init(), which now means that cpu_gdt_table is exclusively used for booting CPUs again. Signed-off-by: James Bottomley <[email protected]> Cc: Zachary Amsden <[email protected]> Cc: Matt Tolentino <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
1e275d406b
commit
2b932f6cf0
6 changed files with 39 additions and 21 deletions
|
|
@ -24,11 +24,13 @@ struct Xgt_desc_struct {
|
|||
unsigned short pad;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS];
|
||||
extern struct Xgt_desc_struct idt_descr;
|
||||
DECLARE_PER_CPU(struct Xgt_desc_struct, cpu_gdt_descr);
|
||||
|
||||
|
||||
static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu)
|
||||
{
|
||||
return ((struct desc_struct *)cpu_gdt_descr[cpu].address);
|
||||
return (struct desc_struct *)per_cpu(cpu_gdt_descr, cpu).address;
|
||||
}
|
||||
|
||||
#define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8))
|
||||
|
|
|
|||
Loading…
Reference in a new issue