Hi Penny,

On 13/01/2023 05:28, Penny Zheng wrote:
At the moment, on MMU system, enable_mm() 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 to remove all 1:1 mapping.

Since remove_identity_mapping() is not necessary on MPU system, and we also
avoid creating empty function for MPU system, trying to keep only one codeflow
in arm64/head.S, we move path switch and remove_identity_mapping() in
enable_mm() on MMU system.

AFAICT, remove_identity_mapping() is still using ENTRY(). But you could avoid to introduce ENTRY() if you re-order your series so this patch happens before the MMU specific code is moved in a separate helper.


Signed-off-by: Penny Zheng <penny.zh...@arm.com>
Signed-off-by: Wei Chen <wei.c...@arm.com>
---
  xen/arch/arm/arm64/head.S     | 28 +++++++++++++---------------
  xen/arch/arm/arm64/head_mmu.S | 33 ++++++++++++++++++++++++++++++---
  2 files changed, 43 insertions(+), 18 deletions(-)

This will need to be rebased on top of [1] (which will be merged pretty soon). There are two main differences:

 1) enable_mmu has an extra parameter to take the root page-tables
 2) the remove_identity_mapping should only be called for the boot CPU.

So I think we want to introduce two functions:
 1) enable_boot_mmu
 2) enable_runtime_mmu

You might need the same for the MPU as I would expect it would be per-CPU.

Cheers,

[1] 20230127195508.2786-1-jul...@xen.org

--
Julien Grall

Reply via email to