]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/32: Add warning on misaligned copy_page() or clear_page()
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 16 Aug 2019 07:52:20 +0000 (07:52 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 20 Aug 2019 11:22:15 +0000 (21:22 +1000)
commiteb1c74cb36598ce57e8e8331697567b8ef549561
tree4f63c162df91aa9231a46dcf1f4abc83b3cba0a5
parent2334fa77e7204e287201d84b6e5e12dcfbe85dc9
powerpc/32: Add warning on misaligned copy_page() or clear_page()

copy_page() and clear_page() expect page aligned destination, and
use dcbz instruction to clear entire cache lines based on the
assumption that the destination is cache aligned.

As shown during analysis of a bug in BTRFS filesystem, a misaligned
copy_page() can create bugs that are difficult to locate (see Link).

Add an explicit WARNING when copy_page() or clear_page() are called
with misaligned destination.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=204371
Link: https://lore.kernel.org/r/c6cea38f90480268d439ca44a645647e260fff09.1565941808.git.christophe.leroy@c-s.fr
arch/powerpc/include/asm/page_32.h
arch/powerpc/kernel/misc_32.S