[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v3 0/4] Guest XenStore page allocation for 11 Dom0less domUs


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <xin.wang2@xxxxxxx>
  • Date: Fri, 17 May 2024 11:21:52 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AxU6vjuvVdOW/ywnLEm/VDAKtSigYMJONUnO/ZgkylA=; b=EcbiQJ8ERHn3C8lROE6Z4zS2Ky8iNv6GNTgz7/B4jefJxomsyV/XWZcGxLHXS+dIqopRct03s35Q0Yh2cZ/xnA8J/hRwkWefE4fNzvszVGnT38EVxU1sOC0DXUWjKaF27/I94ZS0svyvsD53mZy0SFR/oizYfTcBppGdF39G9RF4HX9Nzd0xNXoMz68VQrvgVZNBep0G6NO4/fYm6v+D3xSuvEz3/BOfUh6YQ+QJnCGHYN5bT/elxlTyuRqPyntQTC4Y8u88hw9ef002YRL0E/Cx/lqnVlLDmCKzBYhOR1d7Kix953I6atR5fWvaQv+Z+mT94v1whfyBoH6csSOZ4g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WCrKt3jND6ubuKXsINud70JZHnV0lNzSXOqsXyTvIaxJJjqcsKXaK7x5By9HtT3OIsz7TzyUNAoa2epfmMCf0QwvyLQjETNUdskqm3tp/42IyWaRwode3/cn10bgPwfTCC894JZCSAXSOdF8dRhMmbBx6fQ9QdWVzTf78OMwdXKjfLW//Hhbvnx3GpcbCPNzEiZ+93R1Od/V9N9koSjj2xxMqYkEIyg50Zr00oG7UPyyR/CN6UXO3iZ+DiKGFi0J+ixg294eLNahR6DTPi1nrNGffmGlLoPOqsBHvXt9HA+IVSjUdcWWDaHuvHpg2UBUB/KCRAGCbnYknNvAg+Kb6A==
  • Cc: Henry Wang <xin.wang2@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Anthony PERARD <anthony@xxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "George Dunlap" <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Fri, 17 May 2024 03:23:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi all,

This series is trying to fix the reported guest magic region alloc
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". The later on
discussion [4] reached an agreement that we only need to allocate
one single page for XenStore, and set the HVM_PARAM_STORE_PFN from
hypervisor with some Linux XenStore late init protocol improvements.
Therefore, this series tries to fix the issue based on all discussions.
The first patch puts a restriction that static shared memory on
direct-mapped DomUs should also be direct mapped, as otherwise it will
clash [5]. Patch 2 allocates the XenStore page from Xen and set the
initial connection status to RECONNECTED. Patch 3 is the update of the
init-dom0less application with all of the changes. Patch 4 is the doc
change to reflect the changes introduced by this series.

**NOTE**: This series should work with the Linux change [6].

[1] https://lore.kernel.org/xen-devel/20240409045357.236802-1-xin.wang2@xxxxxxx/
[2] 
https://lore.kernel.org/xen-devel/c7857223-eab8-409a-b618-6ec70f6165aa@xxxxxxxxxxxxxxxxxxxx/
[3] 
https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2404251508470.3940@ubuntu-linux-20-04-desktop/
[4] 
https://lore.kernel.org/xen-devel/d33ea00d-890d-45cc-9583-64c953abd70f@xxxxxxx/
[5] 
https://lore.kernel.org/xen-devel/686ba256-f8bf-47e7-872f-d277bf7df0aa@xxxxxxx/
[6] 
https://lore.kernel.org/xen-devel/20240517011516.1451087-1-xin.wang2@xxxxxxx/

Henry Wang (4):
  xen/arm/static-shmem: Static-shmem should be direct-mapped for
    direct-mapped domains
  xen/arm: Alloc XenStore page for Dom0less DomUs from hypervisor
  tools/init-dom0less: Avoid hardcoding GUEST_MAGIC_BASE
  docs/features/dom0less: Update the late XenStore init protocol

 docs/features/dom0less.pandoc         | 12 +++---
 docs/misc/arm/device-tree/booting.txt |  3 ++
 tools/helpers/init-dom0less.c         | 58 +++++++--------------------
 xen/arch/arm/dom0less-build.c         | 44 +++++++++++++++++++-
 xen/arch/arm/static-shmem.c           |  6 +++
 5 files changed, 73 insertions(+), 50 deletions(-)

-- 
2.34.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.