All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/4] xen/riscv: fix boot on missing extensions and MMU setup bugs
@ 2026-10-13 10:05 Baptiste Le Duc
  2026-10-13 10:07 ` [PATCH v6 1/4] xen/riscv: probe the PTE A/D bits update scheme at boot Baptiste Le Duc
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Baptiste Le Duc @ 2026-10-13 10:05 UTC (permalink / raw)
  To: oleksii.kurochko, xen-devel
  Cc: Baptiste Le Duc, Andrew Cooper, Anthony PERARD, Michal Orzel,
	Jan Beulich, Julien Grall, Roger Pau Monné,
	Stefano Stabellini, Alistair Francis, Connor Davis, Zheng Zhang

This series introduces bugs fixes that were found while bringing up CI
support for the HiFive Premier P550 board with a basic smoke test. The
board-support series itself will follow separately as it depends on
PLIC/vPLIC and dom0less support that have not been upstreamed yet. This
series carries only the independent fixes found along the way, none of them
need the board-support series to apply.

This series:
    1: Probe the PTE A/D bits update scheme at boot
    2: rework the A/D bits comment in p2m_set_pte_flags()
    3: Fix A/D bits in Xen's page-table mappings
    4. Use pte_is_valid() in pte_is_mapping()

Test CI pipeline (uses the QTB framework to pexpect the console under
various machine svade/svadu configs):
https://gitlab.com/xen-project/people/baptleduc/xen/-/pipelines/2941839143

---
Changes since v5:
- Replace "xen/riscv: always preset A/D bits in G-stage PTEs" with a boot
  time probe of the A/D update scheme (patch 1). It checks the result
  against the Svade/Svadu DT binding and records the probed scheme when the
  DT advertises neither, instead of trusting the DT alone.
- Split the p2m_set_pte_flags() comment rework out into its own patch
  (patch 2).
- Patches 3 and 4 unchanged and are waiting to be merged.
- Link to v5:
  https://patch.msgid.link/1791215925.8631fc262581453bbf619ec5b2062170.1a10cc9f7c20003f66@vates.tech
---
Changes since v4:
- Drop patches merged upstream:
    ccf9d78c825b ("xen/riscv: rename PTE "permissions" to "pte_flags"")
- Collect trailers.
- Rebase patches on top of staging.
- Link to v4: https://patch.msgid.link/1790845467.8631fc262581453bbf619ec5b2062170.1a0f6b5397a0003f66@vates.tech
---
Changes since v3:
- Drop v3 patches 1, 6 already upstreamed:
    861e44a3ba8e ("xen/riscv: make Zihintpause no longer a required
    extension")
    469d83d42f5c ("docs/riscv: sync required ISA extensions with
    required_extensions[]")
- Add trailers (A-by and/or R-by).
- Rename patch 3 to ("xen/riscv: always preset A/D bits in G-stage PTEs")
  as it now always presets A/D bits instead of distinguish Svadu/Svade DT
  bindings cases.
- Address review comments.
- Link to v3: https://patch.msgid.link/1790699381.8631fc262581453bbf619ec5b2062170.1a0ee00218b000b504@vates.tech
---
Changes since v2:
- Drop v2 patches 5 and 6, already upstreamed:
    d8ca89f26c8a ("xen/riscv: flush speculatively cached Bare-mode TLB entries in turn_on_mmu()")
    08a898b93d21 ("xen/riscv: fix level_map_mask truncation on load_start")
- Drop "xen/riscv: make Svpbmt no longer a required extension".
  It relaxed Svpbmt so boards without it, like the HiFive P550, could boot.
  But without Svpbmt, DMA-noncoherent devices do not snoop the CPU caches
  and can read stale data from DRAM. Mainline Linux has the same problem,
  which is explained and reproducible in [1]. Fixing it needs a lot of
  machinery we do not need yet, and Svpbmt is mandatory in RVA23, so
  keeping it required is simpler and safer. An RFC will follow with a fix
  inspired by [2].
- Add three new patches:
    docs/riscv: sync required ISA extensions with required_extensions[]
    xen/riscv: rename PTE "permissions" to "pte_flags"
    xen/riscv: use pte_is_valid() in pte_is_mapping()
- Address review comments.

[1] https://github.com/davidlohr/vanilla-kernel-sifive-p550/tree/master
[2] https://lwn.net/Articles/996819/
---
Changes since v1:
- address ML comments
- rename some patchs
- add new patch-fix: 242dd1f890e4 ("xen/riscv: fix level_map_mask
  truncation on load_start") discovered when working on Spacemit K3 support
---

To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>
Cc: Michal Orzel <michal.orzel@amd.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Julien Grall <julien@xen.org>
Cc: Roger Pau Monné <roger@xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Alistair Francis <alistair.francis@wdc.com>
Cc: Connor Davis <connojdavis@gmail.com>
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Zheng Zhang <zhangzheng@iscas.ac.cn>

---

---
Baptiste Le Duc (4):
      xen/riscv: probe the PTE A/D bits update scheme at boot
      xen/riscv: rework the A/D bits comment in p2m_set_pte_flags()
      xen/riscv: fix A/D bits in Xen's page-table mappings
      xen/riscv: use pte_is_valid() in pte_is_mapping()

 xen/arch/riscv/cpufeature.c             | 97 +++++++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/cpufeature.h |  1 +
 xen/arch/riscv/include/asm/page.h       | 35 ++++++------
 xen/arch/riscv/mm.c                     | 11 ++--
 xen/arch/riscv/p2m.c                    | 42 ++++++--------
 5 files changed, 137 insertions(+), 49 deletions(-)
---
base-commit: 2c40f10b9cc1864b2991612f44d2410e37d57ebe
change-id: 20260902-riscv-fix-boot-missing-ext-a79c23bad694

Best regards,
--  
Baptiste Le Duc <baptiste.le-duc@vates.tech>



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

end of thread, other threads:[~2026-10-15 15:39 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13 10:05 [PATCH v6 0/4] xen/riscv: fix boot on missing extensions and MMU setup bugs Baptiste Le Duc
2026-10-13 10:07 ` [PATCH v6 1/4] xen/riscv: probe the PTE A/D bits update scheme at boot Baptiste Le Duc
2026-10-13 10:36   ` Jan Beulich
2026-10-13 11:57     ` Baptiste Le Duc
2026-10-13 15:24       ` Jan Beulich
2026-10-14  8:08         ` Oleksii Kurochko
2026-10-13 14:32     ` Baptiste Le Duc
2026-10-13 15:27       ` Jan Beulich
2026-10-14  9:00         ` Baptiste Le Duc
2026-10-14  9:09           ` Jan Beulich
2026-10-14  9:54             ` Oleksii Kurochko
2026-10-14 16:45             ` Baptiste Le Duc
2026-10-15  7:14               ` Jan Beulich
2026-10-15  8:28                 ` Baptiste Le Duc
2026-10-15  8:41                   ` Jan Beulich
2026-10-15  8:44                     ` Jan Beulich
2026-10-15  8:59                       ` Baptiste Le Duc
2026-10-15 15:31                     ` Oleksii Kurochko
2026-10-15 15:38                     ` Oleksii Kurochko
2026-10-14  9:03   ` Oleksii Kurochko
2026-10-13 10:07 ` [PATCH v6 2/4] xen/riscv: rework the A/D bits comment in p2m_set_pte_flags() Baptiste Le Duc
2026-10-13 10:07 ` [PATCH v6 3/4] xen/riscv: fix A/D bits in Xen's page-table mappings Baptiste Le Duc
2026-10-13 10:43   ` Jan Beulich
2026-10-13 12:02     ` Baptiste Le Duc
2026-10-14  9:59   ` Oleksii Kurochko
2026-10-14 14:53     ` Baptiste Le Duc
2026-10-13 10:07 ` [PATCH v6 4/4] xen/riscv: use pte_is_valid() in pte_is_mapping() Baptiste Le Duc

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.