[S390] Limit cpu detection to 256 physical cpus.
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Fri, 11 Sep 2009 08:29:03 +0000 (10:29 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 11 Sep 2009 08:29:55 +0000 (10:29 +0200)
Saves us more than 65k pointless IPIs.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/cpu.h [new file with mode: 0644]
arch/s390/kernel/head.S
arch/s390/kernel/head64.S
arch/s390/kernel/smp.c

diff --git a/arch/s390/include/asm/cpu.h b/arch/s390/include/asm/cpu.h
new file mode 100644 (file)
index 0000000..702ad46
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ASM_S390_CPU_H
+#define _ASM_S390_CPU_H
+
+#define MAX_CPU_ADDRESS 255
+
+#endif /* _ASM_S390_CPU_H */
index ec6882348520540ea87d84e58ac921c11a466a0d..c52b4f7742fa64cb4a82da9d5a68b8cf0ee051e2 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 #include <asm/page.h>
+#include <asm/cpu.h>
 
 #ifdef CONFIG_64BIT
 #define ARCH_OFFSET    4
index bdcb3f05bcd1949fd2f592b1c93c53eb18e10b08..6a250808092b719eb231d9023a84436eea6affa1 100644 (file)
@@ -62,9 +62,9 @@ startup_continue:
        clr     %r11,%r12
        je      5f                      # no more space in prefix array
 4:
-       ahi     %r8,1                           # next cpu (r8 += 1)
-       cl      %r8,.Llast_cpu-.LPG1(%r13)      # is last possible cpu ?
-       jl      1b                              # jump if not last cpu
+       ahi     %r8,1                   # next cpu (r8 += 1)
+       chi     %r8,MAX_CPU_ADDRESS     # is last possible cpu ?
+       jle     1b                      # jump if not last cpu
 5:
        lhi     %r1,2                   # mode 2 = esame (dump)
        j       6f
@@ -130,8 +130,6 @@ startup_continue:
 #ifdef CONFIG_ZFCPDUMP
 .Lcurrent_cpu:
        .long 0x0
-.Llast_cpu:
-       .long 0x0000ffff
 .Lpref_arr_ptr:
        .long zfcpdump_prefix_array
 #endif /* CONFIG_ZFCPDUMP */
index be2cae083406206c949330ee1a267fb7136a969e..9261495ca2c35dd40a9cc087a0811a1715421c3d 100644 (file)
@@ -49,6 +49,7 @@
 #include <asm/sclp.h>
 #include <asm/cputime.h>
 #include <asm/vdso.h>
+#include <asm/cpu.h>
 #include "entry.h"
 
 static struct task_struct *current_set[NR_CPUS];
@@ -300,7 +301,7 @@ static int smp_rescan_cpus_sigp(cpumask_t avail)
        logical_cpu = cpumask_first(&avail);
        if (logical_cpu >= nr_cpu_ids)
                return 0;
-       for (cpu_id = 0; cpu_id <= 65535; cpu_id++) {
+       for (cpu_id = 0; cpu_id <= MAX_CPU_ADDRESS; cpu_id++) {
                if (cpu_known(cpu_id))
                        continue;
                __cpu_logical_map[logical_cpu] = cpu_id;
@@ -379,7 +380,7 @@ static void __init smp_detect_cpus(void)
        /* Use sigp detection algorithm if sclp doesn't work. */
        if (sclp_get_cpu_info(info)) {
                smp_use_sigp_detection = 1;
-               for (cpu = 0; cpu <= 65535; cpu++) {
+               for (cpu = 0; cpu <= MAX_CPU_ADDRESS; cpu++) {
                        if (cpu == boot_cpu_addr)
                                continue;
                        __cpu_logical_map[CPU_INIT_NO] = cpu;