summaryrefslogtreecommitdiffstats
path: root/arch/s390/mm/cmm.c
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2021-12-07 19:24:00 +0100
committerHeiko Carstens <hca@linux.ibm.com>2021-12-10 16:14:25 +0100
commit69700fb4389839dae84024b39a02cab844651122 (patch)
treee87b12176c9669dcdd688b57cc5d6b0b6b3bf3c4 /arch/s390/mm/cmm.c
parents390/diag: use pfn_to_phys() instead of open coding (diff)
downloadlinux-69700fb4389839dae84024b39a02cab844651122.tar.xz
linux-69700fb4389839dae84024b39a02cab844651122.zip
s390/cmm: add missing virt_to_phys() conversion
diag10_range() expects a pfn, however the current cmm code is shifting a virtual address, instead of a physical address by PAGE_SHIFT bits, which would give a wrong result in case if V!=R. Use virt_to_pfn() to fix this. Note: this currently doesn't fix a real bug, since virtual addresses are indentical to physical ones. Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/mm/cmm.c')
-rw-r--r--arch/s390/mm/cmm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index 2203164b39da..9141ed4c52e9 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -90,7 +90,7 @@ static long cmm_alloc_pages(long nr, long *counter,
} else
free_page((unsigned long) npa);
}
- diag10_range(addr >> PAGE_SHIFT, 1);
+ diag10_range(virt_to_pfn(addr), 1);
pa->pages[pa->index++] = addr;
(*counter)++;
spin_unlock(&cmm_lock);