From b3445a758a5d24eb278aa069c87e2008014c7990 Mon Sep 17 00:00:00 2001 From: Srivatsa Vaddagiri Date: Thu, 16 Mar 2006 23:04:06 -0800 Subject: [PATCH] --- yaml --- r: 21083 b: refs/heads/master c: 82c3c03a4096badd026c6e337f3c5dde020e9ec6 h: refs/heads/master i: 21081: 1f33e5e53bbce4f66665cff2537ad70407a1f8ae 21079: 995b3fb21722a63bf0478d85316e8b59f28c6efc v: v3 --- [refs] | 2 +- trunk/arch/i386/kernel/smpboot.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 4d4970d067a0..0abc9ed94451 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8532159f5521ba24e697f0d25970ae89ff62a1f2 +refs/heads/master: 82c3c03a4096badd026c6e337f3c5dde020e9ec6 diff --git a/trunk/arch/i386/kernel/smpboot.c b/trunk/arch/i386/kernel/smpboot.c index eba7f53f8b4a..7007e1783797 100644 --- a/trunk/arch/i386/kernel/smpboot.c +++ b/trunk/arch/i386/kernel/smpboot.c @@ -1029,6 +1029,16 @@ int __devinit smp_prepare_cpu(int cpu) int apicid, ret; lock_cpu_hotplug(); + + /* + * On x86, CPU0 is never offlined. Trying to bring up an + * already-booted CPU will hang. So check for that case. + */ + if (cpu_online(cpu)) { + ret = -EINVAL; + goto exit; + } + apicid = x86_cpu_to_apicid[cpu]; if (apicid == BAD_APICID) { ret = -ENODEV;