android_kernel_xiaomi_sm8450/arch
Michael Ellerman 710dee5701 powerpc/64s/radix: Fix soft dirty tracking
commit 66b2ca086210732954a7790d63d35542936fc664 upstream.

It was reported that soft dirty tracking doesn't work when using the
Radix MMU.

The tracking is supposed to work by clearing the soft dirty bit for a
mapping and then write protecting the PTE. If/when the page is written
to, a page fault occurs and the soft dirty bit is added back via
pte_mkdirty(). For example in wp_page_reuse():

	entry = maybe_mkwrite(pte_mkdirty(entry), vma);
	if (ptep_set_access_flags(vma, vmf->address, vmf->pte, entry, 1))
		update_mmu_cache(vma, vmf->address, vmf->pte);

Unfortunately on radix _PAGE_SOFTDIRTY is being dropped by
radix__ptep_set_access_flags(), called from ptep_set_access_flags(),
meaning the soft dirty bit is not set even though the page has been
written to.

Fix it by adding _PAGE_SOFTDIRTY to the set of bits that are able to be
changed in radix__ptep_set_access_flags().

Fixes: b0b5e9b130 ("powerpc/mm/radix: Add radix pte #defines")
Cc: stable@vger.kernel.org # v4.7+
Reported-by: Dan Horák <dan@danny.cz>
Link: https://lore.kernel.org/r/20230511095558.56663a50f86bdc4cd97700b7@danny.cz
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230511114224.977423-1-mpe@ellerman.id.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-30 12:57:55 +01:00
..
alpha alpha: fix R_ALPHA_LITERAL reloc for large modules 2023-03-17 08:45:14 +01:00
arc arch: setup PF_IO_WORKER threads like PF_KTHREAD 2023-01-04 11:39:22 +01:00
arm ARM: 9296/1: HP Jornada 7XX: fix kernel-doc warnings 2023-05-30 12:57:45 +01:00
arm64 arm64: dts: qcom: msm8996: Add missing DWC3 quirks 2023-05-30 12:57:47 +01:00
c6x c6x: add support for TIF_NOTIFY_SIGNAL 2023-01-04 11:39:21 +01:00
csky csky: Fix function name in csky_alignment() and die() 2023-02-01 08:23:20 +01:00
h8300 h8300: Fix build errors from do_exit() to make_task_dead() transition 2023-02-01 08:23:19 +01:00
hexagon hexagon: Fix function name in die() 2023-02-01 08:23:19 +01:00
ia64 ia64: fix an addr to taddr in huge_pte_offset() 2023-05-17 11:48:06 +02:00
m68k m68k: Only force 030 bus error if PC not in exception table 2023-04-05 11:23:38 +02:00
microblaze exit: Add and use make_task_dead. 2023-02-01 08:23:19 +01:00
mips MIPS: fw: Allow firmware to pass a empty env 2023-05-17 11:47:33 +02:00
nds32 exit: Add and use make_task_dead. 2023-02-01 08:23:19 +01:00
nios2 exit: Add and use make_task_dead. 2023-02-01 08:23:19 +01:00
openrisc openrisc: Properly store r31 to pt_regs on unhandled exceptions 2023-05-17 11:48:03 +02:00
parisc parisc: Fix argument pointer in real64_call_asm() 2023-05-17 11:47:35 +02:00
powerpc powerpc/64s/radix: Fix soft dirty tracking 2023-05-30 12:57:55 +01:00
riscv riscv: Handle zicsr/zifencei issues between clang and binutils 2023-04-20 12:10:28 +02:00
s390 s390/ptrace: fix PTRACE_GET_LAST_BREAK error handling 2023-04-26 11:27:37 +02:00
sh sh: nmi_debug: fix return value of __setup handler 2023-05-17 11:48:15 +02:00
sparc sparc: allow PM configs for sparc32 COMPILE_TEST 2023-03-11 16:39:40 +01:00
um UML: define RUNTIME_DISCARD_EXIT 2023-03-17 08:45:17 +01:00
x86 KVM: x86: move guest_pv_has out of user_access section 2023-05-17 11:48:19 +02:00
xtensa xtensa: fix KASAN report for show_stack 2023-04-05 11:23:51 +02:00
.gitignore
Kconfig arch/cc: Introduce a function to check for confidential computing features 2021-11-18 14:04:32 +01:00