early.c (d35339a42dd1f53b0bb86cf75418a9b7cf5f0f30) early.c (fade4dc49101e3b68fb375fd2b00d0ef1f31a36f)
1/*
2 * Copyright IBM Corp. 2007, 2009
3 * Author(s): Hongjie Yang <hongjie@us.ibm.com>,
4 * Heiko Carstens <heiko.carstens@de.ibm.com>
5 */
6
7#define KMSG_COMPONENT "setup"
8#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt

--- 201 unchanged lines hidden (view full) ---

210
211 end_pfn = PFN_UP(__pa(&_end));
212
213 for (init_pfn = 0 ; init_pfn < end_pfn; init_pfn++)
214 page_set_storage_key(init_pfn << PAGE_SHIFT,
215 PAGE_DEFAULT_KEY, 0);
216}
217
1/*
2 * Copyright IBM Corp. 2007, 2009
3 * Author(s): Hongjie Yang <hongjie@us.ibm.com>,
4 * Heiko Carstens <heiko.carstens@de.ibm.com>
5 */
6
7#define KMSG_COMPONENT "setup"
8#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt

--- 201 unchanged lines hidden (view full) ---

210
211 end_pfn = PFN_UP(__pa(&_end));
212
213 for (init_pfn = 0 ; init_pfn < end_pfn; init_pfn++)
214 page_set_storage_key(init_pfn << PAGE_SHIFT,
215 PAGE_DEFAULT_KEY, 0);
216}
217
218static __initdata struct sysinfo_3_2_2 vmms __aligned(PAGE_SIZE);
218static __initdata char sysinfo_page[PAGE_SIZE] __aligned(PAGE_SIZE);
219
220static noinline __init void detect_machine_type(void)
221{
219
220static noinline __init void detect_machine_type(void)
221{
222 struct sysinfo_3_2_2 *vmms = (struct sysinfo_3_2_2 *)&sysinfo_page;
223
222 /* Check current-configuration-level */
223 if ((stsi(NULL, 0, 0, 0) >> 28) <= 2) {
224 S390_lowcore.machine_flags |= MACHINE_FLAG_LPAR;
225 return;
226 }
227 /* Get virtual-machine cpu information. */
224 /* Check current-configuration-level */
225 if ((stsi(NULL, 0, 0, 0) >> 28) <= 2) {
226 S390_lowcore.machine_flags |= MACHINE_FLAG_LPAR;
227 return;
228 }
229 /* Get virtual-machine cpu information. */
228 if (stsi(&vmms, 3, 2, 2) == -ENOSYS || !vmms.count)
230 if (stsi(vmms, 3, 2, 2) == -ENOSYS || !vmms->count)
229 return;
230
231 /* Running under KVM? If not we assume z/VM */
231 return;
232
233 /* Running under KVM? If not we assume z/VM */
232 if (!memcmp(vmms.vm[0].cpi, "\xd2\xe5\xd4", 3))
234 if (!memcmp(vmms->vm[0].cpi, "\xd2\xe5\xd4", 3))
233 S390_lowcore.machine_flags |= MACHINE_FLAG_KVM;
234 else
235 S390_lowcore.machine_flags |= MACHINE_FLAG_VM;
236}
237
235 S390_lowcore.machine_flags |= MACHINE_FLAG_KVM;
236 else
237 S390_lowcore.machine_flags |= MACHINE_FLAG_VM;
238}
239
240static __init void setup_topology(void)
241{
242#ifdef CONFIG_64BIT
243 int max_mnest;
244
245 if (!test_facility(11))
246 return;
247 S390_lowcore.machine_flags |= MACHINE_FLAG_TOPOLOGY;
248 for (max_mnest = 6; max_mnest > 1; max_mnest--) {
249 if (stsi(&sysinfo_page, 15, 1, max_mnest) != -ENOSYS)
250 break;
251 }
252 topology_max_mnest = max_mnest;
253#endif
254}
255
238static void early_pgm_check_handler(void)
239{
240 unsigned long addr;
241 const struct exception_table_entry *fixup;
242
243 addr = S390_lowcore.program_old_psw.addr;
244 fixup = search_exception_tables(addr & PSW_ADDR_INSN);
245 if (!fixup)

--- 113 unchanged lines hidden (view full) ---

359
360static __init void detect_machine_facilities(void)
361{
362#ifdef CONFIG_64BIT
363 if (test_facility(3))
364 S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
365 if (test_facility(8))
366 S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF;
256static void early_pgm_check_handler(void)
257{
258 unsigned long addr;
259 const struct exception_table_entry *fixup;
260
261 addr = S390_lowcore.program_old_psw.addr;
262 fixup = search_exception_tables(addr & PSW_ADDR_INSN);
263 if (!fixup)

--- 113 unchanged lines hidden (view full) ---

377
378static __init void detect_machine_facilities(void)
379{
380#ifdef CONFIG_64BIT
381 if (test_facility(3))
382 S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
383 if (test_facility(8))
384 S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF;
367 if (test_facility(11))
368 S390_lowcore.machine_flags |= MACHINE_FLAG_TOPOLOGY;
369 if (test_facility(27))
370 S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS;
371 if (test_facility(40))
372 S390_lowcore.machine_flags |= MACHINE_FLAG_SPP;
373 if (test_facility(50) && test_facility(73))
374 S390_lowcore.machine_flags |= MACHINE_FLAG_TE;
375#endif
376}

--- 85 unchanged lines hidden (view full) ---

462 create_kernel_nss();
463 detect_mvpg();
464 detect_ieee();
465 detect_csp();
466 detect_diag9c();
467 detect_diag44();
468 detect_machine_facilities();
469 setup_hpage();
385 if (test_facility(27))
386 S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS;
387 if (test_facility(40))
388 S390_lowcore.machine_flags |= MACHINE_FLAG_SPP;
389 if (test_facility(50) && test_facility(73))
390 S390_lowcore.machine_flags |= MACHINE_FLAG_TE;
391#endif
392}

--- 85 unchanged lines hidden (view full) ---

478 create_kernel_nss();
479 detect_mvpg();
480 detect_ieee();
481 detect_csp();
482 detect_diag9c();
483 detect_diag44();
484 detect_machine_facilities();
485 setup_hpage();
486 setup_topology();
470 sclp_facilities_detect();
471 detect_memory_layout(memory_chunk);
472#ifdef CONFIG_DYNAMIC_FTRACE
473 S390_lowcore.ftrace_func = (unsigned long)ftrace_caller;
474#endif
475 lockdep_on();
476}
487 sclp_facilities_detect();
488 detect_memory_layout(memory_chunk);
489#ifdef CONFIG_DYNAMIC_FTRACE
490 S390_lowcore.ftrace_func = (unsigned long)ftrace_caller;
491#endif
492 lockdep_on();
493}