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

Re: [PATCH 1/3] xen/arm/dom0less-build: Alloc magic pages for Dom0less DomUs from hypervisor


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <xin.wang2@xxxxxxx>
  • Date: Mon, 6 May 2024 11:13:04 +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=v1e21ooJqaxmkhXcun0n96GKnY1vVbBlfGXqRdJB2vo=; b=C8vpNqDrK/YTHmhTAmNI4/0AaNARN1DDirjzHu6xz6XbHzv2kd5LIiD53RSwled3/skgc4+KKAYIIKO667nubTB5Z7P0ZINIn2hchpyMWDiiPdRU5YJNy7WgIhB0f4ZhGkuB6h1AGYzu+SYevIDdKu+Y6QIWi5luyi6mmIidWQhBnaZXe7nzjd6VV8IEtVx22rP0IOdpezwzyTnxgprg1fPjmhlYF8V9jZIRvFXHVZdUb16T9HMP5Ns01ROXIYMqVUnvdP82+GNIKmxSAxGvXWtTByAvn2c5wskhKFI8UQFRlwpHLpcQg1JmeGQnBTTzQvnH2v7i6ipLa0d+I4rP/w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X3ZMf/WIM3Xfs7Lo2g0thkasbpcO5J+g/wkWFWCQUh49ZDRDtYrB5uyrz5TEbsnobenHsIlWRoYCkUuFlE4jgsJSkVg/8x6dW5TTUGSkbr70yDMUUHQobs6DlQW1alUNYiBUqmyszqG2A1mUYGGkJruz7Z5cU/w2BszanymI0jrRq75zByemCVcbbpobFAsUcMDz0lSU61E64q0A7wBQKg9SfCWGob6qDeikCLQRAh0jjDZBSIweXtRqlnnR0jCFP663/8rU+523JGPn+9uK5GhDlX77cBzjpEOVWLEgPjpVfgUli8G1FP42a1TYobA9qKn2AvlVnkUHLIiZt94MBQ==
  • Cc: 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>, "Alec Kwapis" <alec.kwapis@xxxxxxxxxxxxx>
  • Delivery-date: Mon, 06 May 2024 03:13:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Daniel,

On 4/30/2024 6:22 PM, Daniel P. Smith wrote:
On 4/29/24 22:55, Henry Wang wrote:
Hi Daniel,

On 4/30/2024 8:27 AM, Daniel P. Smith wrote:
On 4/25/24 23:14, Henry Wang wrote:
There are use cases (for example using the PV driver) in Dom0less
setup that require Dom0less DomUs start immediately with Dom0, but
initialize XenStore later after Dom0's successful boot and call to
the init-dom0less application.

An error message can seen from the init-dom0less application on
1:1 direct-mapped domains:
```
Allocating magic pages
memory.c:238:d0v0 mfn 0x39000 doesn't belong to d1
Error on alloc magic pages
```
This is because currently the magic pages for Dom0less DomUs are
populated by the init-dom0less app through populate_physmap(), and
populate_physmap() automatically assumes gfn == mfn for 1:1 direct
mapped domains. This cannot be true for the magic pages that are
allocated later from the init-dom0less 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.

To solve above issue, this commit allocates the magic pages for
Dom0less DomUs at the domain construction time. The base address/PFN
of the magic page region will be noted and communicated to the
init-dom0less application in Dom0.

Might I suggest we not refer to these as magic pages? I would consider them as hypervisor reserved pages for the VM to have access to virtual platform capabilities. We may see this expand in the future for some unforeseen, new capability.

I think magic page is a specific terminology to refer to these pages, see alloc_magic_pages() for both x86 and Arm. I will reword the last paragraph of the commit message to refer them as "hypervisor reserved pages (currently used as magic pages on Arm)" if this sounds good to you.

I would highlight that is a term used in the toolstack, while is probably not the best, there is no reason to change in there, but the hypervisor does not carry that terminology. IMHO we should not introduce it there and be explicit about why the pages are getting reserved.

Thanks for the suggestion. I will rework the commit message.

Kind regards,
Henry


v/r,
dps





 


Rackspace

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