Skip to content

Commit

Permalink
x86: add barriers statement
Browse files Browse the repository at this point in the history
goal is to have i386 and x86_64 closer, so we
add barriers to match

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Glauber de Oliveira Costa authored and Ingo Molnar committed Apr 17, 2008
1 parent 148a30f commit fa8004d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86/kernel/smpboot_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ static void __cpuinit start_secondary(void *unused)
smp_callin();
while (!cpu_isset(smp_processor_id(), smp_commenced_mask))
cpu_relax();

/* otherwise gcc will move up smp_processor_id before the cpu_init */
barrier();
/*
* Check TSC synchronization with the BP:
*/
Expand Down Expand Up @@ -432,6 +435,7 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
Dprintk("Waiting for send to finish...\n");
send_status = safe_apic_wait_icr_idle();

mb();
atomic_set(&init_deasserted, 1);

/*
Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/smpboot_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ void __cpuinit start_secondary(void)

setup_secondary_clock();

wmb();
cpu_idle();
}

Expand Down

0 comments on commit fa8004d

Please sign in to comment.