• Eric W. Biederman's avatar
    [PATCH] Fix sync_tsc hang · 3d483f47
    Eric W. Biederman authored
    sync_tsc was using smp_call_function to ask the boot processor to report
    it's tsc value.  smp_call_function performs an IPI_send_allbutself which is
    a broadcast ipi.  There is a window during processor startup during which
    the target cpu has started and before it has initialized it's interrupt
    vectors so it can properly process an interrupt.  Receveing an interrupt
    during that window will triple fault the cpu and do other nasty things.
    
    Why cli does not protect us from that is beyond me.
    
    The simple fix is to match ia64 and provide a smp_call_function_single.
    Which avoids the broadcast and is more efficient.
    
    This certainly fixes the problem of getting stuck on boot which was
    very easy to trigger on my SMP Hyperthreaded Xeon, and I think
    it fixes it for the right reasons.
    
    Minor changes by AK
    Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
    Signed-off-by: default avatarAndi Kleen <ak@suse.de>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    3d483f47
smpboot.c 29 KB