All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH early-RFC 0/5] xen/arm: Don't switch TTBR while the MMU is on
@ 2022-03-09 11:20 Julien Grall
  2022-03-09 11:20 ` [PATCH early-RFC 1/5] xen/arm: Clean-up the memory layout Julien Grall
                   ` (4 more replies)
  0 siblings, 5 replies; 33+ messages in thread
From: Julien Grall @ 2022-03-09 11:20 UTC (permalink / raw)
  To: xen-devel
  Cc: marco.solieri, lucmiccio, Julien Grall, Stefano Stabellini,
	Julien Grall, Bertrand Marquis, Volodymyr Babchuk

From: Julien Grall <jgrall@amazon.com>

Hi all,

Currently, Xen on Arm will switch TTBR whilst the MMU is on. This is
similar to replacing existing mappings with new ones. So we need to
follow a break-before-make sequence.

When switching the TTBR, we need to temporary disable the MMU
before update the TTBR. This means the page-tables must contain an
identity mapping.

The current memory layout is not very flexible and has an higher chance
to clash with the identity mapping.

On Arm64, we have plenty of unused virtual address space Therefore, we can
simply reshuffle the layout to leave the first part of the virtual
address space empty.

On Arm32, the virtual address space is already quite full. That said,
we are currently reserving 2GB for the temporary mapping. This is far
too much given those mappings are temporary. It would be sufficient
to only reserve a few MBs.

The Arm32 part is not yet addressed in this version. The series is
sent as an early RFC to gather some feedback on the approach.

After this series, most of Xen page-table code should be compliant
with the Arm Arm. The last two issues I am aware of are:
 - domheap: Mappings are replaced without using the Break-Before-Make
   approach.
 - The cache is not cleaned/invalidated when updating the page-tables
   with Data cache off (like during early boot).

This series is based on "xen/arm: mm: Remove open-coding mappings"
along with some extra small patches. Some of them are already merged.
For convience, I pushed a branch with everything applied:

https://xenbits.xen.org/git-http/people/julieng/xen-unstable.git
branch boot-pt-rework-v1

Note the build for arm32 is likely broken. This will be addressed
on the next version.

Cheers,

Julien GralL (1):
  xen/arm: mm: Introduce helpers to prepare/enable/disable the identity
    mapping

Julien Grall (4):
  xen/arm: Clean-up the memory layout
  xen/arm64: Rework the memory layout
  xen/arm: mm: Rework switch_ttbr()
  xen/arm: smpboot: Directly switch to the runtime page-tables

 xen/arch/arm/arm64/head.S         |  63 ++++++++--------
 xen/arch/arm/include/asm/config.h |  44 +++++++----
 xen/arch/arm/include/asm/mm.h     |   2 +
 xen/arch/arm/mm.c                 | 120 +++++++++++++++++++++++-------
 xen/arch/arm/smpboot.c            |   3 +
 5 files changed, 160 insertions(+), 72 deletions(-)

-- 
2.32.0



^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2022-05-21 15:49 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09 11:20 [PATCH early-RFC 0/5] xen/arm: Don't switch TTBR while the MMU is on Julien Grall
2022-03-09 11:20 ` [PATCH early-RFC 1/5] xen/arm: Clean-up the memory layout Julien Grall
2022-03-17 15:23   ` Bertrand Marquis
2022-03-17 20:32     ` Julien Grall
2022-03-18  8:45       ` Bertrand Marquis
2022-03-09 11:20 ` [PATCH early-RFC 2/5] xen/arm64: Rework " Julien Grall
2022-03-17 20:46   ` Julien Grall
2022-03-25 13:17   ` Bertrand Marquis
2022-03-25 13:35     ` Julien Grall
2022-03-25 14:05       ` Bertrand Marquis
2022-03-25 14:36         ` Julien Grall
2022-05-21 15:49           ` Julien Grall
2022-03-09 11:20 ` [PATCH early-RFC 3/5] xen/arm: mm: Introduce helpers to prepare/enable/disable the identity mapping Julien Grall
2022-03-25 13:32   ` Bertrand Marquis
2022-03-25 13:48     ` Julien Grall
2022-03-25 14:11       ` Bertrand Marquis
2022-03-09 11:20 ` [PATCH early-RFC 4/5] xen/arm: mm: Rework switch_ttbr() Julien Grall
2022-03-12  1:17   ` Stefano Stabellini
2022-03-12 18:20     ` Julien Grall
2022-03-14 23:27       ` Stefano Stabellini
2022-03-12  1:31   ` Stefano Stabellini
2022-03-12 18:54     ` Julien Grall
2022-03-14 23:48       ` Stefano Stabellini
2022-03-15 19:01         ` Julien Grall
2022-03-16 21:58           ` Stefano Stabellini
2022-03-25 13:47   ` Bertrand Marquis
2022-03-25 14:24     ` Julien Grall
2022-03-25 14:35       ` Bertrand Marquis
2022-03-25 14:42         ` Julien Grall
2022-03-25 14:48           ` Bertrand Marquis
2022-04-07 15:38             ` Julien Grall
2022-04-13 14:02               ` Bertrand Marquis
2022-03-09 11:20 ` [PATCH early-RFC 5/5] xen/arm: smpboot: Directly switch to the runtime page-tables Julien Grall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.