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