linux/arch
Sourabh Jain 79365026f8 crash: add a new kexec flag for hotplug support
Commit a72bbec70d ("crash: hotplug support for kexec_load()")
introduced a new kexec flag, `KEXEC_UPDATE_ELFCOREHDR`. Kexec tool uses
this flag to indicate to the kernel that it is safe to modify the
elfcorehdr of the kdump image loaded using the kexec_load system call.

However, it is possible that architectures may need to update kexec
segments other then elfcorehdr. For example, FDT (Flatten Device Tree)
on PowerPC. Introducing a new kexec flag for every new kexec segment
may not be a good solution. Hence, a generic kexec flag bit,
`KEXEC_CRASH_HOTPLUG_SUPPORT`, is introduced to share the CPU/Memory
hotplug support intent between the kexec tool and the kernel for the
kexec_load system call.

Now we have two kexec flags that enables crash hotplug support for
kexec_load system call. First is KEXEC_UPDATE_ELFCOREHDR (only used in
x86), and second is KEXEC_CRASH_HOTPLUG_SUPPORT (for all architectures).

To simplify the process of finding and reporting the crash hotplug
support the following changes are introduced.

1. Define arch specific function to process the kexec flags and
   determine crash hotplug support

2. Rename the @update_elfcorehdr member of struct kimage to
   @hotplug_support and populate it for both kexec_load and
   kexec_file_load syscalls, because architecture can update more than
   one kexec segment

3. Let generic function crash_check_hotplug_support report hotplug
   support for loaded kdump image based on value of @hotplug_support

To bring the x86 crash hotplug support in line with the above points,
the following changes have been made:

- Introduce the arch_crash_hotplug_support function to process kexec
  flags and determine crash hotplug support

- Remove the arch_crash_hotplug_[cpu|memory]_support functions

Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Acked-by: Baoquan He <bhe@redhat.com>
Acked-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240326055413.186534-3-sourabhjain@linux.ibm.com
2024-04-23 14:59:01 +10:00
..
alpha Kbuild updates for v6.9 2024-03-21 14:41:00 -07:00
arc - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
arm ARM: prctl: reject PR_SET_MDWE on pre-ARMv6 2024-03-26 11:07:22 -07:00
arm64 Including fixes from bpf, WiFi and netfilter. 2024-03-28 13:09:37 -07:00
csky - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
hexagon hexagon: vmlinux.lds.S: handle attributes section 2024-03-26 11:07:23 -07:00
loongarch LoongArch changes for v6.9 2024-03-22 10:22:45 -07:00
m68k TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07:00
microblaze
mips MIPS: move unselectable FIT_IMAGE_FDT_EPM5 out of the "System type" choice 2024-03-27 01:58:34 +09:00
nios2 - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
openrisc OpenRISC updates for 6.9 2024-03-14 15:53:10 -07:00
parisc prctl: generalize PR_SET_MDWE support check to be per-arch 2024-03-26 11:07:22 -07:00
powerpc powerpc updates for 6.9 #2 2024-03-23 09:21:26 -07:00
riscv Including fixes from bpf, WiFi and netfilter. 2024-03-28 13:09:37 -07:00
s390 bpf-for-netdev 2024-03-26 12:55:18 +01:00
sh sh updates for v6.9 2024-03-21 10:13:47 -07:00
sparc This includes the following changes related to sparc for v6.9: 2024-03-15 12:47:21 -07:00
um Devicetree updates for v6.9: 2024-03-15 12:37:59 -07:00
x86 crash: add a new kexec flag for hotplug support 2024-04-23 14:59:01 +10:00
xtensa - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
.gitignore
Kconfig hardening fixes for v6.9-rc1 2024-03-23 08:43:21 -07:00