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

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


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <xin.wang2@xxxxxxx>
  • Date: Sat, 11 May 2024 08:56:07 +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=yo+gmdMoRH1k9Ot7fqaAxmEZs90haIiaP3UwHtp3dho=; b=B8mrNgr6UNA4cCLtx+fDXsFYtiGtJtwVsAcJwU1YY8oshEOXeImokMe5j+TIHZgDRy0jXlOJq7BpS83bVzWoxjJtjNyJEG3qVQ+UguXRA78+f3gI4+v66Q+Yr7WzVVYT9km/91fq9ST6FGQnWKxv8Ed+UA3h8TDMHsAF80J7csmQFlXW/xJOk2rWEEh4RnE6WaECsoI9ZWaspRwcHmXny2VLiDH9apEzOqXVvVTMV3g7JO5lxKK988JS+Od+YfypwLt1w+e3loGKtf8tU8595gMk79fhJNZhDs4tli+yv74woD9sL5YdfxK1aoF6mmuX5I3+JoUQAZ+KiNAFpjLdMw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xq0vkuxLdWo/Sc9lYOLJ6B2ZllopHfG61h6VmuHNFUpETa/NJxVuIBY46PYhE8sASSoV8fx6Js9MDZ58kAIWlqEjaql481/EWo2u2uNdxhLmKcVYChiG3tNWJo6GKyHqvusuNTC0YQdkR9+/O5sCEsdeq+y2WLAaPwub/fRoRGKdiLYI+81iV4bIf/QoUMH/zFDAV2Z9l6hwFY5FKinTOBcOVLgxCr1D/1PWD5vWTRy0oRPNaUmR7m+SY1Z+oM8wBjhRf5fplDk2KdjAM8s6RTsjBk8YgX6Q98ZDN8CUsFzoFsNVfm28rhQ8vkwytJVOC6hVCUfLxkotMfjbB5P7AA==
  • Cc: Henry Wang <xin.wang2@xxxxxxx>, Anthony PERARD <anthony@xxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Sat, 11 May 2024 00:56:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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/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://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(-)

-- 
2.34.1




 


Rackspace

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