diff options
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/intel/haswell/mp_init.c | 4 | ||||
-rw-r--r-- | src/cpu/x86/lapic/lapic_cpu_init.c | 18 | ||||
-rw-r--r-- | src/cpu/x86/lapic/secondary.S | 8 |
3 files changed, 25 insertions, 5 deletions
diff --git a/src/cpu/intel/haswell/mp_init.c b/src/cpu/intel/haswell/mp_init.c index 3076d070ec..47683fb78c 100644 --- a/src/cpu/intel/haswell/mp_init.c +++ b/src/cpu/intel/haswell/mp_init.c @@ -66,7 +66,7 @@ struct saved_msr { extern char _binary_sipi_vector_start[]; /* These symbols are defined in c_start.S. */ extern char gdt[]; -extern char gdt_limit[]; +extern char gdt_end[]; extern char idtarg[]; /* This table keeps track of each CPU's APIC id. */ @@ -189,7 +189,7 @@ static void setup_default_sipi_vector_params(struct sipi_params *sp) int i; sp->gdt = (u32)&gdt; - sp->gdtlimit = (u32)&gdt_limit; + sp->gdtlimit = (u32)&gdt_end - (u32)&gdt - 1; sp->idt_ptr = (u32)&idtarg; sp->stack_size = CONFIG_STACK_SIZE; sp->stack_top = (u32)&_estack; diff --git a/src/cpu/x86/lapic/lapic_cpu_init.c b/src/cpu/x86/lapic/lapic_cpu_init.c index 9a00b8289f..69430d551f 100644 --- a/src/cpu/x86/lapic/lapic_cpu_init.c +++ b/src/cpu/x86/lapic/lapic_cpu_init.c @@ -52,12 +52,30 @@ int lowmem_backup_size; #endif extern char _secondary_start[]; +extern char _secondary_gdt_addr[]; +extern char gdt[]; +extern char gdt_end[]; + +static inline void setup_secondary_gdt(void) +{ + u16 *gdt_limit; + u32 *gdt_base; + + gdt_limit = (void *)&_secondary_gdt_addr; + gdt_base = (void *)&gdt_limit[1]; + + *gdt_limit = (u32)&gdt_end - (u32)&gdt - 1; + *gdt_base = (u32)&gdt; +} static void copy_secondary_start_to_lowest_1M(void) { extern char _secondary_start_end[]; unsigned long code_size; + /* Fill in secondary_start's local gdt. */ + setup_secondary_gdt(); + code_size = (unsigned long)_secondary_start_end - (unsigned long)_secondary_start; #if CONFIG_HAVE_ACPI_RESUME diff --git a/src/cpu/x86/lapic/secondary.S b/src/cpu/x86/lapic/secondary.S index 2e0620e2da..6edcd0a366 100644 --- a/src/cpu/x86/lapic/secondary.S +++ b/src/cpu/x86/lapic/secondary.S @@ -3,7 +3,7 @@ #if CONFIG_SMP && CONFIG_MAX_CPUS > 1 .text - .globl _secondary_start, _secondary_start_end + .globl _secondary_start, _secondary_start_end, _secondary_gdt_addr .balign 4096 _secondary_start: .code16 @@ -28,9 +28,11 @@ _secondary_start: ljmpl $0x10, $__ap_protected_start + /* This will get filled in by C code. */ +_secondary_gdt_addr: gdtaddr: - .word gdt_limit /* the table limit */ - .long gdt /* we know the offset */ + .word 0 /* the table limit */ + .long 0 /* we know the offset */ _secondary_start_end: |