linux/arch
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
..
alpha move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
arc move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
arm move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
arm64 ARM64: 2024-10-06 10:53:28 -07:00
csky
hexagon hexagon: vdso: Fix build failure 2024-09-23 08:17:50 -07:00
loongarch move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
m68k m68knommu: updates and fixes for v6.12 2024-09-24 10:48:44 -07:00
microblaze move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
mips move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
nios2 move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
openrisc
parisc move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
powerpc powerpc fixes for 6.12 #3 2024-10-06 10:43:00 -07:00
riscv riscv: Fix kernel stack size when KASAN is enabled 2024-10-01 13:08:11 -07:00
s390 fs/proc/kcore.c: allow translation of physical memory addresses 2024-10-09 12:47:19 -07:00
sh move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
sparc move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
um move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
x86 ARM64: 2024-10-06 10:53:28 -07:00
xtensa move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
.gitignore
Kconfig cfi: encode cfi normalized integers + kasan/gcov bug in Kconfig 2024-09-26 21:27:27 +02:00