public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V5 0/3] riscv: mm: Add soft-dirty and uffd-wp support
@ 2024-11-13  9:58 Chunyan Zhang
  2024-11-13  9:58 ` [PATCH V5 1/3] riscv: mm: Prepare for reusing PTE RSW bit(9) Chunyan Zhang
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Chunyan Zhang @ 2024-11-13  9:58 UTC (permalink / raw)
  To: Palmer Dabbelt, Albert Ou, Paul Walmsley, Alexandre Ghiti,
	Andrew Morton
  Cc: linux-riscv, linux-kernel, Chunyan Zhang

This patchset adds soft dirty and userfaultfd write protect tracking 
support for RISC-V.

As described in the patches, we are trying to utilize only one free PTE
bit(9) to support three kernel features (devmap, soft-dirty, uffd-wp).
Users cannot have them supported at the same time (have to select
one when building the kernel).

This patchset has been tested with:
1) The 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.

2) CRIU:
- 'criu check --feature mem_dirty_track' returns supported;
- incremental_dumps[1] and simple_loop [2] dump and restores work fine;
- zdtm test suite can run under host mode.

This patchset applies on top of v6.12-rc7.

V5:
- 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:
- Added bit(4) descriptions into "Format of swap PTE".

V3:
- Fixed the issue reported by kernel test irobot <lkp@intel.com>.

V1 -> V2:
- 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.

[1] https://www.criu.org/Incremental_dumps
[2] https://asciinema.org/a/232445

Chunyan Zhang (3):
  riscv: mm: Prepare for reusing PTE RSW bit(9)
  riscv: mm: Add soft-dirty page tracking support
  riscv: mm: Add uffd write-protect support

 arch/riscv/Kconfig                    |  34 ++++++-
 arch/riscv/include/asm/pgtable-64.h   |   2 +-
 arch/riscv/include/asm/pgtable-bits.h |  31 ++++++
 arch/riscv/include/asm/pgtable.h      | 133 +++++++++++++++++++++++++-
 4 files changed, 197 insertions(+), 3 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-03-31  2:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-13  9:58 [PATCH V5 0/3] riscv: mm: Add soft-dirty and uffd-wp support Chunyan Zhang
2024-11-13  9:58 ` [PATCH V5 1/3] riscv: mm: Prepare for reusing PTE RSW bit(9) Chunyan Zhang
2025-01-30  8:42   ` Björn Töpel
2025-02-05  0:19     ` Alistair Popple
2025-02-11  1:20     ` Chunyan Zhang
2025-02-11  4:01       ` Deepak Gupta
2025-02-11  8:05         ` Chunyan Zhang
2025-02-20 18:23           ` Deepak Gupta
2024-11-13  9:58 ` [PATCH V5 2/3] riscv: mm: Add soft-dirty page tracking support Chunyan Zhang
2024-11-13  9:58 ` [PATCH V5 3/3] riscv: mm: Add uffd write-protect support Chunyan Zhang
2025-01-29  8:12 ` [PATCH V5 0/3] riscv: mm: Add soft-dirty and uffd-wp support Deepak Gupta
2025-03-30 13:51 ` Alexandre Ghiti
2025-03-31  2:00   ` Chunyan Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox