Skip to content

Guest magic region allocation for 11 Dom0less domUs - Take two

Henry Wang xen-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 7 repliesIn review
  2. v13 patches 19 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4xen/arm: Alloc hypervisor reserved pages as magic pages for Dom0less DomUstools/libs/guest/xg_dom_arm.c xen/arch/arm/dom0less-build.c xen/include/public/arch-arm.h+38 -65 replies
2/4xen/arm: Add new HVM_PARAM_HV_RSRV_{BASE_PFN,SIZE} keys in HVMOPxen/arch/arm/dom0less-build.c xen/arch/arm/hvm.c xen/include/public/hvm/params.h+15 -11 reply
3/4tools/init-dom0less: Avoid hardcoding GUEST_MAGIC_BASEtools/helpers/init-dom0less.c+17 -231 reply
4/4docs/features/dom0less: Update the late XenStore init protocoldocs/features/dom0less.pandoc+5 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] Guest magic region allocation for 11 Dom0less domUs - Take two

Hi all,

This series is trying to fix the reported guest magic region allocation issue for 11 Dom0less domUs, an error message can seen from the init-dom0less application on 1:1 direct-mapped Dom0less DomUs:

```
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 1:1 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.

In [1] I've tried to fix this issue by the domctl approach, and discussions in [2] and [3] indicates that a domctl is not really necessary, as we can simplify the issue to "allocate the Dom0less guest magic regions at the Dom0less DomU build time and pass the region base PFN to init-dom0less application". Therefore, the first patch in this series will allocate magic pages for Dom0less DomUs, the second patch will store the allocated region base PFN to HVMOP params like HVM_PARAM_CALLBACK_IRQ, and the third patch uses the HVMOP to get the stored guest magic region base PFN to avoid hardcoding GUEST_MAGIC_BASE. The last patch will update documentation.

Gitlab CI for this series can be found in [4].

[1] https://lore.kernel.org/xen-devel/[email protected]/
[2] https://lore.kernel.org/xen-devel/[email protected]/
[3] https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2404251508470.3940@ubuntu-linux-20-04-desktop/
[4] https://gitlab.com/xen-project/people/henryw/xen/-/pipelines/1285727622

Henry Wang (4):
xen/arm: Alloc hypervisor reserved pages as magic pages for Dom0less
DomUs
xen/arm: Add new HVM_PARAM_HV_RSRV_{BASE_PFN,SIZE} keys in HVMOP tools/init-dom0less: Avoid hardcoding GUEST_MAGIC_BASE docs/features/dom0less: Update the late XenStore init protocol

 docs/features/dom0less.pandoc   |  8 ++++---
 tools/helpers/init-dom0less.c   | 40 ++++++++++++++-------------------
 tools/libs/guest/xg_dom_arm.c   |  6 -----
 xen/arch/arm/dom0less-build.c   | 35 +++++++++++++++++++++++++++++
 xen/arch/arm/hvm.c              |  2 ++
 xen/include/public/arch-arm.h   |  6 +++++
 xen/include/public/hvm/params.h | 11 ++++++++-
 7 files changed, 75 insertions(+), 33 deletions(-)
Signature · 1 line
2.34.1