From: "Huang, Ying" <ying.huang@linux.alibaba.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@redhat.com>,
linux-kernel@vger.kernel.org,
Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: [PATCH] mm/debug_vm_pgtable: Add [pte|pmd]_mkwrite_novma() tests
Date: Tue, 21 Oct 2025 11:54:03 +0800 [thread overview]
Message-ID: <875xc8ap0k.fsf@DESKTOP-5N7EMDA> (raw)
In-Reply-To: <20251021024424.2390325-1-anshuman.khandual@arm.com> (Anshuman Khandual's message of "Tue, 21 Oct 2025 03:44:24 +0100")
Anshuman Khandual <anshuman.khandual@arm.com> writes:
> Add some [pte|pmd]_mkwrite_novma() relevant tests.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Huang Ying <ying.huang@linux.alibaba.com>
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> Suggested-by: Catalin Marinas <catalin.marinas@arm.com>
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
> These tests clear on arm64 platform after the following recent patch.
>
> https://lore.kernel.org/all/20251015023712.46598-1-ying.huang@linux.alibaba.com/
>
> mm/debug_vm_pgtable.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c
> index 830107b6dd08..b9cae1580782 100644
> --- a/mm/debug_vm_pgtable.c
> +++ b/mm/debug_vm_pgtable.c
> @@ -102,6 +102,11 @@ static void __init pte_basic_tests(struct pgtable_debug_args *args, int idx)
> WARN_ON(pte_write(pte_wrprotect(pte_mkwrite(pte, args->vma))));
> WARN_ON(pte_dirty(pte_wrprotect(pte_mkclean(pte))));
> WARN_ON(!pte_dirty(pte_wrprotect(pte_mkdirty(pte))));
> +
> + WARN_ON(pte_dirty(pte_mkwrite_novma(pte_mkclean(pte))));
Why not use: pte_mkwrite(pte, args->vma)?
Maybe add
WARN_ON(!pte_dirty(pte_mkwrite_novma(pte_mkdirty(pte))));
> + WARN_ON(!pte_write(pte_mkdirty(pte_mkwrite_novma(pte))));
> + WARN_ON(!pte_write(pte_mkwrite_novma(pte_wrprotect(pte))));
> + WARN_ON(pte_write(pte_wrprotect(pte_mkwrite_novma(pte))));
> }
>
> static void __init pte_advanced_tests(struct pgtable_debug_args *args)
> @@ -195,6 +200,11 @@ static void __init pmd_basic_tests(struct pgtable_debug_args *args, int idx)
> WARN_ON(pmd_write(pmd_wrprotect(pmd_mkwrite(pmd, args->vma))));
> WARN_ON(pmd_dirty(pmd_wrprotect(pmd_mkclean(pmd))));
> WARN_ON(!pmd_dirty(pmd_wrprotect(pmd_mkdirty(pmd))));
> +
> + WARN_ON(pmd_dirty(pmd_mkwrite_novma(pmd_mkclean(pmd))));
> + WARN_ON(!pmd_write(pmd_mkdirty(pmd_mkwrite_novma(pmd))));
> + WARN_ON(!pmd_write(pmd_mkwrite_novma(pmd_wrprotect(pmd))));
> + WARN_ON(pmd_write(pmd_wrprotect(pmd_mkwrite_novma(pmd))));
> /*
> * A huge page does not point to next level page table
> * entry. Hence this must qualify as pmd_bad().
---
Best Regards,
Huang, Ying
next prev parent reply other threads:[~2025-10-21 3:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-21 2:44 [PATCH] mm/debug_vm_pgtable: Add [pte|pmd]_mkwrite_novma() tests Anshuman Khandual
2025-10-21 3:54 ` Huang, Ying [this message]
2025-10-21 7:48 ` Anshuman Khandual
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875xc8ap0k.fsf@DESKTOP-5N7EMDA \
--to=ying.huang@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.