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

Re: [PATCH v4 0/5] DOMCTL-based guest magic region allocation for 11 domUs


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <xin.wang2@xxxxxxx>
  • Date: Fri, 19 Apr 2024 09:45:58 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=apertussolutions.com 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=oo8USQeSLxengWlGMk0sPhLjL3ovSB4zRhIdGMoYv7Q=; b=ARze5Es99Nwg4GoFXCnTeHrsMsshWMQ5656IsLe5Hbp3RlqSurnaaFv4QRDqD6UNtVpo5/U3atBYTbuvKVKpVCNUdzlACxWQZWe4ciVFfHHKi9zTXk/M9vZXJ7Z3+WBZO64ka9w4Xmh45EEDna2bub6Kc0DZq4kM+XqysBj6cgn12e0my/eniSc1KFNLsatJLqPdYDfUvI3gzsv/S7M+AFyDxfs2/NR19RLwI7Ui+Ev3CcuCW3LqPCMFor/0HOOLtkbXG1H8N8CqFKWwSKpjwt8di/IPo7qxeTSx9BENluIszZ78LtqqqZNuAE+QXE6CrH0OLMM12x6mxIrnFz3OiQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lD0tAXObu3h03zbTVWjw9zvykwUi/nyimlVaZDVwTxwut0PLjGWIBzLexv1jJ/4Aifm0lqfUFx/ByOtp+htEgoTZbHT/dmvFIg/WcVqMSTmiX/UYuDsccthmaGH78jxNQrRonaDI5XBAppZKbMyxOFcBaM+SSnyBhOJK1a5p07c+Qyohiq9teSOlrizi9+yhyysoRKI+8h9g/+31kZPhkpiPPaRvKlGAVhlLgDOPt/xFWoii2KkPL4uj2ye1zVr87uSAPcxCj9SFC9rTwZLAZTYUrmgJ98BMyQeiWi1c+bgnicOnVHpXe12JC23Mmbw3kgkUV7VLhfSeEPMrhtiJtg==
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Bertrand Marquis" <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 19 Apr 2024 01:46:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Daniel,

On 4/18/2024 10:16 PM, Daniel P. Smith wrote:
On 4/9/24 00:53, Henry Wang wrote:
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 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.

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.

Hey Henry,

To help provide some perspective, these issues are not experienced with hyperlaunch. This is because we understood early on that you cannot move a lightweight version of the toolstack into hypervisor init and not provide a mechanism to communicate what it did to the runtime control plane. We evaluated the possible mechanism, to include introducing a new hypercall op, and ultimately settled on using hypfs. The primary reason is this information is static data that, while informative later, is only necessary for the control plane to understand the state of the system. As a result, hyperlaunch is able to allocate any and all special pages required as part of domain construction and communicate their addresses to the control plane. As for XSM, hypfs is already protected and at this time we do not see any domain builder information needing to be restricted separately from the data already present in hypfs.

I would like to make the suggestion that instead of continuing down this path, perhaps you might consider adopting the hyperlaunch usage of hypfs. Then adjust dom0less domain construction to allocate the special pages at construction time.

Thank you for the suggestion. I think your proposal makes sense. However I am not familiar with the hypfs so may I ask some questions first to confirm if I understand your proposal correctly: Do you mean I should firstly find, allocate and create mapping for these special pages at the dom0less domU's construction time, then store the GPA in hypfs and extract the GPA from init-dom0less app later on? Should I use existing interfaces such as xenhypfs_{open,cat,ls, etc} or I may probably need to add new hypercall ops?

The original hyperlaunch series includes a patch that provides the helper app for the xenstore announcement. And I can provide you with updated versions if that would be helpful.

Thank you, yes a pointer to the corresponding series and patch would be definitely helpful.

Kind regards,
Henry


V/r,
Daniel P. Smith




 


Rackspace

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