linux/arch/s390
Alexander Gordeev 3d5854d75e fs/proc/kcore.c: allow translation of physical memory addresses
When /proc/kcore is read an attempt to read the first two pages results in
HW-specific page swap on s390 and another (so called prefix) pages are
accessed instead.  That leads to a wrong read.

Allow architecture-specific translation of memory addresses using
kc_xlate_dev_mem_ptr() and kc_unxlate_dev_mem_ptr() callbacks similarily
to /dev/mem xlate_dev_mem_ptr() and unxlate_dev_mem_ptr() callbacks.  That
way an architecture can deal with specific physical memory ranges.

Re-use the existing /dev/mem callback implementation on s390, which
handles the described prefix pages swapping correctly.

For other architectures the default callback is basically NOP.  It is
expected the condition (vaddr == __va(__pa(vaddr))) always holds true for
KCORE_RAM memory type.

Link: https://lkml.kernel.org/r/20240930122119.1651546-1-agordeev@linux.ibm.com
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Suggested-by: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-10-09 12:47:19 -07:00
..
appldata sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
boot s390 updates for 6.12 merge window 2024-09-21 09:02:54 -07:00
configs x86: 2024-09-28 09:20:14 -07:00
crypto This push fixes the following issues: 2024-09-24 10:46:54 -07:00
hypfs [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
include fs/proc/kcore.c: allow translation of physical memory addresses 2024-10-09 12:47:19 -07:00
kernel more s390 updates for 6.12 merge window 2024-09-28 09:11:46 -07:00
kvm KVM: s390: Fix SORTL and DFLTCC instruction format error in __insn32_query 2024-08-19 07:51:14 +00:00
lib s390/alternatives: Rework to allow for callbacks 2024-07-23 16:02:31 +02:00
mm memblock: updates for 6.12-rc1 2024-09-25 11:35:19 -07:00
net
pci [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
purgatory
tools s390 updates for 6.12 merge window 2024-09-21 09:02:54 -07:00
Kbuild
Kconfig s390 updates for 6.12 merge window 2024-09-21 09:02:54 -07:00
Kconfig.debug
Makefile
Makefile.postlink s390/build: Avoid relocation information in final vmlinux 2024-08-27 20:16:48 +02:00