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

Re: [PATCH v2 14/40] xen/arm64: head: Jump to the runtime mapping in enable_mm()



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.zheng@xxxxxxx>
Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
  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-julien@xxxxxxx

--
Julien Grall



 


Rackspace

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