diff options
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/Kconfig | 4 | ||||
-rw-r--r-- | arch/s390/kernel/compat_linux.c | 4 | ||||
-rw-r--r-- | arch/s390/kernel/compat_wrapper.S | 6 | ||||
-rw-r--r-- | arch/s390/kernel/process.c | 4 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 2 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 69 | ||||
-rw-r--r-- | arch/s390/kernel/syscalls.S | 2 | ||||
-rw-r--r-- | arch/s390/lib/delay.c | 2 |
8 files changed, 68 insertions, 25 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index b66602ad7b33..b7ca5bf9acfc 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -80,6 +80,10 @@ config HOTPLUG_CPU | |||
80 | can be controlled through /sys/devices/system/cpu/cpu#. | 80 | can be controlled through /sys/devices/system/cpu/cpu#. |
81 | Say N if you want to disable CPU hotplug. | 81 | Say N if you want to disable CPU hotplug. |
82 | 82 | ||
83 | config DEFAULT_MIGRATION_COST | ||
84 | int | ||
85 | default "1000000" | ||
86 | |||
83 | config MATHEMU | 87 | config MATHEMU |
84 | bool "IEEE FPU emulation" | 88 | bool "IEEE FPU emulation" |
85 | depends on MARCH_G5 | 89 | depends on MARCH_G5 |
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 2d021626c1a6..cc058dc3bc8b 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
@@ -905,8 +905,8 @@ asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * sta | |||
905 | return ret; | 905 | return ret; |
906 | } | 906 | } |
907 | 907 | ||
908 | asmlinkage long sys32_fstatat(unsigned int dfd, char __user *filename, | 908 | asmlinkage long sys32_fstatat64(unsigned int dfd, char __user *filename, |
909 | struct stat64_emu31 __user* statbuf, int flag) | 909 | struct stat64_emu31 __user* statbuf, int flag) |
910 | { | 910 | { |
911 | struct kstat stat; | 911 | struct kstat stat; |
912 | int error = -EINVAL; | 912 | int error = -EINVAL; |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index dd2d6c3e8df8..615964cca15f 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -1523,13 +1523,13 @@ compat_sys_futimesat_wrapper: | |||
1523 | llgtr %r4,%r4 # struct timeval * | 1523 | llgtr %r4,%r4 # struct timeval * |
1524 | jg compat_sys_futimesat | 1524 | jg compat_sys_futimesat |
1525 | 1525 | ||
1526 | .globl sys32_fstatat_wrapper | 1526 | .globl sys32_fstatat64_wrapper |
1527 | sys32_fstatat_wrapper: | 1527 | sys32_fstatat64_wrapper: |
1528 | llgfr %r2,%r2 # unsigned int | 1528 | llgfr %r2,%r2 # unsigned int |
1529 | llgtr %r3,%r3 # char * | 1529 | llgtr %r3,%r3 # char * |
1530 | llgtr %r4,%r4 # struct stat64 * | 1530 | llgtr %r4,%r4 # struct stat64 * |
1531 | lgfr %r5,%r5 # int | 1531 | lgfr %r5,%r5 # int |
1532 | jg sys32_fstatat | 1532 | jg sys32_fstatat64 |
1533 | 1533 | ||
1534 | .globl sys_unlinkat_wrapper | 1534 | .globl sys_unlinkat_wrapper |
1535 | sys_unlinkat_wrapper: | 1535 | sys_unlinkat_wrapper: |
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 008c74526fd3..da6fbae8df91 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -128,8 +128,10 @@ void default_idle(void) | |||
128 | __ctl_set_bit(8, 15); | 128 | __ctl_set_bit(8, 15); |
129 | 129 | ||
130 | #ifdef CONFIG_HOTPLUG_CPU | 130 | #ifdef CONFIG_HOTPLUG_CPU |
131 | if (cpu_is_offline(cpu)) | 131 | if (cpu_is_offline(cpu)) { |
132 | preempt_enable_no_resched(); | ||
132 | cpu_die(); | 133 | cpu_die(); |
134 | } | ||
133 | #endif | 135 | #endif |
134 | 136 | ||
135 | local_mcck_disable(); | 137 | local_mcck_disable(); |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index de8784267473..24f62f16c0e5 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -600,6 +600,7 @@ setup_arch(char **cmdline_p) | |||
600 | init_mm.brk = (unsigned long) &_end; | 600 | init_mm.brk = (unsigned long) &_end; |
601 | 601 | ||
602 | parse_cmdline_early(cmdline_p); | 602 | parse_cmdline_early(cmdline_p); |
603 | parse_early_param(); | ||
603 | 604 | ||
604 | setup_memory(); | 605 | setup_memory(); |
605 | setup_resources(); | 606 | setup_resources(); |
@@ -607,6 +608,7 @@ setup_arch(char **cmdline_p) | |||
607 | 608 | ||
608 | cpu_init(); | 609 | cpu_init(); |
609 | __cpu_logical_map[0] = S390_lowcore.cpu_data.cpu_addr; | 610 | __cpu_logical_map[0] = S390_lowcore.cpu_data.cpu_addr; |
611 | smp_setup_cpu_possible_map(); | ||
610 | 612 | ||
611 | /* | 613 | /* |
612 | * Create kernel page tables and switch to virtual addressing. | 614 | * Create kernel page tables and switch to virtual addressing. |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 0d1ad5dbe2b1..7dbe00c76c6b 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -1,8 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * arch/s390/kernel/smp.c | 2 | * arch/s390/kernel/smp.c |
3 | * | 3 | * |
4 | * S390 version | 4 | * Copyright (C) IBM Corp. 1999,2006 |
5 | * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation | ||
6 | * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com), | 5 | * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com), |
7 | * Martin Schwidefsky (schwidefsky@de.ibm.com) | 6 | * Martin Schwidefsky (schwidefsky@de.ibm.com) |
8 | * Heiko Carstens (heiko.carstens@de.ibm.com) | 7 | * Heiko Carstens (heiko.carstens@de.ibm.com) |
@@ -41,8 +40,6 @@ | |||
41 | #include <asm/cpcmd.h> | 40 | #include <asm/cpcmd.h> |
42 | #include <asm/tlbflush.h> | 41 | #include <asm/tlbflush.h> |
43 | 42 | ||
44 | /* prototypes */ | ||
45 | |||
46 | extern volatile int __cpu_logical_map[]; | 43 | extern volatile int __cpu_logical_map[]; |
47 | 44 | ||
48 | /* | 45 | /* |
@@ -51,13 +48,11 @@ extern volatile int __cpu_logical_map[]; | |||
51 | 48 | ||
52 | struct _lowcore *lowcore_ptr[NR_CPUS]; | 49 | struct _lowcore *lowcore_ptr[NR_CPUS]; |
53 | 50 | ||
54 | cpumask_t cpu_online_map; | 51 | cpumask_t cpu_online_map = CPU_MASK_NONE; |
55 | cpumask_t cpu_possible_map = CPU_MASK_ALL; | 52 | cpumask_t cpu_possible_map = CPU_MASK_NONE; |
56 | 53 | ||
57 | static struct task_struct *current_set[NR_CPUS]; | 54 | static struct task_struct *current_set[NR_CPUS]; |
58 | 55 | ||
59 | EXPORT_SYMBOL(cpu_online_map); | ||
60 | |||
61 | /* | 56 | /* |
62 | * Reboot, halt and power_off routines for SMP. | 57 | * Reboot, halt and power_off routines for SMP. |
63 | */ | 58 | */ |
@@ -490,10 +485,10 @@ void smp_ctl_clear_bit(int cr, int bit) { | |||
490 | * Lets check how many CPUs we have. | 485 | * Lets check how many CPUs we have. |
491 | */ | 486 | */ |
492 | 487 | ||
493 | void | 488 | static unsigned int |
494 | __init smp_check_cpus(unsigned int max_cpus) | 489 | __init smp_count_cpus(void) |
495 | { | 490 | { |
496 | int cpu, num_cpus; | 491 | unsigned int cpu, num_cpus; |
497 | __u16 boot_cpu_addr; | 492 | __u16 boot_cpu_addr; |
498 | 493 | ||
499 | /* | 494 | /* |
@@ -503,19 +498,20 @@ __init smp_check_cpus(unsigned int max_cpus) | |||
503 | boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr; | 498 | boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr; |
504 | current_thread_info()->cpu = 0; | 499 | current_thread_info()->cpu = 0; |
505 | num_cpus = 1; | 500 | num_cpus = 1; |
506 | for (cpu = 0; cpu <= 65535 && num_cpus < max_cpus; cpu++) { | 501 | for (cpu = 0; cpu <= 65535; cpu++) { |
507 | if ((__u16) cpu == boot_cpu_addr) | 502 | if ((__u16) cpu == boot_cpu_addr) |
508 | continue; | 503 | continue; |
509 | __cpu_logical_map[num_cpus] = (__u16) cpu; | 504 | __cpu_logical_map[1] = (__u16) cpu; |
510 | if (signal_processor(num_cpus, sigp_sense) == | 505 | if (signal_processor(1, sigp_sense) == |
511 | sigp_not_operational) | 506 | sigp_not_operational) |
512 | continue; | 507 | continue; |
513 | cpu_set(num_cpus, cpu_present_map); | ||
514 | num_cpus++; | 508 | num_cpus++; |
515 | } | 509 | } |
516 | 510 | ||
517 | printk("Detected %d CPU's\n",(int) num_cpus); | 511 | printk("Detected %d CPU's\n",(int) num_cpus); |
518 | printk("Boot cpu address %2X\n", boot_cpu_addr); | 512 | printk("Boot cpu address %2X\n", boot_cpu_addr); |
513 | |||
514 | return num_cpus; | ||
519 | } | 515 | } |
520 | 516 | ||
521 | /* | 517 | /* |
@@ -676,6 +672,44 @@ __cpu_up(unsigned int cpu) | |||
676 | return 0; | 672 | return 0; |
677 | } | 673 | } |
678 | 674 | ||
675 | static unsigned int __initdata additional_cpus; | ||
676 | static unsigned int __initdata possible_cpus; | ||
677 | |||
678 | void __init smp_setup_cpu_possible_map(void) | ||
679 | { | ||
680 | unsigned int phy_cpus, pos_cpus, cpu; | ||
681 | |||
682 | phy_cpus = smp_count_cpus(); | ||
683 | pos_cpus = min(phy_cpus + additional_cpus, (unsigned int) NR_CPUS); | ||
684 | |||
685 | if (possible_cpus) | ||
686 | pos_cpus = min(possible_cpus, (unsigned int) NR_CPUS); | ||
687 | |||
688 | for (cpu = 0; cpu < pos_cpus; cpu++) | ||
689 | cpu_set(cpu, cpu_possible_map); | ||
690 | |||
691 | phy_cpus = min(phy_cpus, pos_cpus); | ||
692 | |||
693 | for (cpu = 0; cpu < phy_cpus; cpu++) | ||
694 | cpu_set(cpu, cpu_present_map); | ||
695 | } | ||
696 | |||
697 | #ifdef CONFIG_HOTPLUG_CPU | ||
698 | |||
699 | static int __init setup_additional_cpus(char *s) | ||
700 | { | ||
701 | additional_cpus = simple_strtoul(s, NULL, 0); | ||
702 | return 0; | ||
703 | } | ||
704 | early_param("additional_cpus", setup_additional_cpus); | ||
705 | |||
706 | static int __init setup_possible_cpus(char *s) | ||
707 | { | ||
708 | possible_cpus = simple_strtoul(s, NULL, 0); | ||
709 | return 0; | ||
710 | } | ||
711 | early_param("possible_cpus", setup_possible_cpus); | ||
712 | |||
679 | int | 713 | int |
680 | __cpu_disable(void) | 714 | __cpu_disable(void) |
681 | { | 715 | { |
@@ -744,6 +778,8 @@ cpu_die(void) | |||
744 | for(;;); | 778 | for(;;); |
745 | } | 779 | } |
746 | 780 | ||
781 | #endif /* CONFIG_HOTPLUG_CPU */ | ||
782 | |||
747 | /* | 783 | /* |
748 | * Cycle through the processors and setup structures. | 784 | * Cycle through the processors and setup structures. |
749 | */ | 785 | */ |
@@ -757,7 +793,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
757 | /* request the 0x1201 emergency signal external interrupt */ | 793 | /* request the 0x1201 emergency signal external interrupt */ |
758 | if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0) | 794 | if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0) |
759 | panic("Couldn't request external interrupt 0x1201"); | 795 | panic("Couldn't request external interrupt 0x1201"); |
760 | smp_check_cpus(max_cpus); | ||
761 | memset(lowcore_ptr,0,sizeof(lowcore_ptr)); | 796 | memset(lowcore_ptr,0,sizeof(lowcore_ptr)); |
762 | /* | 797 | /* |
763 | * Initialize prefix pages and stacks for all possible cpus | 798 | * Initialize prefix pages and stacks for all possible cpus |
@@ -806,7 +841,6 @@ void __devinit smp_prepare_boot_cpu(void) | |||
806 | BUG_ON(smp_processor_id() != 0); | 841 | BUG_ON(smp_processor_id() != 0); |
807 | 842 | ||
808 | cpu_set(0, cpu_online_map); | 843 | cpu_set(0, cpu_online_map); |
809 | cpu_set(0, cpu_present_map); | ||
810 | S390_lowcore.percpu_offset = __per_cpu_offset[0]; | 844 | S390_lowcore.percpu_offset = __per_cpu_offset[0]; |
811 | current_set[0] = current; | 845 | current_set[0] = current; |
812 | } | 846 | } |
@@ -845,6 +879,7 @@ static int __init topology_init(void) | |||
845 | 879 | ||
846 | subsys_initcall(topology_init); | 880 | subsys_initcall(topology_init); |
847 | 881 | ||
882 | EXPORT_SYMBOL(cpu_online_map); | ||
848 | EXPORT_SYMBOL(cpu_possible_map); | 883 | EXPORT_SYMBOL(cpu_possible_map); |
849 | EXPORT_SYMBOL(lowcore_ptr); | 884 | EXPORT_SYMBOL(lowcore_ptr); |
850 | EXPORT_SYMBOL(smp_ctl_set_bit); | 885 | EXPORT_SYMBOL(smp_ctl_set_bit); |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 84921fe8d266..7c88d85c3597 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -301,7 +301,7 @@ SYSCALL(sys_mkdirat,sys_mkdirat,sys_mkdirat_wrapper) | |||
301 | SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper) /* 290 */ | 301 | SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper) /* 290 */ |
302 | SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper) | 302 | SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper) |
303 | SYSCALL(sys_futimesat,sys_futimesat,compat_sys_futimesat_wrapper) | 303 | SYSCALL(sys_futimesat,sys_futimesat,compat_sys_futimesat_wrapper) |
304 | SYSCALL(sys_fstatat64,sys_newfstatat,sys32_fstatat_wrapper) | 304 | SYSCALL(sys_fstatat64,sys_newfstatat,sys32_fstatat64_wrapper) |
305 | SYSCALL(sys_unlinkat,sys_unlinkat,sys_unlinkat_wrapper) | 305 | SYSCALL(sys_unlinkat,sys_unlinkat,sys_unlinkat_wrapper) |
306 | SYSCALL(sys_renameat,sys_renameat,sys_renameat_wrapper) /* 295 */ | 306 | SYSCALL(sys_renameat,sys_renameat,sys_renameat_wrapper) /* 295 */ |
307 | SYSCALL(sys_linkat,sys_linkat,sys_linkat_wrapper) | 307 | SYSCALL(sys_linkat,sys_linkat,sys_linkat_wrapper) |
diff --git a/arch/s390/lib/delay.c b/arch/s390/lib/delay.c index e96c35bddac7..71f0a2fb3078 100644 --- a/arch/s390/lib/delay.c +++ b/arch/s390/lib/delay.c | |||
@@ -30,7 +30,7 @@ void __delay(unsigned long loops) | |||
30 | */ | 30 | */ |
31 | __asm__ __volatile__( | 31 | __asm__ __volatile__( |
32 | "0: brct %0,0b" | 32 | "0: brct %0,0b" |
33 | : /* no outputs */ : "r" (loops/2) ); | 33 | : /* no outputs */ : "r" ((loops/2) + 1)); |
34 | } | 34 | } |
35 | 35 | ||
36 | /* | 36 | /* |