Skip to content

DOMCTL-based guest magic regions allocation for dom0less

Henry Wang xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest5 patches 25 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5xen/arm: Rename assign_static_memory_11() for consistencyxen/arch/arm/dom0less-build.c xen/arch/arm/include/asm/static-memory.h xen/arch/arm/static-memory.c+8 -72 replies
2/5xen/domain.h: Centrialize is_domain_direct_mapped()xen/arch/arm/include/asm/domain.h xen/arch/ppc/include/asm/domain.h xen/arch/riscv/include/asm/domain.h +2 more+3 -74 replies
3/5xen/domctl, tools: Introduce a new domctl to get guest memory maptools/include/xenctrl.h tools/libs/ctrl/xc_domain.c xen/arch/arm/domain.c +4 more+93 -14 replies
4/5xen/arm: Find unallocated spaces for magic pages of direct-mapped domUxen/arch/arm/dom0less-build.c xen/arch/arm/domain_build.c xen/arch/arm/include/asm/domain_build.h+64 -114 replies
5/5xen/memory, tools: Make init-dom0less consume XEN_DOMCTL_get_mem_maptools/helpers/init-dom0less.c xen/common/memory.c xen/include/public/memory.h +1 more+33 -611 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchMichal OrzelJan BeulichShawn Anastasio
1/5
2/5R-b R-b A-b
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/5] DOMCTL-based guest magic regions allocation for dom0less

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(-)
Signature · 1 line
2.34.1