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

Re: [PATCH v7 5/8] xen/arm: Split MMU-specific setup_mm() and related code out


  • To: Julien Grall <julien@xxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Sat, 14 Oct 2023 00:03:39 +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=INoX+qCTi6SYBBI3tUhXxoaSTFA1hiOYpTrzHr/OLUI=; b=QH64YAI00L1/TPdoom/03lauKqJEoskALWkTd+ERWO9eAiqgN4ZCc28cRZw6BksqAHNAHc6dce/GK5KaoOa0o2TifvWKGExha/Av2mAFhZ7WtULGuM0//z5sJRFI4dqulbzYsKT2J7potSKLtM93rpmTQslxoVKRU2qHNqdocOKk1IRKt5Hwjt7mTXfw+GM7L1xbwstyOPcNDKhJ8F/rM5rCkrgFz/3odXwxOjWaA3rtAv5+YE9MCIzktQ0MKyiFEca45gIsTCElVW8cflwKPCD5qeweXr0vIUZEDuXHbLAdZ1/mSmXLsISK6OWeGHWnFGWhFBtrbFlFZMZ9wPMtAg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ib6i6DAdS1XL69WB55xZ7UoDdetDfGnhiOu80vTCn5PTM30fafKLpAbLtWt6r1gUyEUKCks+hKnoQltexB0QvBzbfAK3wswIlQicCjCDC6yJcrQ9uBnwgDTdamQ1xsRmYYv5dDBBuI33NsVtpBpROMLhjyldmMYUT0Met5Rm1TDJ3D+jpvutdit8hWp866QHk+ND0yaw7p4bkgLuEO00PhFt9sxDHFUabrUvxplkObk1o/Z9Rx9KbVQtSLWVLf8vvlDPPqj7xFnBuoq8BoYHDp+2IJ/MIlcvcbmQzFGDlemCiy1xPDwFQ4N73Xag37v0iafAKQGXOg4qQ4nHsoGf4A==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>
  • Delivery-date: Sat, 14 Oct 2023 00:04:32 +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+kx+23lhReITfUCLaoneR4RMRrBIBAOAgABrGQA=
  • Thread-topic: [PATCH v7 5/8] xen/arm: Split MMU-specific setup_mm() and related code out

Hi Julien,

> On Oct 14, 2023, at 01:40, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Henry,
> 
> On 09/10/2023 02:03, Henry Wang wrote:
>> setup_mm() is used for Xen to setup memory management subsystem,
>> such as boot allocator, direct-mapping, xenheap initialization,
>> frametable and static memory pages, at boot time.
>> We could inherit some components seamlessly for MPU support, such
>> as the setup of boot allocator, whilst we need to implement some
>> components differently for MPU, such as xenheap, etc. Also, there
>> are some components that is specific to MMU only, for example the
>> direct-mapping.
>> Therefore in this commit, we split the MMU-specific setup_mm() and
>> related code out. Since arm32 and arm64 have completely different
>> setup_mm() implementation, take the opportunity to split the
>> arch-specific setup_mm() to arch-specific files, so that we can
>> avoid #ifdef. Also, make init_pdx(), init_staticmem_pages(),
>> setup_mm(), and populate_boot_allocator() public for future MPU
>> implementation.
> 
> I am a bit confused with the last sentence. AFAICT, even without the MPU 
> work, I think you already need to export init_pdx() & co because it is called 
> from two different units.

Yeah you are correct, I will reword the sentence to:
"Also, make init_pdx(), init_staticmem_pages(), and populate_boot_allocator() 
public
as these functions are now called from two different units, make setup_mm() 
public
for future MPU implementation."

> 
>> With above code movement, mark setup_directmap_mappings() as static
>> because the only caller of this function is now in the same file
>> with it. Drop the original setup_directmap_mappings() declaration
>> and move the in-code comment on top of the declaration on top of
>> the function implementation.
>> Signed-off-by: Henry Wang <Henry.Wang@xxxxxxx>
>> Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
>> Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
> 
> With the above comment clarified:
> 
> Acked-by: Julien Grall <jgrall@xxxxxxxxxx>

Thanks!

Kind regards,
Henry

> 
> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

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