linux/arch
David Hildenbrand cc5f2704c9 proc/vmcore: convert oldmem_pfn_is_ram callback to more generic vmcore callbacks
Let's support multiple registered callbacks, making sure that
registering vmcore callbacks cannot fail.  Make the callback return a
bool instead of an int, handling how to deal with errors internally.
Drop unused HAVE_OLDMEM_PFN_IS_RAM.

We soon want to make use of this infrastructure from other drivers:
virtio-mem, registering one callback for each virtio-mem device, to
prevent reading unplugged virtio-mem memory.

Handle it via a generic vmcore_cb structure, prepared for future
extensions: for example, once we support virtio-mem on s390x where the
vmcore is completely constructed in the second kernel, we want to detect
and add plugged virtio-mem memory ranges to the vmcore in order for them
to get dumped properly.

Handle corner cases that are unexpected and shouldn't happen in sane
setups: registering a callback after the vmcore has already been opened
(warn only) and unregistering a callback after the vmcore has already been
opened (warn and essentially read only zeroes from that point on).

Link: https://lkml.kernel.org/r/20211005121430.30136-6-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-11-09 10:02:48 -08:00
..
alpha memblock: use memblock_free for freeing virtual pointers 2021-11-06 13:30:41 -07:00
arc memblock: allow to specify flags with memblock_add_node() 2021-11-06 13:30:42 -07:00
arm memblock: rename memblock_free to memblock_phys_free 2021-11-06 13:30:41 -07:00
arm64 memblock: rename memblock_free to memblock_phys_free 2021-11-06 13:30:41 -07:00
csky csky: Make HAVE_TCM depend on !COMPILE_TEST 2021-10-16 07:20:12 +08:00
h8300 Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
hexagon Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
ia64 memblock: allow to specify flags with memblock_add_node() 2021-11-06 13:30:42 -07:00
m68k memblock: allow to specify flags with memblock_add_node() 2021-11-06 13:30:42 -07:00
microblaze Microblaze patches for 5.15-rc1 2021-09-08 16:02:13 -07:00
mips memblock: allow to specify flags with memblock_add_node() 2021-11-06 13:30:42 -07:00
nds32 ftrace/nds32: Update the proto for ftrace_trace_function to match ftrace_stub 2021-10-27 13:00:17 -04:00
nios2 nios2: Make NIOS2_DTB_SOURCE_BOOL depend on !COMPILE_TEST 2021-10-27 09:29:07 -05:00
openrisc Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
parisc asm-generic: build fixes for v5.15 2021-10-08 11:57:54 -07:00
powerpc mm: remove HARDENED_USERCOPY_FALLBACK 2021-11-06 13:30:43 -07:00
riscv memblock: use memblock_free for freeing virtual pointers 2021-11-06 13:30:41 -07:00
s390 memblock: allow to specify flags with memblock_add_node() 2021-11-06 13:30:42 -07:00
sh memblock: rename memblock_free to memblock_phys_free 2021-11-06 13:30:41 -07:00
sparc memblock: use memblock_free for freeing virtual pointers 2021-11-06 13:30:41 -07:00
um memblock: use memblock_free for freeing virtual pointers 2021-11-06 13:30:41 -07:00
x86 proc/vmcore: convert oldmem_pfn_is_ram callback to more generic vmcore callbacks 2021-11-09 10:02:48 -08:00
xtensa xtensa: xtfpga: Try software restart before simulating CPU reset 2021-10-05 12:19:05 -07:00
.gitignore
Kconfig Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00