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

Re: [PATCH v3 08/52] xen/arm64: move MMU related code from head.S to mmu/head.S


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <penny.zheng@xxxxxxx>
  • Date: Thu, 6 Jul 2023 14:47:27 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); 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=f5b5E1cMVzF6B/zdq+/OZfX8IFK2i/XNLsgy4hp3eME=; b=cDQklGBfmfACV9aLAbfrsfwrf0+zHgo4T35aQfQRIZOc8p4nmrmZSxWYo6Ad1sQJA23KJS2nh/0b0m7enuP79zf9vAIgruW59BicEOWtGp+6vACUPZ5WDIRgs/hv4VCe/dN4SzxlKBBED8AiL/X5uhyzMGgl1Tthkmhh5EGM3W8ylCAlLnty+PGO9KUBUR1TcdNSpTnjup0/IZYMb1CHiLfcdpOuX/Z/ZkqYbNeX8zBIZYEo5O0uqg2PlheVTAd/+tnQBUHU/0nMd7kTg2pryNoOmfg4V5FkJS7i6ALFMTX/yag9THr9bbT9FXIlKEfv+OpCTPQ0K1+tNM+ggJgmpA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=czg3lUr/E68EQoSlbgtZAOahwsDRehd9jnBvL1aL54GpH0a8Ej7vZVpvUvyVmQrZ8ADmXfvihVMCMMM1Z1UDr4XeF1gJ7c/tX8+3uact+AA7+NG9w9sma+3NP/5eK1ZDCYZsLzBU1Vbsz50sL0mZniQr/xK6M4tej5kgPZmGYjwvs2A0yaTDp9lRAshgVCf5DV5UlvUiaojxpp9rDnynA5mTt0w55XFsK9HYD2geh7nieKwTGAA+UAt0C/BopvgkFnvh+s1M9Rj0lCK9cDuBHm+jw1rj5/DdzIxHxkvcaLiPgOemcA2BEliFk0XpKPotNM7+4/PvaklyOhwS1yqv8w==
  • Cc: Wei Chen <wei.chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 06 Jul 2023 06:47:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

Hi Julien

On 2023/7/5 18:43, Julien Grall wrote:
Hi Penny,

One more remark.

On 26/06/2023 04:33, Penny Zheng wrote:
From: Wei Chen <wei.chen@xxxxxxx>

There are lots of MMU specific code in head.S. This code will not
be used in MPU systems. If we use #ifdef to gate them, the code
will become messy and hard to maintain. So we move MMU related
code to mmu/head.S, and keep common code still in head.S. We also
add .text.idmap in mmu/head.S to make all code in this new file
are still in identity map page but will be linked after head.S.

As "fail" in head.S is very simple and this name is too easy to
be conflicted, so duplicate it in mmu/head.S instead of exporting
it.

And some assembly macros that will be shared by MMU and MPU later,
we move them to macros.h.

Rename enable_boot_mmu()/enable_runtime_mmu() to a more generic name
enable_boot_mm()/enable_runtime_mm(), in order to make them common interfaces
to be used for both MMU and later MPU system.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
---
v1 -> v2:
1. Move macros to macros.h
2. Remove the indention modification
3. Duplicate "fail" instead of exporting it.
---
v3:
- Rename enable_boot_mmu()/enable_runtime_mmu() to a more generic name
enable_boot_mm()/enable_runtime_mm()
---
  xen/arch/arm/arm64/Makefile             |   3 +
  xen/arch/arm/arm64/head.S               | 469 +-----------------------
  xen/arch/arm/arm64/mmu/head.S           | 453 +++++++++++++++++++++++
  xen/arch/arm/include/asm/arm64/macros.h |  51 +++
  4 files changed, 509 insertions(+), 467 deletions(-)
  create mode 100644 xen/arch/arm/arm64/mmu/head.S

diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile
index 54ad55c75c..0c4b177be9 100644
--- a/xen/arch/arm/arm64/Makefile
+++ b/xen/arch/arm/arm64/Makefile
@@ -8,6 +8,9 @@ obj-y += domctl.o
  obj-y += domain.o
  obj-y += entry.o
  obj-y += head.o
+ifeq ($(CONFIG_HAS_MMU),y)
+obj-y += mmu/head.o
+endif

You could use obj-$(CONFIG_HAS_MMU) += mmu/head.o.

But in this case, I would rather prefer if we match how other subdirectory are added. I.e. on the parent's directory Makefile you add:

obj-$(CONFIG_MMU) += mmu/

And in the directory you add a Makefile which list the files to compile.


Understood. thanks for the instruction.

Cheers,




 


Rackspace

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