diff options
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kernel/setup.c | 72 |
1 files changed, 46 insertions, 26 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index bed9dcb34fda..ba724d180be7 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -14,6 +14,9 @@ | |||
14 | * This file handles the architecture-dependent parts of initialization | 14 | * This file handles the architecture-dependent parts of initialization |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #define KMSG_COMPONENT "setup" | ||
18 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | ||
19 | |||
17 | #include <linux/errno.h> | 20 | #include <linux/errno.h> |
18 | #include <linux/module.h> | 21 | #include <linux/module.h> |
19 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
@@ -291,8 +294,8 @@ unsigned int switch_amode = 0; | |||
291 | #endif | 294 | #endif |
292 | EXPORT_SYMBOL_GPL(switch_amode); | 295 | EXPORT_SYMBOL_GPL(switch_amode); |
293 | 296 | ||
294 | static void set_amode_and_uaccess(unsigned long user_amode, | 297 | static int set_amode_and_uaccess(unsigned long user_amode, |
295 | unsigned long user32_amode) | 298 | unsigned long user32_amode) |
296 | { | 299 | { |
297 | psw_user_bits = PSW_BASE_BITS | PSW_MASK_DAT | user_amode | | 300 | psw_user_bits = PSW_BASE_BITS | PSW_MASK_DAT | user_amode | |
298 | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | | 301 | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | |
@@ -309,11 +312,11 @@ static void set_amode_and_uaccess(unsigned long user_amode, | |||
309 | PSW_MASK_MCHECK | PSW_DEFAULT_KEY; | 312 | PSW_MASK_MCHECK | PSW_DEFAULT_KEY; |
310 | 313 | ||
311 | if (MACHINE_HAS_MVCOS) { | 314 | if (MACHINE_HAS_MVCOS) { |
312 | printk("mvcos available.\n"); | ||
313 | memcpy(&uaccess, &uaccess_mvcos_switch, sizeof(uaccess)); | 315 | memcpy(&uaccess, &uaccess_mvcos_switch, sizeof(uaccess)); |
316 | return 1; | ||
314 | } else { | 317 | } else { |
315 | printk("mvcos not available.\n"); | ||
316 | memcpy(&uaccess, &uaccess_pt, sizeof(uaccess)); | 318 | memcpy(&uaccess, &uaccess_pt, sizeof(uaccess)); |
319 | return 0; | ||
317 | } | 320 | } |
318 | } | 321 | } |
319 | 322 | ||
@@ -328,9 +331,10 @@ static int __init early_parse_switch_amode(char *p) | |||
328 | early_param("switch_amode", early_parse_switch_amode); | 331 | early_param("switch_amode", early_parse_switch_amode); |
329 | 332 | ||
330 | #else /* CONFIG_S390_SWITCH_AMODE */ | 333 | #else /* CONFIG_S390_SWITCH_AMODE */ |
331 | static inline void set_amode_and_uaccess(unsigned long user_amode, | 334 | static inline int set_amode_and_uaccess(unsigned long user_amode, |
332 | unsigned long user32_amode) | 335 | unsigned long user32_amode) |
333 | { | 336 | { |
337 | return 0; | ||
334 | } | 338 | } |
335 | #endif /* CONFIG_S390_SWITCH_AMODE */ | 339 | #endif /* CONFIG_S390_SWITCH_AMODE */ |
336 | 340 | ||
@@ -355,11 +359,20 @@ early_param("noexec", early_parse_noexec); | |||
355 | static void setup_addressing_mode(void) | 359 | static void setup_addressing_mode(void) |
356 | { | 360 | { |
357 | if (s390_noexec) { | 361 | if (s390_noexec) { |
358 | printk("S390 execute protection active, "); | 362 | if (set_amode_and_uaccess(PSW_ASC_SECONDARY, |
359 | set_amode_and_uaccess(PSW_ASC_SECONDARY, PSW32_ASC_SECONDARY); | 363 | PSW32_ASC_SECONDARY)) |
364 | pr_info("Execute protection active, " | ||
365 | "mvcos available\n"); | ||
366 | else | ||
367 | pr_info("Execute protection active, " | ||
368 | "mvcos not available\n"); | ||
360 | } else if (switch_amode) { | 369 | } else if (switch_amode) { |
361 | printk("S390 address spaces switched, "); | 370 | if (set_amode_and_uaccess(PSW_ASC_PRIMARY, PSW32_ASC_PRIMARY)) |
362 | set_amode_and_uaccess(PSW_ASC_PRIMARY, PSW32_ASC_PRIMARY); | 371 | pr_info("Address spaces switched, " |
372 | "mvcos available\n"); | ||
373 | else | ||
374 | pr_info("Address spaces switched, " | ||
375 | "mvcos not available\n"); | ||
363 | } | 376 | } |
364 | #ifdef CONFIG_TRACE_IRQFLAGS | 377 | #ifdef CONFIG_TRACE_IRQFLAGS |
365 | sysc_restore_trace_psw.mask = psw_kernel_bits & ~PSW_MASK_MCHECK; | 378 | sysc_restore_trace_psw.mask = psw_kernel_bits & ~PSW_MASK_MCHECK; |
@@ -572,15 +585,15 @@ setup_memory(void) | |||
572 | start = PFN_PHYS(start_pfn) + bmap_size + PAGE_SIZE; | 585 | start = PFN_PHYS(start_pfn) + bmap_size + PAGE_SIZE; |
573 | 586 | ||
574 | if (start + INITRD_SIZE > memory_end) { | 587 | if (start + INITRD_SIZE > memory_end) { |
575 | printk("initrd extends beyond end of memory " | 588 | pr_err("initrd extends beyond end of " |
576 | "(0x%08lx > 0x%08lx)\n" | 589 | "memory (0x%08lx > 0x%08lx) " |
577 | "disabling initrd\n", | 590 | "disabling initrd\n", |
578 | start + INITRD_SIZE, memory_end); | 591 | start + INITRD_SIZE, memory_end); |
579 | INITRD_START = INITRD_SIZE = 0; | 592 | INITRD_START = INITRD_SIZE = 0; |
580 | } else { | 593 | } else { |
581 | printk("Moving initrd (0x%08lx -> 0x%08lx, " | 594 | pr_info("Moving initrd (0x%08lx -> " |
582 | "size: %ld)\n", | 595 | "0x%08lx, size: %ld)\n", |
583 | INITRD_START, start, INITRD_SIZE); | 596 | INITRD_START, start, INITRD_SIZE); |
584 | memmove((void *) start, (void *) INITRD_START, | 597 | memmove((void *) start, (void *) INITRD_START, |
585 | INITRD_SIZE); | 598 | INITRD_SIZE); |
586 | INITRD_START = start; | 599 | INITRD_START = start; |
@@ -642,8 +655,9 @@ setup_memory(void) | |||
642 | initrd_start = INITRD_START; | 655 | initrd_start = INITRD_START; |
643 | initrd_end = initrd_start + INITRD_SIZE; | 656 | initrd_end = initrd_start + INITRD_SIZE; |
644 | } else { | 657 | } else { |
645 | printk("initrd extends beyond end of memory " | 658 | pr_err("initrd extends beyond end of " |
646 | "(0x%08lx > 0x%08lx)\ndisabling initrd\n", | 659 | "memory (0x%08lx > 0x%08lx) " |
660 | "disabling initrd\n", | ||
647 | initrd_start + INITRD_SIZE, memory_end); | 661 | initrd_start + INITRD_SIZE, memory_end); |
648 | initrd_start = initrd_end = 0; | 662 | initrd_start = initrd_end = 0; |
649 | } | 663 | } |
@@ -747,21 +761,27 @@ setup_arch(char **cmdline_p) | |||
747 | * print what head.S has found out about the machine | 761 | * print what head.S has found out about the machine |
748 | */ | 762 | */ |
749 | #ifndef CONFIG_64BIT | 763 | #ifndef CONFIG_64BIT |
750 | printk((MACHINE_IS_VM) ? | 764 | if (MACHINE_IS_VM) |
751 | "We are running under VM (31 bit mode)\n" : | 765 | pr_info("Linux is running as a z/VM " |
752 | "We are running native (31 bit mode)\n"); | 766 | "guest operating system in 31-bit mode\n"); |
753 | printk((MACHINE_HAS_IEEE) ? | 767 | else |
754 | "This machine has an IEEE fpu\n" : | 768 | pr_info("Linux is running natively in 31-bit mode\n"); |
755 | "This machine has no IEEE fpu\n"); | 769 | if (MACHINE_HAS_IEEE) |
770 | pr_info("The hardware system has IEEE compatible " | ||
771 | "floating point units\n"); | ||
772 | else | ||
773 | pr_info("The hardware system has no IEEE compatible " | ||
774 | "floating point units\n"); | ||
756 | #else /* CONFIG_64BIT */ | 775 | #else /* CONFIG_64BIT */ |
757 | if (MACHINE_IS_VM) | 776 | if (MACHINE_IS_VM) |
758 | printk("We are running under VM (64 bit mode)\n"); | 777 | pr_info("Linux is running as a z/VM " |
778 | "guest operating system in 64-bit mode\n"); | ||
759 | else if (MACHINE_IS_KVM) { | 779 | else if (MACHINE_IS_KVM) { |
760 | printk("We are running under KVM (64 bit mode)\n"); | 780 | pr_info("Linux is running under KVM in 64-bit mode\n"); |
761 | add_preferred_console("hvc", 0, NULL); | 781 | add_preferred_console("hvc", 0, NULL); |
762 | s390_virtio_console_init(); | 782 | s390_virtio_console_init(); |
763 | } else | 783 | } else |
764 | printk("We are running native (64 bit mode)\n"); | 784 | pr_info("Linux is running natively in 64-bit mode\n"); |
765 | #endif /* CONFIG_64BIT */ | 785 | #endif /* CONFIG_64BIT */ |
766 | 786 | ||
767 | /* Have one command line that is parsed and saved in /proc/cmdline */ | 787 | /* Have one command line that is parsed and saved in /proc/cmdline */ |