mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-13 03:06:54 +07:00
eb39c8803d
Reserve the memory during early boot to preserve CPU state data, HPTE region and RMA (real mode area) region data in case of kernel crash. At the time of crash, powerpc firmware will store CPU state data, HPTE region data and move RMA region data to the reserved memory area. If the firmware-assisted dump fails to reserve the memory, then fallback to existing kexec-based kdump. Most of the code implementation to reserve memory has been adapted from phyp assisted dump implementation written by Linas Vepstas and Manish Ahuja This patch also introduces a config option CONFIG_FA_DUMP for firmware assisted dump feature on Powerpc (ppc64) architecture. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
72 lines
2.3 KiB
C
72 lines
2.3 KiB
C
/*
|
|
* Firmware Assisted dump header file.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*
|
|
* Copyright 2011 IBM Corporation
|
|
* Author: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
|
|
*/
|
|
|
|
#ifndef __PPC64_FA_DUMP_H__
|
|
#define __PPC64_FA_DUMP_H__
|
|
|
|
#ifdef CONFIG_FA_DUMP
|
|
|
|
/*
|
|
* The RMA region will be saved for later dumping when kernel crashes.
|
|
* RMA is Real Mode Area, the first block of logical memory address owned
|
|
* by logical partition, containing the storage that may be accessed with
|
|
* translate off.
|
|
*/
|
|
#define RMA_START 0x0
|
|
#define RMA_END (ppc64_rma_size)
|
|
|
|
/*
|
|
* On some Power systems where RMO is 128MB, it still requires minimum of
|
|
* 256MB for kernel to boot successfully. When kdump infrastructure is
|
|
* configured to save vmcore over network, we run into OOM issue while
|
|
* loading modules related to network setup. Hence we need aditional 64M
|
|
* of memory to avoid OOM issue.
|
|
*/
|
|
#define MIN_BOOT_MEM (((RMA_END < (0x1UL << 28)) ? (0x1UL << 28) : RMA_END) \
|
|
+ (0x1UL << 26))
|
|
|
|
/* Firmware provided dump sections */
|
|
#define FADUMP_CPU_STATE_DATA 0x0001
|
|
#define FADUMP_HPTE_REGION 0x0002
|
|
#define FADUMP_REAL_MODE_REGION 0x0011
|
|
|
|
struct fw_dump {
|
|
unsigned long cpu_state_data_size;
|
|
unsigned long hpte_region_size;
|
|
unsigned long boot_memory_size;
|
|
unsigned long reserve_dump_area_start;
|
|
unsigned long reserve_dump_area_size;
|
|
/* cmd line option during boot */
|
|
unsigned long reserve_bootvar;
|
|
|
|
int ibm_configure_kernel_dump;
|
|
|
|
unsigned long fadump_enabled:1;
|
|
unsigned long fadump_supported:1;
|
|
unsigned long dump_active:1;
|
|
};
|
|
|
|
extern int early_init_dt_scan_fw_dump(unsigned long node,
|
|
const char *uname, int depth, void *data);
|
|
extern int fadump_reserve_mem(void);
|
|
#endif
|
|
#endif
|