[PW_SID:1083737] riscv: add Svnapot-based contiguous PTE support#1800
[PW_SID:1083737] riscv: add Svnapot-based contiguous PTE support#1800linux-riscv-bot wants to merge 8 commits into
Conversation
Introduce raw PTE helpers prefixed with double underscores for callers that need direct access to the underlying PTE encoding. These __* helpers form private low-level primitives, while the existing helpers remain the public core-MM-facing API that RISC-V can later wrap with additional architecture-specific semantics without exposing those details to generic callers. Switch kernel internal page table users in early boot, KASAN, EFI, hibernate and pageattr to use the private raw helpers directly. No functional change intended. Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Use the raw RISC-V PTE helpers when KVM G-stage code needs to inspect or update the exact leaf entry encoding. This keeps G-stage page tables independent from the public PTE wrappers that will gain Svnapot-aware behavior. No functional change intended. Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add Svnapot-aware wrappers around the public PTE helpers so core MM callers can operate on contiguous mappings without learning the NAPOT encoding details. Introduce contpte.c to handle folding, unfolding and accessed/dirty state aggregation for contiguous PTE blocks. Keep the raw __* helpers unchanged so NAPOT-aware callers can continue to access the underlying PTE encoding directly, and centralize the public Svnapot-aware wrappers under a single CONFIG_RISCV_ISA_SVNAPOT block with simple alias fallbacks for the non-Svnapot case. Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Use raw PTE helpers in hugetlb code to operate directly on the underlying PTE entries. This lets hugetlb manage NAPOT folding/unfolding explicitly instead of going through Svnapot-aware public wrappers. Add explicit NAPOT unfolding in set_huge_pte_at() before replacing an existing NAPOT mapping with non-NAPOT entries. No functional change intended. Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add Svnapot-aware implementations of clear_full_ptes() and get_and_clear_full_ptes() so full PTE batches can be cleared without losing the required unfold semantics for NAPOT mappings. Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Hook wrprotect_ptes() into the Svnapot contpte helpers so write protection can preserve fully covered NAPOT blocks and only unfold partial ranges at the edges. Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Provide a Svnapot-specific pte_batch_hint() implementation so callers can batch over a contiguous napot range without re-reading each PTE entry. Keep the public wrapper in pgtable.h and leave the CONFIG-disabled case on the existing single-entry fallback. Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[1/7] riscv: mm: split raw and public PTE helpers" |
|
Patch 1: "[1/7] riscv: mm: split raw and public PTE helpers" |
|
Patch 1: "[1/7] riscv: mm: split raw and public PTE helpers" |
|
Patch 1: "[1/7] riscv: mm: split raw and public PTE helpers" |
|
Patch 1: "[1/7] riscv: mm: split raw and public PTE helpers" |
|
Patch 1: "[1/7] riscv: mm: split raw and public PTE helpers" |
|
Patch 1: "[1/7] riscv: mm: split raw and public PTE helpers" |
|
Patch 1: "[1/7] riscv: mm: split raw and public PTE helpers" |
|
Patch 1: "[1/7] riscv: mm: split raw and public PTE helpers" |
|
Patch 1: "[1/7] riscv: mm: split raw and public PTE helpers" |
|
Patch 1: "[1/7] riscv: mm: split raw and public PTE helpers" |
|
Patch 1: "[1/7] riscv: mm: split raw and public PTE helpers" |
|
Patch 2: "[2/7] riscv/kvm: use raw PTE helpers for G-stage leaf PTEs" |
|
Patch 2: "[2/7] riscv/kvm: use raw PTE helpers for G-stage leaf PTEs" |
|
Patch 2: "[2/7] riscv/kvm: use raw PTE helpers for G-stage leaf PTEs" |
|
Patch 2: "[2/7] riscv/kvm: use raw PTE helpers for G-stage leaf PTEs" |
|
Patch 2: "[2/7] riscv/kvm: use raw PTE helpers for G-stage leaf PTEs" |
|
Patch 2: "[2/7] riscv/kvm: use raw PTE helpers for G-stage leaf PTEs" |
|
Patch 2: "[2/7] riscv/kvm: use raw PTE helpers for G-stage leaf PTEs" |
|
Patch 2: "[2/7] riscv/kvm: use raw PTE helpers for G-stage leaf PTEs" |
|
Patch 2: "[2/7] riscv/kvm: use raw PTE helpers for G-stage leaf PTEs" |
|
Patch 2: "[2/7] riscv/kvm: use raw PTE helpers for G-stage leaf PTEs" |
|
Patch 7: "[7/7] riscv: add Svnapot-aware pte_batch_hint support" |
|
Patch 7: "[7/7] riscv: add Svnapot-aware pte_batch_hint support" |
|
Patch 7: "[7/7] riscv: add Svnapot-aware pte_batch_hint support" |
|
Patch 7: "[7/7] riscv: add Svnapot-aware pte_batch_hint support" |
|
Patch 7: "[7/7] riscv: add Svnapot-aware pte_batch_hint support" |
|
Patch 7: "[7/7] riscv: add Svnapot-aware pte_batch_hint support" |
|
Patch 7: "[7/7] riscv: add Svnapot-aware pte_batch_hint support" |
|
Patch 7: "[7/7] riscv: add Svnapot-aware pte_batch_hint support" |
|
Patch 7: "[7/7] riscv: add Svnapot-aware pte_batch_hint support" |
da65025 to
50e3f1e
Compare
50e3f1e to
8cbc176
Compare
PR for series 1083737 applied to workflow
Name: riscv: add Svnapot-based contiguous PTE support
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1083737
Version: 1