All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for 4.20? v1 0/3] Fixes for vmap_to_mfn() and pt_mapping_level
@ 2025-01-20 16:54 Oleksii Kurochko
  2025-01-20 16:54 ` [PATCH v1 1/3] xen/riscv: implement software page table walking Oleksii Kurochko
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Oleksii Kurochko @ 2025-01-20 16:54 UTC (permalink / raw)
  To: xen-devel
  Cc: Oleksii Kurochko, Alistair Francis, Bob Eshleman, Connor Davis,
	Andrew Cooper, Anthony PERARD, Michal Orzel, Jan Beulich,
	Julien Grall, Roger Pau Monné, Stefano Stabellini

Introduce pt_walk(), which does software page table walking to resolve the
following issues:
1. vmap_to_mfn() uses virt_to_maddr(), which is designed to work with VA
   from either the direct map region or Xen's linkage region (XEN_VIRT_START),
   thereby an assertion will occur if it is used with other regions, in
   particular for the VMAP region. The solution is usage of pt_walk() for
   vmap_to_mfn().
2. pt_mapping_level() returns incorrect page table level in the case when
   mfn==INVALID_MFN when, for example, VA was mapped to PA using 4k mapping,
   but during destroying/modification pt_mapping_level() could return incorrect
   page table level as when mfn==INVALID_MFN then only VA is taking into account
   for page table level calculation and so if VA is page table level 1 aligned
   then page_mapping_level() will return level 1 ( instead of level 0 as VA was
   mapped to PA using 4k mapping so there is incostinency here ). The solution is
   usage of pt_walk() to recieve mfn and use both mfn and VA for proper page
   table level calculation.

It would be nice  to have these fixes in Xen 4.20 but isn't really critical as
there is no any users for RISC-V port at this moment.

Oleksii Kurochko (3):
  xen/riscv: implement software page table walking
  xen/riscv: update defintion of vmap_to_mfn()
  xen/riscv: update mfn calculation in pt_mapping_level()

 xen/arch/riscv/include/asm/mm.h |  4 +-
 xen/arch/riscv/pt.c             | 84 ++++++++++++++++++++++++++++++++-
 2 files changed, 85 insertions(+), 3 deletions(-)

-- 
2.48.1



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

end of thread, other threads:[~2025-01-29 15:34 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-20 16:54 [PATCH for 4.20? v1 0/3] Fixes for vmap_to_mfn() and pt_mapping_level Oleksii Kurochko
2025-01-20 16:54 ` [PATCH v1 1/3] xen/riscv: implement software page table walking Oleksii Kurochko
2025-01-27 10:06   ` Jan Beulich
2025-01-27 12:29     ` Oleksii Kurochko
2025-01-27 12:57       ` Jan Beulich
2025-01-27 17:22         ` Oleksii Kurochko
2025-01-27 17:41           ` Oleksii Kurochko
2025-01-28  8:07             ` Jan Beulich
2025-01-28  8:14           ` Jan Beulich
2025-01-29 13:12             ` Oleksii Kurochko
2025-01-29 14:01               ` Jan Beulich
2025-01-29 15:34                 ` Oleksii Kurochko
2025-01-20 16:54 ` [PATCH v1 2/3] xen/riscv: update defintion of vmap_to_mfn() Oleksii Kurochko
2025-01-27 10:09   ` Jan Beulich
2025-01-27 12:32     ` Oleksii Kurochko
2025-01-20 16:54 ` [PATCH v1 3/3] xen/riscv: update mfn calculation in pt_mapping_level() Oleksii Kurochko
2025-01-27 10:24   ` Jan Beulich
2025-01-27 12:51     ` 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.