linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chunyan Zhang <zhang.lyra@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	 Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-mm@kvack.org, Peter Xu <peterx@redhat.com>,
	 Arnd Bergmann <arnd@arndb.de>,
	David Hildenbrand <david@redhat.com>,
	 Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>,
	 Vlastimil Babka <vbabka@suse.cz>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	 Michal Hocko <mhocko@suse.com>,
	Axel Rasmussen <axelrasmussen@google.com>,
	 Yuanchu Xie <yuanchu@google.com>,
	linux-riscv@lists.infradead.org,
	 Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>,
	devicetree@vger.kernel.org,  Conor Dooley <conor@kernel.org>,
	Deepak Gupta <debug@rivosinc.com>,
	Ved Shanbhogue <ved@rivosinc.com>,
	 linux-fsdevel@vger.kernel.org,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	 linux-kernel@vger.kernel.org,
	Chunyan Zhang <zhangchunyan@iscas.ac.cn>
Subject: Re: [PATCH V15 0/6] mm: Add soft-dirty and uffd-wp support for RISC-V
Date: Tue, 18 Nov 2025 16:16:30 +0800	[thread overview]
Message-ID: <CAAfSe-v6+Gc8ujv3m3LdBPk+rGSqmz44RheoNqGJcXjOq3vU9A@mail.gmail.com> (raw)
In-Reply-To: <20251113072806.795029-1-zhangchunyan@iscas.ac.cn>

Hi Andrew,

On Thu, 13 Nov 2025 at 15:28, Chunyan Zhang <zhangchunyan@iscas.ac.cn> wrote:
>
> This patchset adds support for Svrsw60t59b [1] extension which is ratified now,
> also add soft dirty and userfaultfd write protect tracking for RISC-V.
>
> The patches 1 and 2 add macros to allow architectures to define their own checks
> if the soft-dirty / uffd_wp PTE bits are available, in other words for RISC-V,
> the Svrsw60t59b extension is supported on which device the kernel is running.
> Also patch1-2 are removing "ifdef CONFIG_MEM_SOFT_DIRTY"
> "ifdef CONFIG_HAVE_ARCH_USERFAULTFD_WP" and
> "ifdef CONFIG_PTE_MARKER_UFFD_WP" in favor of checks which if not overridden by
> the architecture, no change in behavior is expected.
>
> This patchset has been tested with kselftest mm suite in which soft-dirty,
> madv_populate, test_unmerge_uffd_wp, and uffd-unit-tests run and pass,
> and no regressions are observed in any of the other tests.
>
> This patchset applies on the mm/mm-new branch commit ea53cb52f919
> ("mm/vmalloc: cleanup gfp flag use in new_vmap_block()")
>
> [1] https://github.com/riscv-non-isa/riscv-iommu/pull/543
>

Can this patchset go through the mm tree if there's no more comments?

Thanks,
Chunyan

