2 * x86 SMP booting functions
4 * (c) 1995 Alan Cox, Building #3 <alan@redhat.com>
5 * (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com>
7 * Much of the core SMP work is based on previous work by Thomas Radke, to
8 * whom a great many thanks are extended.
10 * Thanks to Intel for making available several different Pentium,
11 * Pentium Pro and Pentium-II/Xeon MP machines.
12 * Original development of Linux SMP code supported by Caldera.
14 * This code is released under the GNU public license version 2 or
18 * Felix Koop : NR_CPUS used properly
19 * Jose Renau : Handle single CPU case.
20 * Alan Cox : By repeated request 8) - Total BogoMIP report.
21 * Greg Wright : Fix for kernel stacks panic.
22 * Erich Boleyn : MP v1.4 and additional changes.
23 * Matthias Sattler : Changes for 2.1 kernel map.
24 * Michel Lespinasse : Changes for 2.1 kernel map.
25 * Michael Chastain : Change trampoline.S to gnu as.
26 * Alan Cox : Dumb bug: 'B' step PPro's are fine
27 * Ingo Molnar : Added APIC timers, based on code
29 * Ingo Molnar : various cleanups and rewrites
30 * Tigran Aivazian : fixed "0.00 in /proc/uptime on SMP" bug.
31 * Maciej W. Rozycki : Bits for genuine 82489DX APICs
34 #include <linux/config.h>
35 #include <linux/init.h>
38 #include <linux/kernel_stat.h>
39 #include <linux/smp_lock.h>
40 #include <linux/irq.h>
41 #include <linux/bootmem.h>
43 #include <linux/delay.h>
44 #include <linux/mc146818rtc.h>
46 #include <asm/pgalloc.h>
48 /* Set if we find a B stepping CPU */
49 static int smp_b_stepping
;
51 /* Setup configured maximum number of CPUs to activate */
52 static int max_cpus
= -1;
54 /* Total count of live CPUs */
57 /* Bitmask of currently online CPUs */
58 unsigned long cpu_online_map
;
60 /* which CPU (physical APIC ID) maps to which logical CPU number */
61 volatile int x86_apicid_to_cpu
[NR_CPUS
];
62 /* which logical CPU number maps to which CPU (physical APIC ID) */
63 volatile int x86_cpu_to_apicid
[NR_CPUS
];
65 static volatile unsigned long cpu_callin_map
;
66 static volatile unsigned long cpu_callout_map
;
68 /* Per CPU bogomips and other parameters */
69 struct cpuinfo_x86 cpu_data
[NR_CPUS
];
71 /* Set when the idlers are all forked */
72 int smp_threads_ready
;
75 * Setup routine for controlling SMP activation
77 * Command-line option of "nosmp" or "maxcpus=0" will disable SMP
78 * activation entirely (the MPS table probe still happens, though).
80 * Command-line option of "maxcpus=<NUM>", where <NUM> is an integer
81 * greater than 0, limits the maximum number of CPUs activated in
85 static int __init
nosmp(char *str
)
91 __setup("nosmp", nosmp
);
93 static int __init
maxcpus(char *str
)
95 get_option(&str
, &max_cpus
);
99 __setup("maxcpus=", maxcpus
);
102 * Trampoline 80x86 program as an array.
105 extern unsigned char trampoline_data
[];
106 extern unsigned char trampoline_end
[];
107 static unsigned char *trampoline_base
;
110 * Currently trivial. Write the real->protected mode
111 * bootstrap into the page concerned. The caller
112 * has made sure it's suitably aligned.
115 static unsigned long __init
setup_trampoline(void)
117 memcpy(trampoline_base
, trampoline_data
, trampoline_end
- trampoline_data
);
118 return virt_to_phys(trampoline_base
);
122 * We are called very early to get the low memory for the
123 * SMP bootup trampoline page.
125 void __init
smp_alloc_memory(void)
127 trampoline_base
= (void *) alloc_bootmem_low_pages(PAGE_SIZE
);
129 * Has to be in very low memory so we can execute
132 if (__pa(trampoline_base
) >= 0x9F000)
137 * The bootstrap kernel entry code has set these up. Save them for
141 void __init
smp_store_cpu_info(int id
)
143 struct cpuinfo_x86
*c
= cpu_data
+ id
;
149 c
->pgtable_cache_sz
= 0;
152 * Mask B, Pentium, but not Pentium MMX
154 if (c
->x86_vendor
== X86_VENDOR_INTEL
&&
156 c
->x86_mask
>= 1 && c
->x86_mask
<= 4 &&
159 * Remember we have B step Pentia with bugs
165 * Architecture specific routine called by the kernel just before init is
166 * fired off. This allows the BP to have everything in order [we hope].
167 * At the end of this all the APs will hit the system scheduling and off
168 * we go. Each AP will load the system gdt's and jump through the kernel
169 * init into idle(). At this point the scheduler will one day take over
170 * and give them jobs to do. smp_callin is a standard routine
171 * we use to track CPUs as they power up.
174 static atomic_t smp_commenced
= ATOMIC_INIT(0);
176 void __init
smp_commence(void)
179 * Lets the callins below out of their loop.
181 Dprintk("Setting commenced=1, go go go\n");
184 atomic_set(&smp_commenced
,1);
188 * TSC synchronization.
190 * We first check wether all CPUs have their TSC's synchronized,
191 * then we print a warning if not, and always resync.
194 static atomic_t tsc_start_flag
= ATOMIC_INIT(0);
195 static atomic_t tsc_count_start
= ATOMIC_INIT(0);
196 static atomic_t tsc_count_stop
= ATOMIC_INIT(0);
197 static unsigned long long tsc_values
[NR_CPUS
];
201 extern unsigned long fast_gettimeoffset_quotient
;
204 * accurate 64-bit/32-bit division, expanded to 32-bit divisions and 64-bit
205 * multiplication. Not terribly optimized but we need it at boot time only
209 * == (a1 + a2*(2^32)) / b
210 * == a1/b + a2*(2^32/b)
211 * == a1/b + a2*((2^32-1)/b) + a2/b + (a2*((2^32-1) % b))/b
212 * ^---- (this multiplication can overflow)
215 static unsigned long long div64 (unsigned long long a
, unsigned long b0
)
218 unsigned long long res
;
220 a1
= ((unsigned int*)&a
)[0];
221 a2
= ((unsigned int*)&a
)[1];
224 (unsigned long long)a2
* (unsigned long long)(0xffffffff/b0
) +
226 (a2
* (0xffffffff % b0
)) / b0
;
231 static void __init
synchronize_tsc_bp (void)
234 unsigned long long t0
;
235 unsigned long long sum
, avg
;
237 unsigned long one_usec
;
240 printk("checking TSC synchronization across CPUs: ");
242 one_usec
= ((1<<30)/fast_gettimeoffset_quotient
)*(1<<2);
244 atomic_set(&tsc_start_flag
, 1);
248 * We loop a few times to get a primed instruction cache,
249 * then the last pass is more or less synchronized and
250 * the BP and APs set their cycle counters to zero all at
251 * once. This reduces the chance of having random offsets
252 * between the processors, and guarantees that the maximum
253 * delay between the cycle counters is never bigger than
254 * the latency of information-passing (cachelines) between
257 for (i
= 0; i
< NR_LOOPS
; i
++) {
259 * all APs synchronize but they loop on '== num_cpus'
261 while (atomic_read(&tsc_count_start
) != smp_num_cpus
-1) mb();
262 atomic_set(&tsc_count_stop
, 0);
265 * this lets the APs save their current TSC:
267 atomic_inc(&tsc_count_start
);
269 rdtscll(tsc_values
[smp_processor_id()]);
271 * We clear the TSC in the last loop:
277 * Wait for all APs to leave the synchronization point:
279 while (atomic_read(&tsc_count_stop
) != smp_num_cpus
-1) mb();
280 atomic_set(&tsc_count_start
, 0);
282 atomic_inc(&tsc_count_stop
);
286 for (i
= 0; i
< smp_num_cpus
; i
++) {
290 avg
= div64(sum
, smp_num_cpus
);
293 for (i
= 0; i
< smp_num_cpus
; i
++) {
294 delta
= tsc_values
[i
] - avg
;
298 * We report bigger than 2 microseconds clock differences.
300 if (delta
> 2*one_usec
) {
306 realdelta
= div64(delta
, one_usec
);
307 if (tsc_values
[i
] < avg
)
308 realdelta
= -realdelta
;
310 printk("BIOS BUG: CPU#%d improperly initialized, has %ld usecs TSC skew! FIXED.\n",
320 static void __init
synchronize_tsc_ap (void)
325 * smp_num_cpus is not necessarily known at the time
326 * this gets called, so we first wait for the BP to
327 * finish SMP initialization:
329 while (!atomic_read(&tsc_start_flag
)) mb();
331 for (i
= 0; i
< NR_LOOPS
; i
++) {
332 atomic_inc(&tsc_count_start
);
333 while (atomic_read(&tsc_count_start
) != smp_num_cpus
) mb();
335 rdtscll(tsc_values
[smp_processor_id()]);
339 atomic_inc(&tsc_count_stop
);
340 while (atomic_read(&tsc_count_stop
) != smp_num_cpus
) mb();
345 extern void calibrate_delay(void);
347 static atomic_t init_deasserted
;
349 void __init
smp_callin(void)
352 unsigned long timeout
;
355 * If waken up by an INIT in an 82489DX configuration
356 * we may get here before an INIT-deassert IPI reaches
357 * our local APIC. We have to wait for the IPI or we'll
358 * lock up on an APIC access.
360 while (!atomic_read(&init_deasserted
));
363 * (This works even if the APIC is not enabled.)
365 phys_id
= GET_APIC_ID(apic_read(APIC_ID
));
366 cpuid
= current
->processor
;
367 if (test_and_set_bit(cpuid
, &cpu_online_map
)) {
368 printk("huh, phys CPU#%d, CPU#%d already present??\n",
372 Dprintk("CPU#%d (phys ID: %d) waiting for CALLOUT\n", cpuid
, phys_id
);
375 * STARTUP IPIs are fragile beasts as they might sometimes
376 * trigger some glue motherboard logic. Complete APIC bus
377 * silence for 1 second, this overestimates the time the
378 * boot CPU is spending to send the up to 2 STARTUP IPIs
379 * by a factor of two. This should be enough.
383 * Waiting 2s total for startup (udelay is not yet working)
385 timeout
= jiffies
+ 2*HZ
;
386 while (time_before(jiffies
, timeout
)) {
388 * Has the boot CPU finished it's STARTUP sequence?
390 if (test_bit(cpuid
, &cpu_callout_map
))
394 if (!time_before(jiffies
, timeout
)) {
395 printk("BUG: CPU%d started up but did not get a callout!\n",
401 * the boot CPU has finished the init stage and is spinning
402 * on callin_map until we finish. We are free to set up this
403 * CPU, first the APIC. (this is probably redundant on most
407 Dprintk("CALLIN, before setup_local_APIC().\n");
414 * Must be done before calibration delay is computed
416 mtrr_init_secondary_cpu ();
422 Dprintk("Stack at about %p\n",&cpuid
);
425 * Save our processor parameters
427 smp_store_cpu_info(cpuid
);
430 * Allow the master to continue.
432 set_bit(cpuid
, &cpu_callin_map
);
435 * Synchronize the TSC with the BP
438 synchronize_tsc_ap();
443 extern int cpu_idle(void);
446 * Activate a secondary processor.
448 int __init
start_secondary(void *unused
)
451 * Dont put anything before smp_callin(), SMP
452 * booting is too fragile that we want to limit the
453 * things done here to the most necessary things.
457 while (!atomic_read(&smp_commenced
))
460 * low-memory mappings have been cleared, flush them from
461 * the local TLBs too.
469 * Everything has been set up for the secondary
470 * CPUs - they just need to reload everything
471 * from the task structure
472 * This function must not return.
474 void __init
initialize_secondary(void)
477 * We don't actually need to load the full TSS,
478 * basically just the stack pointer and the eip.
485 :"r" (current
->thread
.esp
),"r" (current
->thread
.eip
));
493 static int __init
fork_by_hand(void)
497 * don't care about the eip and regs settings since
498 * we'll never reschedule the forked task.
500 return do_fork(CLONE_VM
|CLONE_PID
, 0, ®s
, 0);
504 static inline void inquire_remote_apic(int apicid
)
506 int i
, regs
[] = { APIC_ID
>> 4, APIC_LVR
>> 4, APIC_SPIV
>> 4 };
507 char *names
[] = { "ID", "VERSION", "SPIV" };
510 printk("Inquiring remote APIC #%d...\n", apicid
);
512 for (i
= 0; i
< sizeof(regs
) / sizeof(*regs
); i
++) {
513 printk("... APIC #%d %s: ", apicid
, names
[i
]);
518 apic_wait_icr_idle();
520 apic_write_around(APIC_ICR2
, SET_APIC_DEST_FIELD(apicid
));
521 apic_write_around(APIC_ICR
, APIC_DM_REMRD
| regs
[i
]);
526 status
= apic_read(APIC_ICR
) & APIC_ICR_RR_MASK
;
527 } while (status
== APIC_ICR_RR_INPROG
&& timeout
++ < 1000);
530 case APIC_ICR_RR_VALID
:
531 status
= apic_read(APIC_RRR
);
532 printk("%08x\n", status
);
541 static void __init
do_boot_cpu (int apicid
)
543 struct task_struct
*idle
;
544 unsigned long send_status
, accept_status
, boot_status
, maxlvt
;
545 int timeout
, num_starts
, j
, cpu
;
546 unsigned long start_eip
;
550 * We can't use kernel_thread since we must avoid to
551 * reschedule the child.
553 if (fork_by_hand() < 0)
554 panic("failed fork for CPU %d", cpu
);
557 * We remove it from the pidhash and the runqueue
558 * once we got the process:
560 idle
= init_task
.prev_task
;
562 panic("No idle process for CPU %d", cpu
);
564 idle
->processor
= cpu
;
565 x86_cpu_to_apicid
[cpu
] = apicid
;
566 x86_apicid_to_cpu
[apicid
] = cpu
;
567 idle
->has_cpu
= 1; /* we schedule the first task manually */
568 idle
->thread
.eip
= (unsigned long) start_secondary
;
570 del_from_runqueue(idle
);
571 unhash_process(idle
);
572 init_tasks
[cpu
] = idle
;
574 /* start_eip had better be page-aligned! */
575 start_eip
= setup_trampoline();
577 /* So we see what's up */
578 printk("Booting processor %d/%d eip %lx\n", cpu
, apicid
, start_eip
);
579 stack_start
.esp
= (void *) (1024 + PAGE_SIZE
+ (char *)idle
);
582 * This grunge runs the startup process for
583 * the targeted processor.
586 atomic_set(&init_deasserted
, 0);
588 Dprintk("Setting warm reset code and vector.\n");
590 CMOS_WRITE(0xa, 0xf);
593 *((volatile unsigned short *) phys_to_virt(0x469)) = start_eip
>> 4;
595 *((volatile unsigned short *) phys_to_virt(0x467)) = start_eip
& 0xf;
599 * Be paranoid about clearing APIC errors.
601 if (APIC_INTEGRATED(apic_version
[apicid
])) {
602 apic_read_around(APIC_SPIV
);
603 apic_write(APIC_ESR
, 0);
608 * Status is now clean
615 * Starting actual IPI sequence...
618 Dprintk("Asserting INIT.\n");
621 * Turn INIT on target chip
623 apic_write_around(APIC_ICR2
, SET_APIC_DEST_FIELD(apicid
));
628 apic_write_around(APIC_ICR
, APIC_INT_LEVELTRIG
| APIC_INT_ASSERT
631 Dprintk("Waiting for send to finish...\n");
636 send_status
= apic_read(APIC_ICR
) & APIC_ICR_BUSY
;
637 } while (send_status
&& (timeout
++ < 1000));
641 Dprintk("Deasserting INIT.\n");
644 apic_write_around(APIC_ICR2
, SET_APIC_DEST_FIELD(apicid
));
647 apic_write_around(APIC_ICR
, APIC_INT_LEVELTRIG
| APIC_DM_INIT
);
649 Dprintk("Waiting for send to finish...\n");
654 send_status
= apic_read(APIC_ICR
) & APIC_ICR_BUSY
;
655 } while (send_status
&& (timeout
++ < 1000));
657 atomic_set(&init_deasserted
, 1);
660 * Should we send STARTUP IPIs ?
662 * Determine this based on the APIC version.
663 * If we don't have an integrated APIC, don't
664 * send the STARTUP IPIs.
666 if (APIC_INTEGRATED(apic_version
[apicid
]))
672 * Run STARTUP IPI loop.
674 Dprintk("#startup loops: %d.\n", num_starts
);
676 maxlvt
= get_maxlvt();
678 for (j
= 1; j
<= num_starts
; j
++) {
679 Dprintk("Sending STARTUP #%d.\n",j
);
680 apic_read_around(APIC_SPIV
);
681 apic_write(APIC_ESR
, 0);
683 Dprintk("After apic_write.\n");
690 apic_write_around(APIC_ICR2
, SET_APIC_DEST_FIELD(apicid
));
692 /* Boot on the stack */
693 /* Kick the second */
694 apic_write_around(APIC_ICR
, APIC_DM_STARTUP
695 | (start_eip
>> 12));
698 * Give the other CPU some time to accept the IPI.
702 Dprintk("Startup point 1.\n");
704 Dprintk("Waiting for send to finish...\n");
709 send_status
= apic_read(APIC_ICR
) & APIC_ICR_BUSY
;
710 } while (send_status
&& (timeout
++ < 1000));
713 * Give the other CPU some time to accept the IPI.
717 * Due to the Pentium erratum 3AP.
720 apic_read_around(APIC_SPIV
);
721 apic_write(APIC_ESR
, 0);
723 accept_status
= (apic_read(APIC_ESR
) & 0xEF);
724 if (send_status
|| accept_status
)
727 Dprintk("After Startup.\n");
730 printk("APIC never delivered???\n");
732 printk("APIC delivery error (%lx).\n", accept_status
);
734 if (!send_status
&& !accept_status
) {
736 * allow APs to start initializing.
738 Dprintk("Before Callout %d.\n", cpu
);
739 set_bit(cpu
, &cpu_callout_map
);
740 Dprintk("After Callout %d.\n", cpu
);
743 * Wait 5s total for a response
745 for (timeout
= 0; timeout
< 50000; timeout
++) {
746 if (test_bit(cpu
, &cpu_callin_map
))
747 break; /* It has booted */
751 if (test_bit(cpu
, &cpu_callin_map
)) {
752 /* number CPUs logically, starting from 1 (BSP is 0) */
754 printk("CPU%d: ", cpu
);
755 print_cpu_info(&cpu_data
[cpu
]);
756 Dprintk("CPU has booted.\n");
759 if (*((volatile unsigned char *)phys_to_virt(8192))
761 /* trampoline started but...? */
762 printk("Stuck ??\n");
764 /* trampoline code not run */
765 printk("Not responding.\n");
767 inquire_remote_apic(apicid
);
771 if (send_status
|| accept_status
|| boot_status
) {
772 x86_cpu_to_apicid
[cpu
] = -1;
773 x86_apicid_to_cpu
[apicid
] = -1;
777 /* mark "stuck" area as not stuck */
778 *((volatile unsigned long *)phys_to_virt(8192)) = 0;
781 cycles_t cacheflush_time
;
782 extern unsigned long cpu_khz
;
784 static void smp_tune_scheduling (void)
786 unsigned long cachesize
; /* kB */
787 unsigned long bandwidth
= 350; /* MB/s */
789 * Rough estimation for SMP scheduling, this is the number of
790 * cycles it takes for a fully memory-limited process to flush
791 * the SMP-local cache.
793 * (For a P5 this pretty much means we will choose another idle
794 * CPU almost always at wakeup time (this is due to the small
795 * L1 cache), on PIIs it's around 50-100 usecs, depending on
801 * this basically disables processor-affinity
802 * scheduling on SMP without a TSC.
807 cachesize
= boot_cpu_data
.x86_cache_size
;
808 if (cachesize
== -1) {
809 cachesize
= 16; /* Pentiums, 2x8kB cache */
813 cacheflush_time
= (cpu_khz
>>10) * (cachesize
<<10) / bandwidth
;
816 printk("per-CPU timeslice cutoff: %ld.%02ld usecs.\n",
817 (long)cacheflush_time
/(cpu_khz
/1000),
818 ((long)cacheflush_time
*100/(cpu_khz
/1000)) % 100);
822 * Cycle through the processors sending APIC IPIs to boot each.
825 extern int prof_multiplier
[NR_CPUS
];
826 extern int prof_old_multiplier
[NR_CPUS
];
827 extern int prof_counter
[NR_CPUS
];
829 void __init
smp_boot_cpus(void)
834 /* Must be done before other processors booted */
835 mtrr_init_boot_cpu ();
838 * Initialize the logical to physical CPU number mapping
839 * and the per-CPU profiling counter/multiplier
842 for (apicid
= 0; apicid
< NR_CPUS
; apicid
++) {
843 x86_apicid_to_cpu
[apicid
] = -1;
844 prof_counter
[apicid
] = 1;
845 prof_old_multiplier
[apicid
] = 1;
846 prof_multiplier
[apicid
] = 1;
850 * Setup boot CPU information
852 smp_store_cpu_info(0); /* Final full version of the data */
853 printk("CPU%d: ", 0);
854 print_cpu_info(&cpu_data
[0]);
857 * We have the boot CPU online for sure.
859 set_bit(0, &cpu_online_map
);
860 x86_apicid_to_cpu
[boot_cpu_id
] = 0;
861 x86_cpu_to_apicid
[0] = boot_cpu_id
;
862 global_irq_holder
= 0;
863 current
->processor
= 0;
865 smp_tune_scheduling();
868 * If we couldnt find an SMP configuration at boot time,
869 * get out of here now!
871 if (!smp_found_config
) {
872 printk(KERN_NOTICE
"SMP motherboard not detected. Using dummy APIC emulation.\n");
876 cpu_online_map
= phys_cpu_present_map
= 1;
882 * Should not be necessary because the MP table should list the boot
883 * CPU too, but we do it for the sake of robustness anyway.
885 if (!test_bit(boot_cpu_id
, &phys_cpu_present_map
)) {
886 printk("weird, boot CPU (#%d) not listed by the BIOS.\n",
888 phys_cpu_present_map
|= (1 << hard_smp_processor_id());
892 * If we couldn't find a local APIC, then get out of here now!
894 if (APIC_INTEGRATED(apic_version
[boot_cpu_id
]) &&
895 !test_bit(X86_FEATURE_APIC
, boot_cpu_data
.x86_capability
)) {
896 printk(KERN_ERR
"BIOS bug, local APIC #%d not detected!...\n",
898 printk(KERN_ERR
"... forcing use of dummy APIC emulation. (tell your hw vendor)\n");
902 cpu_online_map
= phys_cpu_present_map
= 1;
910 * If SMP should be disabled, then really disable it!
913 smp_found_config
= 0;
914 printk(KERN_INFO
"SMP mode deactivated, forcing use of dummy APIC emulation.\n");
918 cpu_online_map
= phys_cpu_present_map
= 1;
926 if (GET_APIC_ID(apic_read(APIC_ID
)) != boot_cpu_id
)
930 * Now scan the CPU present map and fire up the other CPUs.
932 Dprintk("CPU present map: %lx\n", phys_cpu_present_map
);
934 for (apicid
= 0; apicid
< NR_CPUS
; apicid
++) {
936 * Don't even attempt to start the boot CPU!
938 if (apicid
== boot_cpu_id
)
941 if (!(phys_cpu_present_map
& (1 << apicid
)))
943 if ((max_cpus
>= 0) && (max_cpus
<= cpucount
+1))
949 * Make sure we unmap all failed CPUs
951 if ((x86_apicid_to_cpu
[apicid
] == -1) &&
952 (phys_cpu_present_map
& (1 << apicid
)))
953 printk("phys CPU #%d not responding - cannot use it.\n",apicid
);
957 * Cleanup possible dangling ends...
962 * Install writable page 0 entry to set BIOS data area.
967 * Paranoid: Set warm reset code and vector here back
972 *((volatile long *) phys_to_virt(0x467)) = 0;
977 * Allow the user to impress friends.
980 Dprintk("Before bogomips.\n");
982 printk(KERN_ERR
"Error: only one processor found.\n");
984 unsigned long bogosum
= 0;
985 for (cpu
= 0; cpu
< NR_CPUS
; cpu
++)
986 if (cpu_online_map
& (1<<cpu
))
987 bogosum
+= cpu_data
[cpu
].loops_per_jiffy
;
988 printk(KERN_INFO
"Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
991 (bogosum
/(5000/HZ
))%100);
992 Dprintk("Before bogocount - setting activated=1.\n");
994 smp_num_cpus
= cpucount
+ 1;
997 printk(KERN_WARNING
"WARNING: SMP operation may be unreliable with B stepping processors.\n");
998 Dprintk("Boot done.\n");
1000 #ifndef CONFIG_VISWS
1002 * Here we can be sure that there is an IO-APIC in the system. Let's
1005 if (!skip_ioapic_setup
)
1010 * Set up all local APIC timers in the system:
1012 setup_APIC_clocks();
1015 * Synchronize the TSC with the AP
1017 if (cpu_has_tsc
&& cpucount
)
1018 synchronize_tsc_bp();