diff options
| author | Alexander Gordeev <[email protected]> | 2024-09-30 12:21:19 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2024-10-09 19:47:19 +0000 |
| commit | 3d5854d75e3187147613130561b58f0b06166172 (patch) | |
| tree | acaf406a23a546d445a542e2573f6cefaf4154d8 /rust/helpers/build_assert.c | |
| parent | selftests/mm: fix incorrect buffer->mirror size in hmm2 double_map test (diff) | |
| download | kernel-3d5854d75e3187147613130561b58f0b06166172.tar.gz kernel-3d5854d75e3187147613130561b58f0b06166172.zip | |
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/[email protected]
Signed-off-by: Alexander Gordeev <[email protected]>
Suggested-by: Heiko Carstens <[email protected]>
Cc: Vasily Gorbik <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'rust/helpers/build_assert.c')
0 files changed, 0 insertions, 0 deletions
