aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/setup.c')
-rw-r--r--arch/s390/kernel/setup.c52
1 files changed, 32 insertions, 20 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index c5cfb6185eac..06201b93cbbf 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -74,9 +74,17 @@ EXPORT_SYMBOL(uaccess);
74 * Machine setup.. 74 * Machine setup..
75 */ 75 */
76unsigned int console_mode = 0; 76unsigned int console_mode = 0;
77EXPORT_SYMBOL(console_mode);
78
77unsigned int console_devno = -1; 79unsigned int console_devno = -1;
80EXPORT_SYMBOL(console_devno);
81
78unsigned int console_irq = -1; 82unsigned int console_irq = -1;
83EXPORT_SYMBOL(console_irq);
84
79unsigned long machine_flags; 85unsigned long machine_flags;
86EXPORT_SYMBOL(machine_flags);
87
80unsigned long elf_hwcap = 0; 88unsigned long elf_hwcap = 0;
81char elf_platform[ELF_PLATFORM_SIZE]; 89char elf_platform[ELF_PLATFORM_SIZE];
82 90
@@ -86,6 +94,10 @@ volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */
86int __initdata memory_end_set; 94int __initdata memory_end_set;
87unsigned long __initdata memory_end; 95unsigned long __initdata memory_end;
88 96
97/* An array with a pointer to the lowcore of every CPU. */
98struct _lowcore *lowcore_ptr[NR_CPUS];
99EXPORT_SYMBOL(lowcore_ptr);
100
89/* 101/*
90 * This is set up by the setup-routine at boot-time 102 * This is set up by the setup-routine at boot-time
91 * for S390 need to find out, what we have to setup 103 * for S390 need to find out, what we have to setup
@@ -109,13 +121,10 @@ static struct resource data_resource = {
109 */ 121 */
110void __cpuinit cpu_init(void) 122void __cpuinit cpu_init(void)
111{ 123{
112 int addr = hard_smp_processor_id();
113
114 /* 124 /*
115 * Store processor id in lowcore (used e.g. in timer_interrupt) 125 * Store processor id in lowcore (used e.g. in timer_interrupt)
116 */ 126 */
117 get_cpu_id(&S390_lowcore.cpu_data.cpu_id); 127 get_cpu_id(&S390_lowcore.cpu_id);
118 S390_lowcore.cpu_data.cpu_addr = addr;
119 128
120 /* 129 /*
121 * Force FPU initialization: 130 * Force FPU initialization:
@@ -125,8 +134,7 @@ void __cpuinit cpu_init(void)
125 134
126 atomic_inc(&init_mm.mm_count); 135 atomic_inc(&init_mm.mm_count);
127 current->active_mm = &init_mm; 136 current->active_mm = &init_mm;
128 if (current->mm) 137 BUG_ON(current->mm);
129 BUG();
130 enter_lazy_tlb(&init_mm, current); 138 enter_lazy_tlb(&init_mm, current);
131} 139}
132 140
@@ -217,7 +225,7 @@ static void __init conmode_default(void)
217 } 225 }
218} 226}
219 227
220#if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_ZFCPDUMP_MODULE) 228#ifdef CONFIG_ZFCPDUMP
221static void __init setup_zfcpdump(unsigned int console_devno) 229static void __init setup_zfcpdump(unsigned int console_devno)
222{ 230{
223 static char str[41]; 231 static char str[41];
@@ -289,11 +297,7 @@ static int __init early_parse_mem(char *p)
289early_param("mem", early_parse_mem); 297early_param("mem", early_parse_mem);
290 298
291#ifdef CONFIG_S390_SWITCH_AMODE 299#ifdef CONFIG_S390_SWITCH_AMODE
292#ifdef CONFIG_PGSTE
293unsigned int switch_amode = 1;
294#else
295unsigned int switch_amode = 0; 300unsigned int switch_amode = 0;
296#endif
297EXPORT_SYMBOL_GPL(switch_amode); 301EXPORT_SYMBOL_GPL(switch_amode);
298 302
299static int set_amode_and_uaccess(unsigned long user_amode, 303static int set_amode_and_uaccess(unsigned long user_amode,
@@ -414,7 +418,6 @@ setup_lowcore(void)
414 PSW_ADDR_AMODE | (unsigned long) mcck_int_handler; 418 PSW_ADDR_AMODE | (unsigned long) mcck_int_handler;
415 lc->io_new_psw.mask = psw_kernel_bits; 419 lc->io_new_psw.mask = psw_kernel_bits;
416 lc->io_new_psw.addr = PSW_ADDR_AMODE | (unsigned long) io_int_handler; 420 lc->io_new_psw.addr = PSW_ADDR_AMODE | (unsigned long) io_int_handler;
417 lc->ipl_device = S390_lowcore.ipl_device;
418 lc->clock_comparator = -1ULL; 421 lc->clock_comparator = -1ULL;
419 lc->kernel_stack = ((unsigned long) &init_thread_union) + THREAD_SIZE; 422 lc->kernel_stack = ((unsigned long) &init_thread_union) + THREAD_SIZE;
420 lc->async_stack = (unsigned long) 423 lc->async_stack = (unsigned long)
@@ -434,6 +437,7 @@ setup_lowcore(void)
434 lc->vdso_per_cpu_data = (unsigned long) &lc->paste[0]; 437 lc->vdso_per_cpu_data = (unsigned long) &lc->paste[0];
435#endif 438#endif
436 set_prefix((u32)(unsigned long) lc); 439 set_prefix((u32)(unsigned long) lc);
440 lowcore_ptr[0] = lc;
437} 441}
438 442
439static void __init 443static void __init
@@ -510,7 +514,7 @@ static void __init setup_memory_end(void)
510 unsigned long max_mem; 514 unsigned long max_mem;
511 int i; 515 int i;
512 516
513#if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_ZFCPDUMP_MODULE) 517#ifdef CONFIG_ZFCPDUMP
514 if (ipl_info.type == IPL_TYPE_FCP_DUMP) { 518 if (ipl_info.type == IPL_TYPE_FCP_DUMP) {
515 memory_end = ZFCPDUMP_HSA_SIZE; 519 memory_end = ZFCPDUMP_HSA_SIZE;
516 memory_end_set = 1; 520 memory_end_set = 1;
@@ -677,7 +681,6 @@ setup_memory(void)
677static void __init setup_hwcaps(void) 681static void __init setup_hwcaps(void)
678{ 682{
679 static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 }; 683 static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 };
680 struct cpuinfo_S390 *cpuinfo = &S390_lowcore.cpu_data;
681 unsigned long long facility_list_extended; 684 unsigned long long facility_list_extended;
682 unsigned int facility_list; 685 unsigned int facility_list;
683 int i; 686 int i;
@@ -693,15 +696,22 @@ static void __init setup_hwcaps(void)
693 * Bit 17: the message-security assist is installed 696 * Bit 17: the message-security assist is installed
694 * Bit 19: the long-displacement facility is installed 697 * Bit 19: the long-displacement facility is installed
695 * Bit 21: the extended-immediate facility is installed 698 * Bit 21: the extended-immediate facility is installed
699 * Bit 22: extended-translation facility 3 is installed
700 * Bit 30: extended-translation facility 3 enhancement facility
696 * These get translated to: 701 * These get translated to:
697 * HWCAP_S390_ESAN3 bit 0, HWCAP_S390_ZARCH bit 1, 702 * HWCAP_S390_ESAN3 bit 0, HWCAP_S390_ZARCH bit 1,
698 * HWCAP_S390_STFLE bit 2, HWCAP_S390_MSA bit 3, 703 * HWCAP_S390_STFLE bit 2, HWCAP_S390_MSA bit 3,
699 * HWCAP_S390_LDISP bit 4, and HWCAP_S390_EIMM bit 5. 704 * HWCAP_S390_LDISP bit 4, HWCAP_S390_EIMM bit 5 and
705 * HWCAP_S390_ETF3EH bit 8 (22 && 30).
700 */ 706 */
701 for (i = 0; i < 6; i++) 707 for (i = 0; i < 6; i++)
702 if (facility_list & (1UL << (31 - stfl_bits[i]))) 708 if (facility_list & (1UL << (31 - stfl_bits[i])))
703 elf_hwcap |= 1UL << i; 709 elf_hwcap |= 1UL << i;
704 710
711 if ((facility_list & (1UL << (31 - 22)))
712 && (facility_list & (1UL << (31 - 30))))
713 elf_hwcap |= 1UL << 8;
714
705 /* 715 /*
706 * Check for additional facilities with store-facility-list-extended. 716 * Check for additional facilities with store-facility-list-extended.
707 * stfle stores doublewords (8 byte) with bit 1ULL<<63 as bit 0 717 * stfle stores doublewords (8 byte) with bit 1ULL<<63 as bit 0
@@ -710,20 +720,22 @@ static void __init setup_hwcaps(void)
710 * How many facility words are stored depends on the number of 720 * How many facility words are stored depends on the number of
711 * doublewords passed to the instruction. The additional facilites 721 * doublewords passed to the instruction. The additional facilites
712 * are: 722 * are:
713 * Bit 43: decimal floating point facility is installed 723 * Bit 42: decimal floating point facility is installed
724 * Bit 44: perform floating point operation facility is installed
714 * translated to: 725 * translated to:
715 * HWCAP_S390_DFP bit 6. 726 * HWCAP_S390_DFP bit 6 (42 && 44).
716 */ 727 */
717 if ((elf_hwcap & (1UL << 2)) && 728 if ((elf_hwcap & (1UL << 2)) &&
718 __stfle(&facility_list_extended, 1) > 0) { 729 __stfle(&facility_list_extended, 1) > 0) {
719 if (facility_list_extended & (1ULL << (64 - 43))) 730 if ((facility_list_extended & (1ULL << (63 - 42)))
731 && (facility_list_extended & (1ULL << (63 - 44))))
720 elf_hwcap |= 1UL << 6; 732 elf_hwcap |= 1UL << 6;
721 } 733 }
722 734
723 if (MACHINE_HAS_HPAGE) 735 if (MACHINE_HAS_HPAGE)
724 elf_hwcap |= 1UL << 7; 736 elf_hwcap |= 1UL << 7;
725 737
726 switch (cpuinfo->cpu_id.machine) { 738 switch (S390_lowcore.cpu_id.machine) {
727 case 0x9672: 739 case 0x9672:
728#if !defined(CONFIG_64BIT) 740#if !defined(CONFIG_64BIT)
729 default: /* Use "g5" as default for 31 bit kernels. */ 741 default: /* Use "g5" as default for 31 bit kernels. */
@@ -816,7 +828,7 @@ setup_arch(char **cmdline_p)
816 setup_lowcore(); 828 setup_lowcore();
817 829
818 cpu_init(); 830 cpu_init();
819 __cpu_logical_map[0] = S390_lowcore.cpu_data.cpu_addr; 831 __cpu_logical_map[0] = stap();
820 s390_init_cpu_topology(); 832 s390_init_cpu_topology();
821 833
822 /* 834 /*