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

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


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <xin.wang2@xxxxxxx>
  • Date: Fri, 26 Apr 2024 11:14: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=R4l3odQmbIy9nPjdAMVrsnL7NEqUmVisHZ2I+y7GLVE=; b=OnhvsvbmAGb86jht+9ewMyWrJGYuM0eQRvCCzBafqToRHU6OsDc4bJGrbLtTM6R4bnm+3wuJPOgdUXbP7nCNw8PXKJckChrUOn8imYTjWvGDrIIny000gmpohx2UqB/sHzpx8I5hjRmm4vUJGFU4ZrDYcaQk7fT7AkN+7tw2g1X/lNV4SylMYm/3zvKZr64Mk5RCE/3LFJ8m/qcV0fJGt+JkAKl/LPtcSIkJ0gdkTXzm77mMrFNU7mVP7MBXZx5dDcuJsQM+4AOqabtZSDUpcmFzb+QwkJo9+jvPTyqGAY012bYjkjvKrhCn5SDyBiMVV/7YZGSQKwE+3tnGD8nniA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fE8CYxCAvU8JPn5UKin77WngaybzfFvz+MMkacnE4eIljHLNk5MRwByqeR9dKjz/Xy/DBYtuXqxZJWkXUNBpOAB7DGVuBVlVdTG3SUTzsZhILpwknEY48V+KY94a9FyHyEYsIqAxN+rmQWOEFZGIfmDE25LVjbnZ7T7zjPYqrLFf2i4Zau/zuo98o3x0910W/pzbbPZAj7Ojg7V/49X1Z07whJGMh8B3lUn8NTP8fqdOdacPb61YH+aB//8YjyV0w16lM2tvC8YMv0C56hYSkQLVQXXR0VkKukB7iuytOExu8UMCry9vnx6mUjfoaGR/PrZSO+/BOuE2BL5duRwFsw==
  • Cc: Henry Wang <xin.wang2@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, 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: Fri, 26 Apr 2024 03:15:26 +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.

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/1268643360

Henry Wang (3):
  xen/arm/dom0less-build: Alloc magic pages for Dom0less DomUs from
    hypervisor
  xen/arm, tools: Add a new HVM_PARAM_MAGIC_BASE_PFN key in HVMOP
  tools/init-dom0less: Avoid hardcoding GUEST_MAGIC_BASE

 tools/helpers/init-dom0less.c   | 38 ++++++++++++++-------------------
 tools/libs/guest/xg_dom_arm.c   |  3 ++-
 xen/arch/arm/dom0less-build.c   | 24 +++++++++++++++++++++
 xen/arch/arm/hvm.c              |  1 +
 xen/include/public/arch-arm.h   |  1 +
 xen/include/public/hvm/params.h |  1 +
 6 files changed, 45 insertions(+), 23 deletions(-)

-- 
2.34.1




 


Rackspace

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