Skip to content

Commit 8d2777d

Browse files
committed
Merge: Update for PowerPC Radix
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/4810 Description: update for PowerPC Radix Build info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=62825538 Tested: Brew build RPMs are verified and issue is resolved. JIRA: https://issues.redhat.com/browse/RHEL-20894 Signed-off-by: avchouha <avchouha@redhat.com> commit 66b2ca0 Author: Michael Ellerman <mpe@ellerman.id.au> Date: Thu May 11 21:42:24 2023 +1000 powerpc/64s/radix: Fix soft dirty tracking 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: b0b5e9b ("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: avchouha <avchouha@redhat.com> Approved-by: Waiman Long <longman@redhat.com> Approved-by: Chris von Recklinghausen <crecklin@redhat.com> Approved-by: Rafael Aquini <raquini@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Rado Vrbovsky <rvrbovsk@redhat.com>
2 parents 2d2632d + f663e74 commit 8d2777d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/powerpc/mm/book3s64/radix_pgtable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,8 +1055,8 @@ void radix__ptep_set_access_flags(struct vm_area_struct *vma, pte_t *ptep,
10551055
pte_t entry, unsigned long address, int psize)
10561056
{
10571057
struct mm_struct *mm = vma->vm_mm;
1058-
unsigned long set = pte_val(entry) & (_PAGE_DIRTY | _PAGE_ACCESSED |
1059-
_PAGE_RW | _PAGE_EXEC);
1058+
unsigned long set = pte_val(entry) & (_PAGE_DIRTY | _PAGE_SOFT_DIRTY |
1059+
_PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);
10601060

10611061
unsigned long change = pte_val(entry) ^ pte_val(*ptep);
10621062
/*

0 commit comments

Comments
 (0)