All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] DOMCTL-based guest magic regions allocation for dom0less
@ 2024-03-08  1:54 Henry Wang
  2024-03-08  1:54 ` [PATCH v2 1/5] xen/arm: Rename assign_static_memory_11() for consistency Henry Wang
                   ` (4 more replies)
  0 siblings, 5 replies; 31+ messages in thread
From: Henry Wang @ 2024-03-08  1:54 UTC (permalink / raw)
  To: xen-devel
  Cc: Henry Wang, Stefano Stabellini, Julien Grall, Bertrand Marquis,
	Michal Orzel, Volodymyr Babchuk, Andrew Cooper, George Dunlap,
	Jan Beulich, Wei Liu, Shawn Anastasio, Alistair Francis,
	Bob Eshleman, Connor Davis, Roger Pau Monné,
	Anthony PERARD, Juergen Gross

An error message can seen from the init-dom0less application on
direct-mapped 1:1 domains:
```
Allocating magic pages
memory.c:238:d0v0 mfn 0x39000 doesn't belong to d1
Error on alloc magic pages
```

This is because populate_physmap() automatically assumes gfn == mfn
for direct mapped domains. This cannot be true for the magic pages
that are allocated later for Dom0less DomUs from the init-dom0less
helper application executed in Dom0. For domain using statically
allocated memory but not 1:1 direct-mapped, similar error "failed to
retrieve a reserved page" can be seen as the reserved memory list
is empty at that time.

This series tries to fix this issue using a DOMCTL-based approach,
because for 1:1 direct-mapped domUs, we need to avoid the RAM regions
and inform the toolstack about the region found by hypervisor for
mapping the magic pages. The first 2 patches are simple clean-ups.
Patch 3 introduced a new DOMCTL to get the guest memory map, currently
only used for the magic page regions. Patch 4 uses the same approach
as finding the extended regions to find the guest magic page regions
for direct-mapped DomUs. Patch 5 makes the init-dom0less application
consume the DOMCTL to avoid hardcoding the guest magic base address.

Henry Wang (5):
  xen/arm: Rename assign_static_memory_11() for consistency
  xen/domain.h: Centrialize is_domain_direct_mapped()
  xen/domctl, tools: Introduce a new domctl to get guest memory map
  xen/arm: Find unallocated spaces for magic pages of direct-mapped domU
  xen/memory, tools: Make init-dom0less consume XEN_DOMCTL_get_mem_map

 tools/helpers/init-dom0less.c            | 22 +++++++++---
 tools/include/xenctrl.h                  |  4 +++
 tools/libs/ctrl/xc_domain.c              | 32 +++++++++++++++++
 xen/arch/arm/dom0less-build.c            | 45 +++++++++++++++++++++++-
 xen/arch/arm/domain.c                    |  6 ++++
 xen/arch/arm/domain_build.c              | 30 ++++++++++------
 xen/arch/arm/domctl.c                    | 19 +++++++++-
 xen/arch/arm/include/asm/domain.h        | 10 ++++--
 xen/arch/arm/include/asm/domain_build.h  |  2 ++
 xen/arch/arm/include/asm/static-memory.h |  8 ++---
 xen/arch/arm/static-memory.c             |  5 +--
 xen/arch/ppc/include/asm/domain.h        |  2 --
 xen/arch/riscv/include/asm/domain.h      |  2 --
 xen/arch/x86/include/asm/domain.h        |  1 -
 xen/common/memory.c                      | 10 ++++--
 xen/include/public/arch-arm.h            |  4 +++
 xen/include/public/domctl.h              | 21 +++++++++++
 xen/include/public/memory.h              |  5 +++
 xen/include/xen/domain.h                 |  3 ++
 xen/include/xen/mm.h                     |  2 ++
 20 files changed, 201 insertions(+), 32 deletions(-)

-- 
2.34.1



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

end of thread, other threads:[~2024-04-02  9:04 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-08  1:54 [PATCH v2 0/5] DOMCTL-based guest magic regions allocation for dom0less Henry Wang
2024-03-08  1:54 ` [PATCH v2 1/5] xen/arm: Rename assign_static_memory_11() for consistency Henry Wang
2024-03-08  8:18   ` Michal Orzel
2024-03-08  8:22     ` Henry Wang
2024-03-08  1:54 ` [PATCH v2 2/5] xen/domain.h: Centrialize is_domain_direct_mapped() Henry Wang
2024-03-08  8:59   ` Michal Orzel
2024-03-08  9:06     ` Henry Wang
2024-03-08  9:41       ` Jan Beulich
2024-03-11 18:02   ` Shawn Anastasio
2024-03-08  1:54 ` [PATCH v2 3/5] xen/domctl, tools: Introduce a new domctl to get guest memory map Henry Wang
2024-03-11  9:10   ` Michal Orzel
2024-03-11  9:46     ` Henry Wang
2024-03-11 16:58   ` Jan Beulich
2024-03-12  3:06     ` Henry Wang
2024-03-08  1:54 ` [PATCH v2 4/5] xen/arm: Find unallocated spaces for magic pages of direct-mapped domU Henry Wang
2024-03-11 13:46   ` Michal Orzel
2024-03-11 13:50     ` Michal Orzel
2024-03-12  3:25     ` Henry Wang
2024-03-13 11:09       ` Carlo Nonato
2024-03-08  1:54 ` [PATCH v2 5/5] xen/memory, tools: Make init-dom0less consume XEN_DOMCTL_get_mem_map Henry Wang
2024-03-11 17:07   ` Jan Beulich
2024-03-12  3:44     ` Henry Wang
2024-03-12  7:34       ` Jan Beulich
2024-03-12  7:36         ` Henry Wang
2024-03-29  5:11     ` Henry Wang
2024-04-02  7:05       ` Jan Beulich
2024-04-02  8:43         ` Henry Wang
2024-04-02  8:51           ` Jan Beulich
2024-04-02  9:03             ` Henry Wang
2024-03-25 15:35   ` Anthony PERARD
2024-03-26  1:21     ` Henry Wang

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.