207
208
end_pfn = PFN_UP(__pa(&_end));
209
210
for (init_pfn = 0 ; init_pfn < end_pfn; init_pfn++)
210
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);
213
215
static __initdata struct sysinfo_3_2_2 vmms __aligned(PAGE_SIZE);
215
217
static noinline __init void detect_machine_type(void)
217
/* No VM information? Looks like LPAR */
218
if (stsi(&vmms, 3, 2, 2) == -ENOSYS)
219
/* Check current-configuration-level */
220
if ((stsi(NULL, 0, 0, 0) >> 28) <= 2) {
221
S390_lowcore.machine_flags |= MACHINE_FLAG_LPAR;
224
/* Get virtual-machine cpu information. */
225
if (stsi(&vmms, 3, 2, 2) == -ENOSYS || !vmms.count)
223
228
/* Running under KVM? If not we assume z/VM */
251
256
s390_base_pgm_handler_fn = early_pgm_check_handler;
259
static noinline __init void setup_facility_list(void)
263
S390_lowcore.stfl_fac_list = 0;
265
" .insn s,0xb2b10000,0(0)\n" /* stfl */
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)
276
nr = (reg0 + 1) * 8; /* # bytes stored by stfle */
278
memset((char *) S390_lowcore.stfle_fac_list + nr, 0,
279
MAX_FACILITY_BIT/8 - nr);
254
282
static noinline __init void setup_hpage(void)
256
284
#ifndef CONFIG_DEBUG_PAGEALLOC
257
unsigned int facilities;
260
if (!(facilities & (1UL << 23)) || !(facilities & (1UL << 29)))
285
if (!test_facility(2) || !test_facility(8))
262
287
S390_lowcore.machine_flags |= MACHINE_FLAG_HPAGE;
263
288
__ctl_set_bit(0, 23);
351
376
static __init void detect_machine_facilities(void)
353
378
#ifdef CONFIG_64BIT
354
unsigned int facilities;
357
if (facilities & (1 << 28))
379
if (test_facility(3))
358
380
S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
359
if (facilities & (1 << 23))
381
if (test_facility(8))
360
382
S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF;
361
if (facilities & (1 << 4))
383
if (test_facility(11))
384
S390_lowcore.machine_flags |= MACHINE_FLAG_TOPOLOGY;
385
if (test_facility(27))
362
386
S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS;
387
if (test_facility(40))
388
S390_lowcore.machine_flags |= MACHINE_FLAG_SPP;
403
429
static void __init setup_boot_command_line(void)
433
/* convert arch command line to ascii */
434
for (i = 0; i < ARCH_COMMAND_LINE_SIZE; i++)
435
if (COMMAND_LINE[i] & 0x80)
437
if (i < ARCH_COMMAND_LINE_SIZE)
438
EBCASC(COMMAND_LINE, ARCH_COMMAND_LINE_SIZE);
439
COMMAND_LINE[ARCH_COMMAND_LINE_SIZE-1] = 0;
405
441
/* copy arch command line */
406
strlcpy(boot_command_line, COMMAND_LINE, ARCH_COMMAND_LINE_SIZE);
442
strlcpy(boot_command_line, strstrip(COMMAND_LINE),
443
ARCH_COMMAND_LINE_SIZE);
408
445
/* append IPL PARM data to the boot command line */
409
446
if (MACHINE_IS_VM)