public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/7] riscv: add Svnapot-based contiguous PTE support
@ 2026-04-21  9:24 Yunhui Cui
  2026-04-21  9:24 ` [PATCH 1/7] riscv: mm: split raw and public PTE helpers Yunhui Cui
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Yunhui Cui @ 2026-04-21  9:24 UTC (permalink / raw)
  To: akpm, alex, andrew+kernel, andreyknvl, anup, aou, apopple, ardb,
	atish.patra, baolin.wang, cuiyunhui, david, debug,
	djordje.todorovic, dvyukov, elver, glider, ilias.apalodimas,
	junhui.liu, kasan-dev, kees, kevin.brodsky, kvm-riscv, kvm,
	linux-efi, linux-kernel, linux-riscv, liu.xuemei1, ljs, namcao,
	osalvador, palmer, pjw, rmclure, rostedt, rppt, ryabinin.a.a,
	surenb, vincenzo.frascino, vishal.moola, wangruikang,
	zhangchunyan

Hi,

First of all, thanks to Ryan Roberts for the work on mTHP and
Contiguous PTE support on arm64. That work provides a very useful
reference for reducing page fault overhead and TLB pressure for
large but still PTE-mapped memory ranges.

This series adds Svnapot-based contiguous PTE support for RISC-V.

To achieve similar benefits on RISC-V, this series introduces a
Contiguous-PTE-like mechanism built on top of the Svnapot extension.
The intent is to preserve the core-MM PTE semantics while allowing
RISC-V to transparently fold eligible base-page mappings into
Svnapot-encoded contiguous mappings when possible.

The series splits the low-level raw PTE helpers from the public
core-MM-facing PTE helpers, so that:

-the __xxx helpers expose the raw hardware PTE encoding,
-the xxx helpers provide the semantic view expected by core MM,
-and Svnapot-aware handling is centralized in the public wrapper layer.

Performance results:

-Compared with the native 4K base-page setup, the mTHP + PTE fold
scheme improves overall SPEC CPU performance by about 2%.
-The native 4K page setup shows higher memory access latency, and its
memory read latency is about 12% higher than this scheme.

Yunhui Cui (7):
  riscv: mm: split raw and public PTE helpers
  riscv/kvm: use raw PTE helpers for G-stage leaf PTEs
  riscv: mm: add Svnapot-aware contiguous PTE wrappers
  riscv: hugetlb: switch NAPOT mappings to raw PTE helpers
  riscv: add contiguous PTE range clearing helpers
  riscv: batch write-protect contiguous PTE ranges
  riscv: add Svnapot-aware pte_batch_hint support

 arch/riscv/include/asm/kfence.h  |   4 +-
 arch/riscv/include/asm/pgtable.h | 455 +++++++++++++++++++++-
 arch/riscv/kernel/efi.c          |   4 +-
 arch/riscv/kernel/hibernate.c    |   2 +-
 arch/riscv/kvm/gstage.c          |  48 +--
 arch/riscv/kvm/mmu.c             |   4 +-
 arch/riscv/mm/Makefile           |   1 +
 arch/riscv/mm/contpte.c          | 650 +++++++++++++++++++++++++++++++
 arch/riscv/mm/fault.c            |   4 +-
 arch/riscv/mm/hugetlbpage.c      |  55 ++-
 arch/riscv/mm/init.c             |   8 +-
 arch/riscv/mm/kasan_init.c       |  14 +-
 arch/riscv/mm/pageattr.c         |  12 +-
 arch/riscv/mm/pgtable.c          |  58 ++-
 14 files changed, 1222 insertions(+), 97 deletions(-)
 create mode 100644 arch/riscv/mm/contpte.c

-- 
2.39.5


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

end of thread, other threads:[~2026-04-21 11:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-21  9:24 [PATCH v1 0/7] riscv: add Svnapot-based contiguous PTE support Yunhui Cui
2026-04-21  9:24 ` [PATCH 1/7] riscv: mm: split raw and public PTE helpers Yunhui Cui
2026-04-21  9:24 ` [PATCH 2/7] riscv/kvm: use raw PTE helpers for G-stage leaf PTEs Yunhui Cui
2026-04-21  9:24 ` [PATCH 3/7] riscv: mm: add Svnapot-aware contiguous PTE wrappers Yunhui Cui
2026-04-21  9:24 ` [PATCH 4/7] riscv: hugetlb: switch NAPOT mappings to raw PTE helpers Yunhui Cui
2026-04-21  9:24 ` [PATCH 5/7] riscv: add contiguous PTE range clearing helpers Yunhui Cui
2026-04-21  9:24 ` [PATCH 6/7] riscv: batch write-protect contiguous PTE ranges Yunhui Cui
2026-04-21  9:24 ` [PATCH 7/7] riscv: add Svnapot-aware pte_batch_hint support Yunhui Cui
2026-04-21 11:28 ` [PATCH v1 0/7] riscv: add Svnapot-based contiguous PTE support David Hildenbrand (Arm)

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