> V15:
> - Rebased on to the latest mm-new branch;
> - Removed a redundant space;
> - Added Conor's Acked-by.
>
> V14: https://lore.kernel.org/all/20250918083731.1820327-1-zhangchunyan@iscas.ac.cn/
> - Fix indent inssues in userfaultfd_k.h;
> - Some descriptions and comments minor changes.
>
> V13: https://lore.kernel.org/all/20250917033703.1695933-1-zhangchunyan@iscas.ac.cn/
> - Rebase on mm-new branch;
> - Fixed build errors;
> - Add more exactly descriptions in commit message in patch 1-2;
> - Replace '__always_inline' with 'inline' for uffd_supports_wp_marker();
> - Add Svrsw60t59b description to the extensions dt-binding in patch 6.
>
> V12: https://lore.kernel.org/all/20250915101343.1449546-1-zhangchunyan@iscas.ac.cn/
> - Rename the macro API to pgtable_supports_soft_dirty/uffd_wp();
> - Add changes for setting VM_SOFTDIRTY flags conditionally;
> - Drop changes to show_smap_vma_flags();
> - Drop CONFIG_MEM_SOFT_DIRTY compile condition of clear_soft_dirty() and clear_soft_dirty_pmd();
> - Fix typos;
> - Add uffd_supports_wp_marker() and drop some ifdef CONFIG_PTE_MARKER_UFFD_WP.
>
> V11: https://lore.kernel.org/all/20250911095602.1130290-1-zhangchunyan@iscas.ac.cn/
> - Rename the macro API to pgtable_*_supported() since we also have PMD support;
> - Change the default implementations of two macros, make CONFIG_MEM_SOFT_DIRTY or
>   CONFIG_HAVE_ARCH_USERFAULTFD_WP part of the macros;
> - Correct the order of insertion of RISCV_ISA_EXT_SVRSW60T59B;
> - Rephrase some comments.
>
> V10: https://lore.kernel.org/all/20250909095611.803898-1-zhangchunyan@iscas.ac.cn/
> - Fixed the issue reported by kernel test irobot <lkp@intel.com>.
>
> V9: https://lore.kernel.org/all/20250905103651.489197-1-zhangchunyan@iscas.ac.cn/
> - Add pte_soft_dirty/uffd_wp_available() API to allow dynamically checking
>   if the PTE bit is available for the platform on which the kernel is running.
>
> V8: https://lore.kernel.org/all/20250619065232.1786470-1-zhangchunyan@iscas.ac.cn/)
> - Rebase on v6.16-rc1;
> - Add dependencies to MMU && 64BIT for RISCV_ISA_SVRSW60T59B;
> - Use 'Svrsw60t59b' instead of 'SVRSW60T59B' in Kconfig help paragraph;
> - Add Alex's Reviewed-by tag in patch 1.
>
> V7: https://lore.kernel.org/all/20250409095320.224100-1-zhangchunyan@iscas.ac.cn/
> - Add Svrsw60t59b [1] extension support;
> - Have soft-dirty and uffd-wp depending on the Svrsw60t59b extension to
>   avoid crashes for the hardware which don't have this extension.
>
> V6: https://lore.kernel.org/all/20250408084301.68186-1-zhangchunyan@iscas.ac.cn/
> - Changes to use bits 59-60 which are supported by extension Svrsw60t59b
>   for soft dirty and userfaultfd write protect tracking.
>
> V5: https://lore.kernel.org/all/20241113095833.1805746-1-zhangchunyan@iscas.ac.cn/
> - Fixed typos and corrected some words in Kconfig and commit message;
> - Removed pte_wrprotect() from pte_swp_mkuffd_wp(), this is a copy-paste
>   error;
> - Added Alex's Reviewed-by tag in patch 2.
>
> V4: https://lore.kernel.org/all/20240830011101.3189522-1-zhangchunyan@iscas.ac.cn/
> - Added bit(4) descriptions into "Format of swap PTE".
>
> V3: https://lore.kernel.org/all/20240805095243.44809-1-zhangchunyan@iscas.ac.cn/
> - Fixed the issue reported by kernel test irobot <lkp@intel.com>.
>
> V2: https://lore.kernel.org/all/20240731040444.3384790-1-zhangchunyan@iscas.ac.cn/
> - Add uffd-wp supported;
> - Make soft-dirty uffd-wp and devmap mutually exclusive which all use
>   the same PTE bit;
> - Add test results of CRIU in the cover-letter.
>
> Chunyan Zhang (6):
>   mm: softdirty: Add pgtable_supports_soft_dirty()
>   mm: userfaultfd: Add pgtable_supports_uffd_wp()
>   riscv: Add RISC-V Svrsw60t59b extension support
>   riscv: mm: Add soft-dirty page tracking support
>   riscv: mm: Add userfaultfd write-protect support
>   dt-bindings: riscv: Add Svrsw60t59b extension description
>
>  .../devicetree/bindings/riscv/extensions.yaml |   6 +
>  arch/riscv/Kconfig                            |  16 ++
>  arch/riscv/include/asm/hwcap.h                |   1 +
>  arch/riscv/include/asm/pgtable-bits.h         |  37 +++++
>  arch/riscv/include/asm/pgtable.h              | 143 +++++++++++++++++-
>  arch/riscv/kernel/cpufeature.c                |   1 +
>  fs/proc/task_mmu.c                            |  15 +-
>  fs/userfaultfd.c                              |  22 +--
>  include/asm-generic/pgtable_uffd.h            |  17 +++
>  include/linux/mm.h                            |   3 +
>  include/linux/mm_inline.h                     |   8 +-
>  include/linux/pgtable.h                       |  12 ++
>  include/linux/userfaultfd_k.h                 |  69 +++++----
>  mm/debug_vm_pgtable.c                         |  10 +-
>  mm/huge_memory.c                              |  13 +-
>  mm/internal.h                                 |   2 +-
>  mm/memory.c                                   |   6 +-
>  mm/mmap.c                                     |   6 +-
>  mm/mremap.c                                   |  13 +-
>  mm/userfaultfd.c                              |  10 +-
>  mm/vma.c                                      |   6 +-
>  mm/vma_exec.c                                 |   5 +-
>  22 files changed, 337 insertions(+), 84 deletions(-)
>
> --
> 2.34.1
>


      parent reply	other threads:[~2025-11-18  8:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13  7:28 Chunyan Zhang
2025-11-13  7:28 ` [PATCH V15 1/6] mm: softdirty: Add pgtable_supports_soft_dirty() Chunyan Zhang
2025-11-21 16:57   ` Lorenzo Stoakes
2025-11-21 18:36     ` Andrew Morton
2025-11-13  7:28 ` [PATCH V15 2/6] mm: userfaultfd: Add pgtable_supports_uffd_wp() Chunyan Zhang
2025-11-13  7:28 ` [PATCH V15 3/6] riscv: Add RISC-V Svrsw60t59b extension support Chunyan Zhang
2025-11-13  7:28 ` [PATCH V15 4/6] riscv: mm: Add soft-dirty page tracking support Chunyan Zhang
2025-11-13  7:28 ` [PATCH V15 5/6] riscv: mm: Add userfaultfd write-protect support Chunyan Zhang
2025-11-13  7:28 ` [PATCH V15 6/6] dt-bindings: riscv: Add Svrsw60t59b extension description Chunyan Zhang
2025-11-18  8:16 ` Chunyan Zhang [this message]

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=CAAfSe-v6+Gc8ujv3m3LdBPk+rGSqmz44RheoNqGJcXjOq3vU9A@mail.gmail.com \
    --to=zhang.lyra@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=arnd@arndb.de \
    --cc=axelrasmussen@google.com \
    --cc=brauner@kernel.org \
    --cc=conor@kernel.org \
    --cc=david@redhat.com \
    --cc=debug@rivosinc.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jack@suse.cz \
    --cc=krzk+dt@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=peterx@redhat.com \
    --cc=robh@kernel.org \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=ved@rivosinc.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yuanchu@google.com \
    --cc=zhangchunyan@iscas.ac.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox