[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] xen/arm: p2m: Populate pages for GICv2 mapping in arch_domain_create()
- To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Tue, 3 Jan 2023 12:34:12 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- 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=m+pfp5dyoybtMDi34WVwk5cS65qgk7w5i6y4Bj/H1fk=; b=Sl2CjsljSdXzfel8aHYM+p46t4PfxwenM1RGXVdYwhb+lf3CZxlnkVLJEJHVxChH1JbmpZ7PbaoTAIVOLruyVRAegCNO+0txtRLCAvg6GtqfntBmaQF95ESemAKRvUU7Z9Z4amJTDbu+6Ox4SnmJVClmX0kbLLtRwWYOfuTgR5MtYsGCJcKfP+RADmfT3iDaTtZKqh+xSkNpER3qGX4oc3jgaSttWpCvkWUKGUGbOLOzljvrJdmtbGvo1LVEcv7k/CWXL8lrgbYWm+ZqRGxaNN5xD99Adt64uVNx75uQS1lNyf6hB0UP+i7xXzLMky6p0N9k9yCreQrZyX7CHQ2Hjg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mGyWvN1Jxz7/JdAk8PoMjPF5jyp4NFdHW7iCHXDj9iHzfv8ozcfcfjktSwPEl/5y2nzdhNrvlRs9xK+KpXxSKovDR2nJUgJDkBb6cUIHx674IEv52CBUzio3Yt9NEmHHzAGCgAJr+y6k1dBi1kY1BSAZBpaw29TAGwku+uGsSHAIOyxDi80X2TLhD/GbnrSmBh4MAXEgeDffaZ0RSpEuyCnIVuMQIwNBHHQthRX/u+jjjZUzjHSD5z0fIrU7db1Bc5qy++pJEpLeBJlH273H58FyUyGZmPNn/FILatWQWI0vbuYd+6XmnGyYwg0sAnUurLc4dvCzBm2zEbtWgWpsRg==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Julien Grall <julien@xxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 03 Jan 2023 12:34:47 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHY36RTFiJSG85qSUCZzK4infnuWq4NsO2AgAANc4CAAYyLAIBUWeeAgAKahgCAADe5AIAmqQKA
- Thread-topic: [PATCH v2] xen/arm: p2m: Populate pages for GICv2 mapping in arch_domain_create()
Hi,
Sorry for the delay but I have very limited access to my mails right now.
On
Fri, 9 Dec 2022, Julien Grall wrote:
Hi Henry,
On 08/12/2022 03:06, Henry Wang wrote:
I am trying to work on the follow-up improvements about the Arm P2M code,
and while trying to address the comment below, I noticed there was an
unfinished
discussion between me and Julien which I would like to continue and here
opinions from all of you (if possible).
-----Original Message-----
From: Julien Grall <julien@xxxxxxx>
Subject: Re: [PATCH v2] xen/arm: p2m: Populate pages for GICv2 mapping in
arch_domain_create()
I also noticed that relinquish_p2m_mapping() is not called. This
should
be fine for us because arch_domain_create() should never create a
mapping that requires p2m_put_l3_page() to be called.
For the background of the discussion, this was about the failure path of
arch_domain_create(), where we only call p2m_final_teardown() which does
not call relinquish_p2m_mapping()...
So all this mess with the P2M is necessary because we are mapping the GICv2
CPU interface in arch_domain_create(). I think we should consider to defer the
mapping to later.
Other than it makes the code simpler, it also means we could also the P2M root
on the same numa node the domain is going to run (those information are passed
later on).
There is a couple of options:
1. Introduce a new hypercall to finish the initialization of a domain (e.g.
allocating the P2M and map the GICv2 CPU interface). This option was briefly
discussed with Jan (see [2])./
2. Allocate the P2M when populate the P2M pool and defer the GICv2 CPU
interface mapping until the first access (similar to how with deal with MMIO
access for ACPI).
I find the second option is neater but it has the drawback that it requires on
more trap to the hypervisor and we can't report any mapping failure (which
should not happen if the P2M was correctly sized). So I am leaning towards
option 2.
Any opinions?
Option
1 is not great due to the extra hypercall. But I worry that
option
2 might make things harder for safety because the
mapping/initialization
becomes "dynamic". I don't know if this is a
valid
concern.
I
would love to hear Bertrand's thoughts about it. Putting him in To:
How option 1 would work for dom0less ?
Option 2 would make safety more challenging but not impossible (we have a lot of other use cases where we cannot map everything on boot).
I would vote for option 2 as I think we will not certify gicv2 and it is not adding an other hyper call.
Cheers
Bertrand
|
|