[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 8/8] xen/arm: mmu: move MMU specific P2M code to mmu/p2m.{c,h}
- To: Julien Grall <julien@xxxxxxx>
- From: Henry Wang <Henry.Wang@xxxxxxx>
- Date: Wed, 18 Oct 2023 03:06:56 +0000
- Accept-language: zh-CN, 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=w3rQqs277/fmIdY6xtPOjf4XKbytzZ6ExnSZ9C457WA=; b=iK2ZdrcexzKDinFfQzMagZzO+jr8po6fI2PgPXLIuvN1ZIo31kHsEI3u71f08RDSGC6Q4hlX9rWgMJaD5pjkW0UBVg0veHJhhSN6u0LJPye67NP6JloRg0Eb5+VFqAOsyiOkVKZ37Yfeph0/HAeXoqz6TKdo5bOv6lE8D+ZyD6cl8652HNmp1H0JF204fC+ugJaoHEzIIcdcV+YR5Av0ih4KFEVvKvxeL1vjBfuUlBcxoXdDpS7cK9jB9j9btbhgjBGPTi58hSjbiEmnLiVq+azdNU+68Zp3FrqtAW09Qd4UxbZej/pnSHFav/EVpwL3s/5yaHqW5TgDXrKbgDzGfA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ctu9s+O33bJcwhG5qHUKY8r7fp5mwJn3U3up84GNBv0dML6DJ46VOXL9oNotQF0Sfjk0oEAB20fcmu9RhDUg8dO7VmlesQskHAGLgZENgq75UeJ8S1LVPZf1RycBDwdqzrT84xBR4X+I4BCdnU1d4uzbpGk2IsUCbm4xriwKwKiV5ilhEKsBzBuPzNzETDVn+tv0aULWw1gh5nmvcTDzJ38b4Q5L2BLkdji4OtFBKXOezxHiIJe4dIMEULRWTZ9Yu8aGLqMzz/J3tjnbQkiloTLVOmNiAXMb0hwR9sd+MEnBcZghVkNgvelG05pgNPYEYvMJLiiT4yGb6hp4XMNCcQ==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>
- Delivery-date: Wed, 18 Oct 2023 03:07:31 +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: AQHZ+kyDxYKGSy7Hi0WFFm+WJG77tLBID9YAgAV4qICAAM4gAIAAlQgA
- Thread-topic: [PATCH v7 8/8] xen/arm: mmu: move MMU specific P2M code to mmu/p2m.{c,h}
Hi Julien,
> On Oct 18, 2023, at 02:13, Julien Grall <julien@xxxxxxx> wrote:
>
> Hi Henry,
>
> On 17/10/2023 06:55, Henry Wang wrote:
>>> On Oct 14, 2023, at 02:22, Julien Grall <julien@xxxxxxx> wrote:
>>>
>>> Hi Henry,
>>>
>>> On 09/10/2023 02:03, Henry Wang wrote:
>>>>
>>>> diff --git a/xen/arch/arm/include/asm/p2m.h
>>>> b/xen/arch/arm/include/asm/p2m.h
>>>> index 940495d42b..a9622dac9a 100644
>>>> --- a/xen/arch/arm/include/asm/p2m.h
>>>> +++ b/xen/arch/arm/include/asm/p2m.h
>>>> @@ -19,6 +19,22 @@ extern unsigned int p2m_root_level;
>>>> #define P2M_ROOT_ORDER p2m_root_order
>>>
>>> You seem to use P2M_ROOT_ORDER to allocate p2m->root in arm/p2m.c. However,
>>> as I mentioned before, I don't think the defintion of p2m->root is suitable
>>> for the MPU. I think the two functions using p2m->root should be moved in
>>> mmu/p2m.c and P2M_ROOT_ORDER should be moved in mmu/p2m.h.
>> While working on this, I noticed that if we move p2m_final_teardown() (one
>> of the two
>> functions you mentioned that consuming p2m->root), we also need to move the
>> static
>> function p2m_free_vmid(). This seems reasonable as on MPU we only have
>> dom0less
>> domUs so we don’t really need to free vmid.
>
> Regardless on whether you need to free VMID on MPU, the allocation and free
> functions should live in the same unit. So if you plan to move
> p2m_final_teardown() in mmu/p2m.c, then p2m_free_vmid should be exported.
Sounds good, I will follow this way. Thanks.
Kind regards,
Henry
>
> Cheers,
>
> --
> Julien Grall
|