]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
powerpc/powernv/memtrace: Fix dcache flushing
authorSandipan Das <sandipan@linux.ibm.com>
Sat, 1 May 2021 16:02:54 +0000 (21:32 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:56:29 +0000 (10:56 +0200)
[ Upstream commit b910fcbada9721c21f1d59ab59e07e8e354c23cc ]

Trace memory is cleared and the corresponding dcache lines
are flushed after allocation. However, this should not be
done using the PFN. This adds the missing conversion to
virtual address.

Fixes: 2ac02e5ecec0 ("powerpc/mm: Remove dcache flush from memory remove.")
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210501160254.1179831-1-sandipan@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/platforms/powernv/memtrace.c

index 019669eb21d271e51668878246461e582928146c..4ab7c3ef5826c0a769ce0c4fb70f0df0de46eb63 100644 (file)
@@ -88,8 +88,8 @@ static void memtrace_clear_range(unsigned long start_pfn,
         * Before we go ahead and use this range as cache inhibited range
         * flush the cache.
         */
-       flush_dcache_range_chunked(PFN_PHYS(start_pfn),
-                                  PFN_PHYS(start_pfn + nr_pages),
+       flush_dcache_range_chunked((unsigned long)pfn_to_kaddr(start_pfn),
+                                  (unsigned long)pfn_to_kaddr(start_pfn + nr_pages),
                                   FLUSH_CHUNK_SIZE);
 }