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

RE: [PATCH v4 01/13] xen/arm64: head.S: Introduce enable_{boot,secondary}_cpu_mm


  • To: Ayan Kumar Halder <ayankuma@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Mon, 7 Aug 2023 11:35:03 +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=g9Xh2J+G7yaEExzXYEPJ4NEpZIPbtKmtGktwx/+Ubao=; b=SXnuxvq2pGvWXk0dP4pDVhirtr2PSjp4h4WNuGjxei51ezoxMJFx/FVra9umCiOgJBK6ENfTdKvBsu/xZcrxcVx7+UydJeyw91QuG3Lvk/db6KeFYKn94gf7XOCLXUZZiL1+/ccM4q2WTxW0otLE8bjdqLrguAd7Lkf7Y0onWSeONKB2ek56fkAAf0x59LUH4AVZ/5sekS49vVQ5WlCtAZdRNgcVBFQaM6fr4wSAwVOmDeoDdNygVNjYGsyEZIRfWhqBvq6Jb6GxACncpcU/w6mlS8YH19VfUG05TO3b7hasQl2MN57zIVdGJ/inRVOssKPesABQ3mVTI8qdd33Dzw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZU0oHg7W/QhaqWt1x+7uBaTNP0dGAbbjnJYD+Tei9qAdy75x1n1Nl1K22CQfEy8js92Q7AK3gq0MAqAUQoc/tY0V7HrKFU7AU9qYWGQEMvJ6g6XP39KitF4Q5vanYyh6oevBWfLvA2EKDZP/faqX3v38oSP+BD1yxbj5BbegKCG+CyqiDqfUeJTzTrI/ZUEV1Nl7mQUAxKgrYgpHKNkjgAMc2CEj0Lmeqp46CS2PsFEkGbLFuEt1DoecIcIxuNWoXhbapbXXpsN3sszPFoFIzOYxmdnIOABoHw5wG7nThu/8jbxJI2twy9c0MlCwql8V8RKr1ZJzm3SitzTaPXyC7w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>
  • Delivery-date: Mon, 07 Aug 2023 11:35:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHZxCqBtZIUxf7FmUaIEyO8EPs3TK/euu6AgAABikA=
  • Thread-topic: [PATCH v4 01/13] xen/arm64: head.S: Introduce enable_{boot,secondary}_cpu_mm

Hi Ayan,

> -----Original Message----- 
> Hi Henry,
> 
> > At the moment, on MMU system, enable_mmu() will return to an
> > address in the 1:1 mapping, then each path is responsible to
> > switch to virtual runtime mapping. Then remove_identity_mapping()
> > is called on the boot CPU to remove all 1:1 mapping.
> >
> > Since remove_identity_mapping() is not necessary on Non-MMU system,
> > and we also avoid creating empty function for Non-MMU system, trying
> > to keep only one codeflow in arm64/head.S, we move path switch and
> > remove_identity_mapping() in enable_mmu() on MMU system.
> >
> > As the remove_identity_mapping should only be called for the boot
> > CPU only, so we introduce enable_boot_cpu_mm() for boot CPU and
> > enable_secondary_cpu_mm() for secondary CPUs in this patch.
> >
> > Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
> > Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
> > Signed-off-by: Henry Wang <Henry.Wang@xxxxxxx>
> 
> With two comments
> 
> Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
> 
> Tested-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>

Thanks, and...

> 
> > +/*
> > + * Enable mm (turn on the data cache and the MMU) for secondary CPUs.
> > + * The function will return to the virtual address provided in LR (e.g. the
> > + * runtime mapping).
> > + *
> > + * Inputs:
> > + *   lr : Virtual address to return to.
> > + *
> > + * Clobbers x0 - x5
> > + */
> > +enable_secondary_cpu_mm:
> I will prefer "enable_secondary_cpu_mmu" as it is MMU specific. And ...

...actually this as well as...

> > +/*
> > + * Enable mm (turn on the data cache and the MMU) for the boot CPU.
> > + * The function will return to the virtual address provided in LR (e.g. the
> > + * runtime mapping).
> > + *
> > + * Inputs:
> > + *   lr : Virtual address to return to.
> > + *
> > + * Clobbers x0 - x5
> > + */
> > +enable_boot_cpu_mm:
> 
> prefer "enable_boot_cpu_mmu" as it is MMU specific as well.

...this, are the name suggested by Julien in [1], so probably I will stick
to these names, unless he would prefer the proposed names. I would
personally prefer the names that Julien suggested too, because from
the comments above these two functions, these functions not only
enable the MMU, but also turn on the d-cache, hence a more generic
name (using "mm"), is more appropriate here I guess.

[1] 
https://lore.kernel.org/xen-devel/c10bc254-ad79-dada-d5fb-9ee619934ffb@xxxxxxx/

Kind regards,
Henry

> 
> - Ayan

 


Rackspace

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