aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/early.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/early.c')
-rw-r--r--arch/s390/kernel/early.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 2a2ca268b1dd..4d221c81c849 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -6,6 +6,7 @@
6 * Heiko Carstens <heiko.carstens@de.ibm.com> 6 * Heiko Carstens <heiko.carstens@de.ibm.com>
7 */ 7 */
8 8
9#include <linux/compiler.h>
9#include <linux/init.h> 10#include <linux/init.h>
10#include <linux/errno.h> 11#include <linux/errno.h>
11#include <linux/string.h> 12#include <linux/string.h>
@@ -20,6 +21,7 @@
20#include <asm/processor.h> 21#include <asm/processor.h>
21#include <asm/sections.h> 22#include <asm/sections.h>
22#include <asm/setup.h> 23#include <asm/setup.h>
24#include <asm/sysinfo.h>
23#include <asm/cpcmd.h> 25#include <asm/cpcmd.h>
24#include <asm/sclp.h> 26#include <asm/sclp.h>
25#include "entry.h" 27#include "entry.h"
@@ -173,19 +175,21 @@ static noinline __init void init_kernel_storage_key(void)
173 page_set_storage_key(init_pfn << PAGE_SHIFT, PAGE_DEFAULT_KEY); 175 page_set_storage_key(init_pfn << PAGE_SHIFT, PAGE_DEFAULT_KEY);
174} 176}
175 177
178static __initdata struct sysinfo_3_2_2 vmms __aligned(PAGE_SIZE);
179
176static noinline __init void detect_machine_type(void) 180static noinline __init void detect_machine_type(void)
177{ 181{
178 struct cpuinfo_S390 *cpuinfo = &S390_lowcore.cpu_data; 182 /* No VM information? Looks like LPAR */
179 183 if (stsi(&vmms, 3, 2, 2) == -ENOSYS)
180 get_cpu_id(&S390_lowcore.cpu_data.cpu_id); 184 return;
181 185 if (!vmms.count)
182 /* Running under z/VM ? */ 186 return;
183 if (cpuinfo->cpu_id.version == 0xff)
184 machine_flags |= MACHINE_FLAG_VM;
185 187
186 /* Running under KVM ? */ 188 /* Running under KVM? If not we assume z/VM */
187 if (cpuinfo->cpu_id.version == 0xfe) 189 if (!memcmp(vmms.vm[0].cpi, "\xd2\xe5\xd4", 3))
188 machine_flags |= MACHINE_FLAG_KVM; 190 machine_flags |= MACHINE_FLAG_KVM;
191 else
192 machine_flags |= MACHINE_FLAG_VM;
189} 193}
190 194
191static __init void early_pgm_check_handler(void) 195static __init void early_pgm_check_handler(void)
@@ -348,7 +352,6 @@ static void __init setup_boot_command_line(void)
348 352
349 /* copy arch command line */ 353 /* copy arch command line */
350 strlcpy(boot_command_line, COMMAND_LINE, ARCH_COMMAND_LINE_SIZE); 354 strlcpy(boot_command_line, COMMAND_LINE, ARCH_COMMAND_LINE_SIZE);
351 boot_command_line[ARCH_COMMAND_LINE_SIZE - 1] = 0;
352 355
353 /* append IPL PARM data to the boot command line */ 356 /* append IPL PARM data to the boot command line */
354 if (MACHINE_IS_VM) { 357 if (MACHINE_IS_VM) {