blob: 2f924bc30e358542201bdde082ab6d0289f3403c [file] [log] [blame]
Heiko Carstenscf13f0e2005-06-25 14:58:11 -07001/*
Heiko Carstensa53c8fa2012-07-20 11:15:04 +02002 * Copyright IBM Corp. 2005
Heiko Carstenscf13f0e2005-06-25 14:58:11 -07003 *
4 * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com>
5 *
6 */
7
8#ifndef _S390_KEXEC_H
9#define _S390_KEXEC_H
10
Heiko Carstenscf13f0e2005-06-25 14:58:11 -070011#include <asm/processor.h>
Heiko Carstensda477732012-05-23 13:55:45 +020012#include <asm/page.h>
Heiko Carstenscf13f0e2005-06-25 14:58:11 -070013/*
14 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
15 * I.e. Maximum page that is mapped directly into kernel memory,
16 * and kmap is not required.
17 */
18
19/* Maximum physical address we can use pages from */
20#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
21
22/* Maximum address we can reach in physical address mode */
23#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
24
25/* Maximum address we can use for the control pages */
26/* Not more than 2GB */
Heiko Carstensa1a392f2006-12-04 15:40:28 +010027#define KEXEC_CONTROL_MEMORY_LIMIT (1UL<<31)
Heiko Carstenscf13f0e2005-06-25 14:58:11 -070028
Martin Schwidefsky7e01b5a2015-04-16 14:47:33 +020029/* Allocate control page with GFP_DMA */
30#define KEXEC_CONTROL_MEMORY_GFP GFP_DMA
31
Michael Holzheu60a0c682011-10-30 15:16:40 +010032/* Maximum address we can use for the crash control pages */
33#define KEXEC_CRASH_CONTROL_MEMORY_LIMIT (-1UL)
34
Heiko Carstenscf13f0e2005-06-25 14:58:11 -070035/* Allocate one page for the pdp and the second for the code */
Huang Ying163f6872008-08-15 00:40:22 -070036#define KEXEC_CONTROL_PAGE_SIZE 4096
Heiko Carstenscf13f0e2005-06-25 14:58:11 -070037
Michael Holzheudab7a7b2011-10-30 15:16:44 +010038/* Alignment of crashkernel memory */
39#define KEXEC_CRASH_MEM_ALIGN HPAGE_SIZE
40
Heiko Carstenscf13f0e2005-06-25 14:58:11 -070041/* The native architecture */
42#define KEXEC_ARCH KEXEC_ARCH_S390
43
Michael Holzheucb78edf2012-01-20 14:34:16 -080044/*
45 * Size for s390x ELF notes per CPU
46 *
47 * Seven notes plus zero note at the end: prstatus, fpregset, timer,
48 * tod_cmp, tod_reg, control regs, and prefix
49 */
50#define KEXEC_NOTE_BYTES \
51 (ALIGN(sizeof(struct elf_note), 4) * 8 + \
52 ALIGN(sizeof("CORE"), 4) * 7 + \
53 ALIGN(sizeof(struct elf_prstatus), 4) + \
54 ALIGN(sizeof(elf_fpregset_t), 4) + \
55 ALIGN(sizeof(u64), 4) + \
56 ALIGN(sizeof(u64), 4) + \
57 ALIGN(sizeof(u32), 4) + \
58 ALIGN(sizeof(u64) * 16, 4) + \
59 ALIGN(sizeof(u32), 4) \
60 )
61
akpm@osdl.orgbf208302006-01-09 20:51:45 -080062/* Provide a dummy definition to avoid build failures. */
63static inline void crash_setup_regs(struct pt_regs *newregs,
64 struct pt_regs *oldregs) { }
65
Heiko Carstenscf13f0e2005-06-25 14:58:11 -070066#endif /*_S390_KEXEC_H */