early.c (b2aaf8f74cdc84a9182f6cabf198b7763bcb9d40) early.c (92e6ecf392fac3082653ac9d84b1bdf53d0ea160)
1/*
2 * arch/s390/kernel/early.c
3 *
4 * Copyright IBM Corp. 2007
5 * Author(s): Hongjie Yang <hongjie@us.ibm.com>,
6 * Heiko Carstens <heiko.carstens@de.ibm.com>
7 */
8
1/*
2 * arch/s390/kernel/early.c
3 *
4 * Copyright IBM Corp. 2007
5 * Author(s): Hongjie Yang <hongjie@us.ibm.com>,
6 * Heiko Carstens <heiko.carstens@de.ibm.com>
7 */
8
9#include <linux/compiler.h>
9#include <linux/init.h>
10#include <linux/errno.h>
11#include <linux/string.h>
12#include <linux/ctype.h>
13#include <linux/lockdep.h>
14#include <linux/module.h>
15#include <linux/pfn.h>
16#include <linux/uaccess.h>
17#include <asm/ebcdic.h>
18#include <asm/ipl.h>
19#include <asm/lowcore.h>
20#include <asm/processor.h>
21#include <asm/sections.h>
22#include <asm/setup.h>
10#include <linux/init.h>
11#include <linux/errno.h>
12#include <linux/string.h>
13#include <linux/ctype.h>
14#include <linux/lockdep.h>
15#include <linux/module.h>
16#include <linux/pfn.h>
17#include <linux/uaccess.h>
18#include <asm/ebcdic.h>
19#include <asm/ipl.h>
20#include <asm/lowcore.h>
21#include <asm/processor.h>
22#include <asm/sections.h>
23#include <asm/setup.h>
24#include <asm/sysinfo.h>
23#include <asm/cpcmd.h>
24#include <asm/sclp.h>
25#include "entry.h"
26
27/*
28 * Create a Kernel NSS if the SAVESYS= parameter is defined
29 */
30#define DEFSYS_CMD_SIZE 128

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

168 unsigned long end_pfn, init_pfn;
169
170 end_pfn = PFN_UP(__pa(&_end));
171
172 for (init_pfn = 0 ; init_pfn < end_pfn; init_pfn++)
173 page_set_storage_key(init_pfn << PAGE_SHIFT, PAGE_DEFAULT_KEY);
174}
175
25#include <asm/cpcmd.h>
26#include <asm/sclp.h>
27#include "entry.h"
28
29/*
30 * Create a Kernel NSS if the SAVESYS= parameter is defined
31 */
32#define DEFSYS_CMD_SIZE 128

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

170 unsigned long end_pfn, init_pfn;
171
172 end_pfn = PFN_UP(__pa(&_end));
173
174 for (init_pfn = 0 ; init_pfn < end_pfn; init_pfn++)
175 page_set_storage_key(init_pfn << PAGE_SHIFT, PAGE_DEFAULT_KEY);
176}
177
178static __initdata struct sysinfo_3_2_2 vmms __aligned(PAGE_SIZE);
179
176static noinline __init void detect_machine_type(void)
177{
180static noinline __init void detect_machine_type(void)
181{
178 struct cpuinfo_S390 *cpuinfo = &S390_lowcore.cpu_data;
182 /* No VM information? Looks like LPAR */
183 if (stsi(&vmms, 3, 2, 2) == -ENOSYS)
184 return;
185 if (!vmms.count)
186 return;
179
187
180 get_cpu_id(&S390_lowcore.cpu_data.cpu_id);
181
182 /* Running under z/VM ? */
183 if (cpuinfo->cpu_id.version == 0xff)
184 machine_flags |= MACHINE_FLAG_VM;
185
186 /* Running under KVM ? */
187 if (cpuinfo->cpu_id.version == 0xfe)
188 /* Running under KVM? If not we assume z/VM */
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}
190
191static __init void early_pgm_check_handler(void)
192{
193 unsigned long addr;
194 const struct exception_table_entry *fixup;
195
196 addr = S390_lowcore.program_old_psw.addr;

--- 196 unchanged lines hidden ---
193}
194
195static __init void early_pgm_check_handler(void)
196{
197 unsigned long addr;
198 const struct exception_table_entry *fixup;
199
200 addr = S390_lowcore.program_old_psw.addr;

--- 196 unchanged lines hidden ---