]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: pgtable: Ensure dirty bit is preserved across pte_wrprotect()
authorWill Deacon <will@kernel.org>
Fri, 20 Nov 2020 13:57:48 +0000 (13:57 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Dec 2020 07:34:40 +0000 (08:34 +0100)
commit94bd4c7952923b61acc4b44aeedaeca43debcd0b
tree431e1066131a329307f152a1e1e4d471dae2689e
parenta2e5f53c7ef0952e4f0c627628b1109a45fb2525
arm64: pgtable: Ensure dirty bit is preserved across pte_wrprotect()

commit ff1712f953e27f0b0718762ec17d0adb15c9fd0b upstream.

With hardware dirty bit management, calling pte_wrprotect() on a writable,
dirty PTE will lose the dirty state and return a read-only, clean entry.

Move the logic from ptep_set_wrprotect() into pte_wrprotect() to ensure that
the dirty bit is preserved for writable entries, as this is required for
soft-dirty bit management if we enable it in the future.

Cc: <stable@vger.kernel.org>
Fixes: 2f4b829c625e ("arm64: Add support for hardware updates of the access and dirty pte bits")
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20201120143557.6715-3-will@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/pgtable.h