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

RE: [PATCH v2 05/40] xen/arm64: prepare for moving MMU related code from head.S


  • To: Julien Grall <julien@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Wed, 18 Jan 2023 10:24:32 +0000
  • Accept-language: 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=IquuezylwvRjL4NG/xhRa2QIyePrJ3rh/pyM6D3CzYw=; b=Q8N+QjeAqFTvlZyQJoVW2bzgS7gmGSaLXFWjpC47aI+khROC6Zs1Po/0chF/4/Ygpt6peQfCg/CzFbMIt6phcDAGJr18GQNqWUW06DBqwz7Vi9PkKHoOj/ogj9xFO75x/tzxyJ4r/ekDBMfiHfkEeybRsk1Y62JMCSaEmcf5bdnfjJrNOo+jMM0BIc+LOXNHEQUhGbPWJczV52CJJor1d1mWdixqGG0tgLCGTrr4b9NwrY+ScsIijf3KaUlZFsYXid1RFulwPynjXZxCpYe0M/vPPY8UEouX5at1uVRifQ/ZhsR2bTEzVTfRMP1sLKhFWgHnH4PY+GxCy4s3O6xNWA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tru4/dK5/g8UWpjWxBPBLcSoix7FP1Ax4k8RHxY+RrIIZbwcmS8Q6KPMPaw+vNb0uLtbKtvaavQGWvhiz8PeCDy2Xwb1Mdv0Bk/E15sTzfmt+cu0f2HxiRQTigHByt1gFfpelQbdv9ARQvNCWjmuAThhyN4D0gqPXOeq+KGCtaqHjLmUtJ85vZImbQRFi/VUhMgZyPTvJGL4BDqy4EkmXWj0v+oRpSf3Py/cuSd8oNlry/ztA5vSj0jent5A6Zm9vaOdR16O0WIea4H31iTfK1nbYhECfrXSHR2JaMu6AH1brEEhd4b8+ZB1AhG76L23ziN2QEOx1U9Wk1hcYtM9pQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 18 Jan 2023 10:24:57 +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: AQHZJxAYj73pNk7diEiR8Njo5KbmJ66jSxAAgAA5lACAAHG8gIAACS7Q
  • Thread-topic: [PATCH v2 05/40] xen/arm64: prepare for moving MMU related code from head.S

Hi Julien,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: 2023年1月18日 17:50
> To: Wei Chen <Wei.Chen@xxxxxxx>; Penny Zheng <Penny.Zheng@xxxxxxx>; xen-
> devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>; Bertrand Marquis
> <Bertrand.Marquis@xxxxxxx>; Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
> Subject: Re: [PATCH v2 05/40] xen/arm64: prepare for moving MMU related
> code from head.S
> 
> 
> 
> On 18/01/2023 03:09, Wei Chen wrote:
> > Hi Julien,
> >
> >> -----Original Message-----
> >> From: Julien Grall <julien@xxxxxxx>
> >> Sent: 2023年1月18日 7:37
> >> To: Penny Zheng <Penny.Zheng@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> >> Cc: Wei Chen <Wei.Chen@xxxxxxx>; Stefano Stabellini
> >> <sstabellini@xxxxxxxxxx>; Bertrand Marquis <Bertrand.Marquis@xxxxxxx>;
> >> Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
> >> Subject: Re: [PATCH v2 05/40] xen/arm64: prepare for moving MMU related
> >> code from head.S
> >>
> >> Hi Penny,
> >>
> >> On 13/01/2023 05:28, Penny Zheng wrote:
> >>> From: Wei Chen <wei.chen@xxxxxxx>
> >>>
> >>> We want to reuse head.S for MPU systems, but there are some
> >>> code implemented for MMU systems only. We will move such
> >>> code to another MMU specific file. But before that, we will
> >>> do some preparations in this patch to make them easier
> >>> for reviewing:
> >>
> >> Well, I agree that...
> >>
> >>> 1. Fix the indentations of code comments.
> >>
> >> ... changing the indentation is better here. But...
> >>
> >>> 2. Export some symbols that will be accessed out of file
> >>>      scope.
> >>
> >> ... I have no idea which functions are going to be used in a separate
> >> file. So I think they should belong to the patch moving the code.
> >>
> >
> > Ok, I will move these changes to the moving code patches.
> >
> >>>
> >>> Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
> >>
> >> Your signed-off-by is missing.
> >>
> >>> ---
> >>> v1 -> v2:
> >>> 1. New patch.
> >>> ---
> >>>    xen/arch/arm/arm64/head.S | 40 +++++++++++++++++++-----------------
> ---
> >>>    1 file changed, 20 insertions(+), 20 deletions(-)
> >>>
> >>> diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
> >>> index 93f9b0b9d5..b2214bc5e3 100644
> >>> --- a/xen/arch/arm/arm64/head.S
> >>> +++ b/xen/arch/arm/arm64/head.S
> >>> @@ -136,22 +136,22 @@
> >>>            add \xb, \xb, x20
> >>>    .endm
> >>>
> >>> -        .section .text.header, "ax", %progbits
> >>> -        /*.aarch64*/
> >>> +.section .text.header, "ax", %progbits
> >>> +/*.aarch64*/
> >>
> >> This change is not mentioned.
> >>
> >
> > I will add the description in commit message.
> >
> >>>
> >>> -        /*
> >>> -         * Kernel startup entry point.
> >>> -         * ---------------------------
> >>> -         *
> >>> -         * The requirements are:
> >>> -         *   MMU = off, D-cache = off, I-cache = on or off,
> >>> -         *   x0 = physical address to the FDT blob.
> >>> -         *
> >>> -         * This must be the very first address in the loaded image.
> >>> -         * It should be linked at XEN_VIRT_START, and loaded at any
> >>> -         * 4K-aligned address.  All of text+data+bss must fit in 2MB,
> >>> -         * or the initial pagetable code below will need adjustment.
> >>> -         */
> >>> +/*
> >>> + * Kernel startup entry point.
> >>> + * ---------------------------
> >>> + *
> >>> + * The requirements are:
> >>> + *   MMU = off, D-cache = off, I-cache = on or off,
> >>> + *   x0 = physical address to the FDT blob.
> >>> + *
> >>> + * This must be the very first address in the loaded image.
> >>> + * It should be linked at XEN_VIRT_START, and loaded at any
> >>> + * 4K-aligned address.  All of text+data+bss must fit in 2MB,
> >>> + * or the initial pagetable code below will need adjustment.
> >>> + */
> >>>
> >>>    GLOBAL(start)
> >>>            /*
> >>> @@ -586,7 +586,7 @@ ENDPROC(cpu_init)
> >>>     *
> >>>     * Clobbers x0 - x4
> >>>     */
> >>> -create_page_tables:
> >>> +ENTRY(create_page_tables)
> >>
> >> I am not sure about keeping this name. Now we have create_page_tables()
> >> and arch_setup_page_tables().
> >>
> >> I would conside to name it create_boot_page_tables().
> >>
> >
> > Do you need me to rename it in this patch?
> 
> So looking at the rest of the series, I see you are already renaming the
> helper in patch #11. I think it would be better if the naming is done
> earlier.
> 
> That said, I am not convinced that create_page_tables() should actually
> be called externally.
> 
> In fact, you have something like:
> 
>     bl create_page_tables
>     bl enable_mmu
> 
> Both will need a MMU/MPU specific implementation. So it would be better
> if we provide a wrapper to limit the number of external functions.
>

I agree with you, we will try to wrapper some functions instead of
export them.

Cheers,
Wei Chen
 
> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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