diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2021-05-26 22:00:05 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-05-28 22:54:27 +1000 |
commit | 5362a4b6ee6136018558ef6b2c4701aa15ebc602 (patch) | |
tree | ae864a9562e6211d32f26ab0608cdf8e40388386 /arch/powerpc/kernel/eeh.c | |
parent | 82123a3d1d5a306fdf50c968a474cc60fe43a80f (diff) | |
download | linux-5362a4b6ee6136018558ef6b2c4701aa15ebc602.tar.gz linux-5362a4b6ee6136018558ef6b2c4701aa15ebc602.tar.bz2 linux-5362a4b6ee6136018558ef6b2c4701aa15ebc602.zip |
powerpc: Fix reverse map real-mode address lookup with huge vmalloc
real_vmalloc_addr() does not currently work for huge vmalloc, which is
what the reverse map can be allocated with for radix host, hash guest.
Extract the hugepage aware equivalent from eeh code into a helper, and
convert existing sites including this one to use it.
Fixes: 8abddd968a30 ("powerpc/64s/radix: Enable huge vmalloc mappings")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210526120005.3432222-1-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/kernel/eeh.c')
-rw-r--r-- | arch/powerpc/kernel/eeh.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index f24cd53ff26e..3bbdcc86d01b 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh.c @@ -346,28 +346,7 @@ void eeh_slot_error_detail(struct eeh_pe *pe, int severity) */ static inline unsigned long eeh_token_to_phys(unsigned long token) { - pte_t *ptep; - unsigned long pa; - int hugepage_shift; - - /* - * We won't find hugepages here(this is iomem). Hence we are not - * worried about _PAGE_SPLITTING/collapse. Also we will not hit - * page table free, because of init_mm. - */ - ptep = find_init_mm_pte(token, &hugepage_shift); - if (!ptep) - return token; - - pa = pte_pfn(*ptep); - - /* On radix we can do hugepage mappings for io, so handle that */ - if (!hugepage_shift) - hugepage_shift = PAGE_SHIFT; - - pa <<= PAGE_SHIFT; - pa |= token & ((1ul << hugepage_shift) - 1); - return pa; + return ppc_find_vmap_phys(token); } /* |