aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/early.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/early.c')
-rw-r--r--arch/s390/kernel/early.c45
1 files changed, 33 insertions, 12 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index c00856ad4e5a..d149609e46e6 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -208,7 +208,8 @@ static noinline __init void init_kernel_storage_key(void)
208 end_pfn = PFN_UP(__pa(&_end)); 208 end_pfn = PFN_UP(__pa(&_end));
209 209
210 for (init_pfn = 0 ; init_pfn < end_pfn; init_pfn++) 210 for (init_pfn = 0 ; init_pfn < end_pfn; init_pfn++)
211 page_set_storage_key(init_pfn << PAGE_SHIFT, PAGE_DEFAULT_KEY); 211 page_set_storage_key(init_pfn << PAGE_SHIFT,
212 PAGE_DEFAULT_KEY, 0);
212} 213}
213 214
214static __initdata struct sysinfo_3_2_2 vmms __aligned(PAGE_SIZE); 215static __initdata struct sysinfo_3_2_2 vmms __aligned(PAGE_SIZE);
@@ -255,13 +256,35 @@ static noinline __init void setup_lowcore_early(void)
255 s390_base_pgm_handler_fn = early_pgm_check_handler; 256 s390_base_pgm_handler_fn = early_pgm_check_handler;
256} 257}
257 258
259static noinline __init void setup_facility_list(void)
260{
261 unsigned long nr;
262
263 S390_lowcore.stfl_fac_list = 0;
264 asm volatile(
265 " .insn s,0xb2b10000,0(0)\n" /* stfl */
266 "0:\n"
267 EX_TABLE(0b,0b) : "=m" (S390_lowcore.stfl_fac_list));
268 memcpy(&S390_lowcore.stfle_fac_list, &S390_lowcore.stfl_fac_list, 4);
269 nr = 4; /* # bytes stored by stfl */
270 if (test_facility(7)) {
271 /* More facility bits available with stfle */
272 register unsigned long reg0 asm("0") = MAX_FACILITY_BIT/64 - 1;
273 asm volatile(".insn s,0xb2b00000,%0" /* stfle */
274 : "=m" (S390_lowcore.stfle_fac_list), "+d" (reg0)
275 : : "cc");
276 nr = (reg0 + 1) * 8; /* # bytes stored by stfle */
277 }
278 memset((char *) S390_lowcore.stfle_fac_list + nr, 0,
279 MAX_FACILITY_BIT/8 - nr);
280}
281
258static noinline __init void setup_hpage(void) 282static noinline __init void setup_hpage(void)
259{ 283{
260#ifndef CONFIG_DEBUG_PAGEALLOC 284#ifndef CONFIG_DEBUG_PAGEALLOC
261 unsigned int facilities; 285 unsigned int facilities;
262 286
263 facilities = stfl(); 287 if (!test_facility(2) || !test_facility(8))
264 if (!(facilities & (1UL << 23)) || !(facilities & (1UL << 29)))
265 return; 288 return;
266 S390_lowcore.machine_flags |= MACHINE_FLAG_HPAGE; 289 S390_lowcore.machine_flags |= MACHINE_FLAG_HPAGE;
267 __ctl_set_bit(0, 23); 290 __ctl_set_bit(0, 23);
@@ -355,18 +378,15 @@ static __init void detect_diag44(void)
355static __init void detect_machine_facilities(void) 378static __init void detect_machine_facilities(void)
356{ 379{
357#ifdef CONFIG_64BIT 380#ifdef CONFIG_64BIT
358 unsigned int facilities; 381 if (test_facility(3))
359 unsigned long long facility_bits;
360
361 facilities = stfl();
362 if (facilities & (1 << 28))
363 S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE; 382 S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
364 if (facilities & (1 << 23)) 383 if (test_facility(8))
365 S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF; 384 S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF;
366 if (facilities & (1 << 4)) 385 if (test_facility(11))
386 S390_lowcore.machine_flags |= MACHINE_FLAG_TOPOLOGY;
387 if (test_facility(27))
367 S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS; 388 S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS;
368 if ((stfle(&facility_bits, 1) > 0) && 389 if (test_facility(40))
369 (facility_bits & (1ULL << (63 - 40))))
370 S390_lowcore.machine_flags |= MACHINE_FLAG_SPP; 390 S390_lowcore.machine_flags |= MACHINE_FLAG_SPP;
371#endif 391#endif
372} 392}
@@ -447,6 +467,7 @@ void __init startup_init(void)
447 lockdep_off(); 467 lockdep_off();
448 sort_main_extable(); 468 sort_main_extable();
449 setup_lowcore_early(); 469 setup_lowcore_early();
470 setup_facility_list();
450 detect_machine_type(); 471 detect_machine_type();
451 ipl_update_parameters(); 472 ipl_update_parameters();
452 setup_boot_command_line(); 473 setup_boot_command_line();