diff options
Diffstat (limited to 'arch/s390/kernel/early.c')
-rw-r--r-- | arch/s390/kernel/early.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index e49e9e0c69fd..2d92c2cf92d7 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
@@ -82,7 +82,8 @@ asm( | |||
82 | " lm 6,15,24(15)\n" | 82 | " lm 6,15,24(15)\n" |
83 | #endif | 83 | #endif |
84 | " br 14\n" | 84 | " br 14\n" |
85 | " .size savesys_ipl_nss, .-savesys_ipl_nss\n"); | 85 | " .size savesys_ipl_nss, .-savesys_ipl_nss\n" |
86 | " .previous\n"); | ||
86 | 87 | ||
87 | static __initdata char upper_command_line[COMMAND_LINE_SIZE]; | 88 | static __initdata char upper_command_line[COMMAND_LINE_SIZE]; |
88 | 89 | ||
@@ -214,10 +215,13 @@ static __initdata struct sysinfo_3_2_2 vmms __aligned(PAGE_SIZE); | |||
214 | 215 | ||
215 | static noinline __init void detect_machine_type(void) | 216 | static noinline __init void detect_machine_type(void) |
216 | { | 217 | { |
217 | /* No VM information? Looks like LPAR */ | 218 | /* Check current-configuration-level */ |
218 | if (stsi(&vmms, 3, 2, 2) == -ENOSYS) | 219 | if ((stsi(NULL, 0, 0, 0) >> 28) <= 2) { |
220 | S390_lowcore.machine_flags |= MACHINE_FLAG_LPAR; | ||
219 | return; | 221 | return; |
220 | if (!vmms.count) | 222 | } |
223 | /* Get virtual-machine cpu information. */ | ||
224 | if (stsi(&vmms, 3, 2, 2) == -ENOSYS || !vmms.count) | ||
221 | return; | 225 | return; |
222 | 226 | ||
223 | /* Running under KVM? If not we assume z/VM */ | 227 | /* Running under KVM? If not we assume z/VM */ |
@@ -402,8 +406,19 @@ static void __init append_to_cmdline(size_t (*ipl_data)(char *, size_t)) | |||
402 | 406 | ||
403 | static void __init setup_boot_command_line(void) | 407 | static void __init setup_boot_command_line(void) |
404 | { | 408 | { |
409 | int i; | ||
410 | |||
411 | /* convert arch command line to ascii */ | ||
412 | for (i = 0; i < ARCH_COMMAND_LINE_SIZE; i++) | ||
413 | if (COMMAND_LINE[i] & 0x80) | ||
414 | break; | ||
415 | if (i < ARCH_COMMAND_LINE_SIZE) | ||
416 | EBCASC(COMMAND_LINE, ARCH_COMMAND_LINE_SIZE); | ||
417 | COMMAND_LINE[ARCH_COMMAND_LINE_SIZE-1] = 0; | ||
418 | |||
405 | /* copy arch command line */ | 419 | /* copy arch command line */ |
406 | strlcpy(boot_command_line, COMMAND_LINE, ARCH_COMMAND_LINE_SIZE); | 420 | strlcpy(boot_command_line, strstrip(COMMAND_LINE), |
421 | ARCH_COMMAND_LINE_SIZE); | ||
407 | 422 | ||
408 | /* append IPL PARM data to the boot command line */ | 423 | /* append IPL PARM data to the boot command line */ |
409 | if (MACHINE_IS_VM) | 424 | if (MACHINE_IS_VM) |