Commit 484193fe authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull more powerpc updates from Michael Ellerman:

 - Handle errors in mark_rodata_ro() and mark_initmem_nx()

 - Make struct crash_mem available without CONFIG_CRASH_DUMP

Thanks to Christophe Leroy and Hari Bathini.

* tag 'powerpc-6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency
  powerpc/kexec: split CONFIG_KEXEC_FILE and CONFIG_CRASH_DUMP
  kexec/kdump: make struct crash_mem available without CONFIG_CRASH_DUMP
  powerpc: Handle error in mark_rodata_ro() and mark_initmem_nx()
parents 02fb638b 5c4233cc
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -607,11 +607,6 @@ config PPC64_SUPPORTS_MEMORY_FAILURE
config ARCH_SUPPORTS_KEXEC
	def_bool PPC_BOOK3S || PPC_E500 || (44x && !SMP)

config ARCH_SELECTS_KEXEC
	def_bool y
	depends on KEXEC
	select CRASH_DUMP

config ARCH_SUPPORTS_KEXEC_FILE
	def_bool PPC64

@@ -622,7 +617,6 @@ config ARCH_SELECTS_KEXEC_FILE
	def_bool y
	depends on KEXEC_FILE
	select KEXEC_ELF
	select CRASH_DUMP
	select HAVE_IMA_KEXEC if IMA

config PPC64_BIG_ENDIAN_ELF_ABI_V2
@@ -694,8 +688,7 @@ config ARCH_SELECTS_CRASH_DUMP

config FA_DUMP
	bool "Firmware-assisted dump"
	depends on PPC64 && (PPC_RTAS || PPC_POWERNV)
	select CRASH_DUMP
	depends on CRASH_DUMP && PPC64 && (PPC_RTAS || PPC_POWERNV)
	help
	  A robust mechanism to get reliable kernel crash dump with
	  assistance from firmware. This approach does not use kexec,
+49 −49
Original line number Diff line number Diff line
@@ -55,59 +55,18 @@
typedef void (*crash_shutdown_t)(void);

#ifdef CONFIG_KEXEC_CORE

/*
 * This function is responsible for capturing register states if coming
 * via panic or invoking dump using sysrq-trigger.
 */
static inline void crash_setup_regs(struct pt_regs *newregs,
					struct pt_regs *oldregs)
{
	if (oldregs)
		memcpy(newregs, oldregs, sizeof(*newregs));
	else
		ppc_save_regs(newregs);
}
struct kimage;
struct pt_regs;

extern void kexec_smp_wait(void);	/* get and clear naca physid, wait for
					  master to copy new code to 0 */
extern int crashing_cpu;
extern void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *));
extern void crash_ipi_callback(struct pt_regs *);
extern int crash_wake_offline;

struct kimage;
struct pt_regs;
extern void default_machine_kexec(struct kimage *image);
extern void default_machine_crash_shutdown(struct pt_regs *regs);
extern int crash_shutdown_register(crash_shutdown_t handler);
extern int crash_shutdown_unregister(crash_shutdown_t handler);

extern void crash_kexec_prepare(void);
extern void crash_kexec_secondary(struct pt_regs *regs);
int __init overlaps_crashkernel(unsigned long start, unsigned long size);
extern void reserve_crashkernel(void);
extern void machine_kexec_mask_interrupts(void);

static inline bool kdump_in_progress(void)
{
	return crashing_cpu >= 0;
}

void relocate_new_kernel(unsigned long indirection_page, unsigned long reboot_code_buffer,
			 unsigned long start_address) __noreturn;

void kexec_copy_flush(struct kimage *image);

#if defined(CONFIG_CRASH_DUMP)
bool is_kdump_kernel(void);
#define is_kdump_kernel			is_kdump_kernel
#if defined(CONFIG_PPC_RTAS)
void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);
#define crash_free_reserved_phys_range crash_free_reserved_phys_range
#endif /* CONFIG_PPC_RTAS */
#endif /* CONFIG_CRASH_DUMP */

