All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Setup memory management for RISC-V
@ 2024-10-23 15:50 Oleksii Kurochko
  2024-10-23 15:50 ` [PATCH v2 1/3] xen/riscv: introduce setup_mm() Oleksii Kurochko
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Oleksii Kurochko @ 2024-10-23 15:50 UTC (permalink / raw)
  To: xen-devel
  Cc: Oleksii Kurochko, Alistair Francis, Bob Eshleman, Connor Davis,
	Andrew Cooper, Jan Beulich, Julien Grall, Stefano Stabellini

Finish initializing the memory subsystem by mapping the direct map and
frame table.
In the case of RISC-V 64, which has a large virtual address space
(the minimum supported MMU mode is Sv39, providing TB of VA space),
so frame table is mapped starting from physical address
0 to ram_end.
This simplifies the calculations and thereby improves performance for
page_to_mfn(), mfn_to_page() as there is no frametable_base_pdx or
frametable_base_mfn ( if CONFIG_PDX_COMPRESSION=n).
XENHEAP_VIRT_START is introduced which is equal to directmap_virt_start which
is aligned with ram start to have superpages mapping and reduce pressure only
TLB.
In addition, initialize the VMAP_DEFAULT region, finalize the boot allocator,
and update the system state from early_boot to boot.

Introduce share_xen_page_with_guest() to deal with linkage error:
  riscv64-linux-gnu-ld: prelink.o: in function `tasklet_kill':
  /build/xen/common/tasklet.c:176: undefined reference to
     `share_xen_page_with_guest'
  riscv64-linux-gnu-ld: ./.xen-syms.0: hidden symbol `share_xen_page_with_guest'
    isn't defined riscv64-linux-gnu-ld: final link failed: bad value

The function maddr_to_virt() is introduced as part of this patch series, as
setup_directmap_mappings() uses it indirectly through mfn_to_virt().

virt_to_maddr() is updated as it is started to use XENHEAP_VIRT_START which is
introduced in this patch series.

---
Changes in V2:
 - update the cover letter message.
 - merge first 3 patches to "introduce setup_mm()" patch as after setup_mm()
   rework all the things in first two patches of v1 started to use changes
   introduced in "introduce setup_mm()" patch.
 - add Acked-by for some patch series.
 - All other details please look at the specific patch.
---

Oleksii Kurochko (3):
  xen/riscv: introduce setup_mm()
  xen/riscv: initialize the VMAP_DEFAULT virtual range
  xen/riscv: finalize boot allocator and transition to boot state

 xen/arch/riscv/include/asm/config.h |   1 +
 xen/arch/riscv/include/asm/mm.h     |  13 ++-
 xen/arch/riscv/include/asm/setup.h  |   2 +
 xen/arch/riscv/mm.c                 | 132 ++++++++++++++++++++++++++--
 xen/arch/riscv/pt.c                 |   6 ++
 xen/arch/riscv/setup.c              |  14 +++
 xen/arch/riscv/stubs.c              |  10 +++
 7 files changed, 168 insertions(+), 10 deletions(-)

-- 
2.47.0



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

end of thread, other threads:[~2024-10-31 14:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-23 15:50 [PATCH v2 0/3] Setup memory management for RISC-V Oleksii Kurochko
2024-10-23 15:50 ` [PATCH v2 1/3] xen/riscv: introduce setup_mm() Oleksii Kurochko
2024-10-30 10:25   ` Jan Beulich
2024-10-30 16:50     ` oleksii.kurochko
2024-10-31  9:08       ` Jan Beulich
2024-10-31 13:19         ` oleksii.kurochko
2024-10-31 14:28           ` Jan Beulich
2024-10-23 15:50 ` [PATCH v2 2/3] xen/riscv: initialize the VMAP_DEFAULT virtual range Oleksii Kurochko
2024-10-23 15:50 ` [PATCH v2 3/3] xen/riscv: finalize boot allocator and transition to boot state Oleksii Kurochko

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.