#ifdef CONFIG_KEXEC_FILE
extern const struct kexec_file_ops kexec_elf64_ops;

@@ -152,15 +111,56 @@ int setup_new_fdt_ppc64(const struct kimage *image, void *fdt,

#endif /* CONFIG_KEXEC_FILE */

#else /* !CONFIG_KEXEC_CORE */
static inline void crash_kexec_secondary(struct pt_regs *regs) { }
#endif /* CONFIG_KEXEC_CORE */

#ifdef CONFIG_CRASH_RESERVE
int __init overlaps_crashkernel(unsigned long start, unsigned long size);
extern void reserve_crashkernel(void);
#else
static inline void reserve_crashkernel(void) {}
static inline int overlaps_crashkernel(unsigned long start, unsigned long size) { return 0; }
#endif

static inline int overlaps_crashkernel(unsigned long start, unsigned long size)
#if defined(CONFIG_CRASH_DUMP)
/*
 * This function is responsible for capturing register states if coming
 * via panic or invoking dump using sysrq-trigger.
 */
static inline void crash_setup_regs(struct pt_regs *newregs,
					struct pt_regs *oldregs)
{
	return 0;
	if (oldregs)
		memcpy(newregs, oldregs, sizeof(*newregs));
	else
		ppc_save_regs(newregs);
}

extern int crashing_cpu;
extern void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *));
extern void crash_ipi_callback(struct pt_regs *regs);
extern int crash_wake_offline;

extern int crash_shutdown_register(crash_shutdown_t handler);
extern int crash_shutdown_unregister(crash_shutdown_t handler);
extern void default_machine_crash_shutdown(struct pt_regs *regs);

extern void crash_kexec_prepare(void);
extern void crash_kexec_secondary(struct pt_regs *regs);

static inline bool kdump_in_progress(void)
{
	return crashing_cpu >= 0;
}

static inline void reserve_crashkernel(void) { ; }
bool is_kdump_kernel(void);
#define is_kdump_kernel			is_kdump_kernel
#if defined(CONFIG_PPC_RTAS)
void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);
#define crash_free_reserved_phys_range crash_free_reserved_phys_range
#endif /* CONFIG_PPC_RTAS */

#else /* !CONFIG_CRASH_DUMP */
static inline void crash_kexec_secondary(struct pt_regs *regs) { }

static inline int crash_shutdown_register(crash_shutdown_t handler)
{
@@ -183,7 +183,7 @@ static inline void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *))
{
}

#endif /* CONFIG_KEXEC_CORE */
#endif /* CONFIG_CRASH_DUMP */

#ifdef CONFIG_PPC_BOOK3S_64
#include <asm/book3s/64/kexec.h>
+1 −1
Original line number Diff line number Diff line
@@ -475,7 +475,7 @@ static int __init early_init_dt_scan_chosen_ppc(unsigned long node,
		tce_alloc_end = *lprop;
#endif

#ifdef CONFIG_KEXEC_CORE
#ifdef CONFIG_CRASH_RESERVE
	lprop = of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL);
	if (lprop)
		crashk_res.start = *lprop;
+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ int ppc_do_canonicalize_irqs;
EXPORT_SYMBOL(ppc_do_canonicalize_irqs);
#endif

#ifdef CONFIG_VMCORE_INFO
#ifdef CONFIG_CRASH_DUMP
/* This keeps a track of which one is the crashing cpu. */
int crashing_cpu = -1;
#endif
+2 −2
Original line number Diff line number Diff line
@@ -588,7 +588,7 @@ void smp_send_debugger_break(void)
}
#endif

#ifdef CONFIG_KEXEC_CORE
#ifdef CONFIG_CRASH_DUMP
void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *))
{
	int cpu;
@@ -631,7 +631,7 @@ void crash_smp_send_stop(void)

	stopped = true;

#ifdef CONFIG_KEXEC_CORE
#ifdef CONFIG_CRASH_DUMP
	if (kexec_crash_image) {
		crash_kexec_prepare();
		return;
Loading