xen/arm: Add Armv8-R64 MPU support to Xen - Part#1
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest52 patches 107 repliesIn review
- v240 patches 76 repliesSuperseded
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/52 | xen/arm: remove xen_phys_start and xenheap_phys_end from config.hxen/ | +0 | 0 replies | |
| 2/52 | xen/arm: make ARM_EFI selectable for Arm64xen/ xen/ | +20 | 4 replies | |
| 3/52 | xen/arm: add an option to define Xen start address for Armv8-Rxen/ xen/ | +13 | 7 replies | |
| 4/52 | xen/arm: add .text.idmap in ld script for Xen identity map sectionsxen/ | +1 | 1 reply | |
| 5/52 | xen/arm64: head: Introduce enable_boot_mmu and enable_runtime_mmuxen/ | +70 | 3 replies | |
| 6/52 | xen/arm: introduce CONFIG_HAS_MMUxen/ | +8 | 4 replies | |
| 7/52 | xen/arm64: prepare for moving MMU related code from head.Sxen/ | +21 | 2 replies | |
| 8/52 | xen/arm64: move MMU related code from head.S to mmu/head.Sxen/ xen/ xen/ +1 more | +509 | 6 replies | |
| 9/52 | xen/arm: use PA == VA for EARLY_UART_VIRTUAL_ADDRESS on MPU systemsxen/ | +12 | 2 replies | |
| 10/52 | xen/arm: Move MMU related definitions from config.h to mmu/layout.hxen/ xen/ | +143 | 5 replies | |
| 11/52 | xen/arm: mmu: fold FIXMAP into MMU systemxen/ xen/ | +34 | 4 replies | |
| 12/52 | xen/mmu: extract early uart mapping from setup_fixmapxen/ xen/ | +20 | 4 replies | |
| 13/52 | xen/mmu: extract mmu-specific codes from mm.c/mm.hxen/ xen/ xen/ +11 more | +1216 | 0 replies | |
| 14/52 | xen/mmu: move MMU-specific setup_mm to mmu/setup.cxen/ xen/ xen/ +1 more | +362 | 0 replies | |
| 15/52 | xen: make VMAP only support in MMU systemxen/ xen/ xen/ +7 more | +32 | 6 replies | |
| 16/52 | xen/mmu: relocate copy_from_paddr into setup.cxen/ xen/ | +27 | 0 replies | |
| 17/52 | xen/arm: do not give memory back to static heapxen/ xen/ xen/ +3 more | +35 | 0 replies | |
| 18/52 | xen/arm: only map the init text section RW in free_init_memoryxen/ | +4 | 0 replies | |
| 19/52 | xen/arm: switch to use ioremap_xxx in common filexen/ | +8 | 0 replies | |
| 20/52 | xen/mmu: move MMU specific P2M code to mmu/p2m.c and mmu/p2m.hxen/ xen/ xen/ +2 more | +1744 | 0 replies | |
| 21/52 | xen: introduce CONFIG_HAS_PAGING_MEMPOOLxen/ xen/ xen/ +4 more | +13 | 2 replies | |
| 22/52 | xen/mmu: enable SMMU subsystem only in MMUxen/ | +2 | 0 replies | |
| 23/52 | xen/arm: create mpu/layout.h for MPU related address definitionsxen/ xen/ | +34 | 0 replies | |
| 24/52 | xen/mpu: build up start-of-day Xen MPU memory region mapxen/ xen/ xen/ +3 more | +292 | 9 replies | |
| 25/52 | xen/mpu: introduce helpers for MPU enablementxen/ xen/ | +47 | 0 replies | |
| 26/52 | xen/mpu: map early uart when earlyprintk onxen/ xen/ xen/ +1 more | +48 | 0 replies | |
| 27/52 | xen/mpu: introduce setup_mm_mappingsxen/ xen/ xen/ +3 more | +43 | 4 replies | |
| 28/52 | xen/mpu: plump virt/maddr conversion in MPU systemxen/ | +15 | 5 replies | |
| 29/52 | xen/mpu: introduce a pair helper read_protection_region()/write_protection_region()xen/ xen/ | +205 | 0 replies | |
| 30/52 | xen/mpu: populate a new region in Xen MPU mapping tablexen/ xen/ xen/ +4 more | +381 | 3 replies | |
| 31/52 | xen/mpu: make early_fdt_map support in MPU systemsxen/ xen/ xen/ +2 more | +32 | 10 replies | |
| 32/52 | xen/mpu: implement MPU version of setup_mm in mpu/setup.cxen/ xen/ xen/ +1 more | +99 | 0 replies | |
| 33/52 | xen/mpu: initialize frametable in MPU systemxen/ xen/ xen/ | +44 | 6 replies | |
| 34/52 | xen/mpu: destroy an existing entry in Xen MPU memory mapping tablexen/ xen/ xen/ +1 more | +84 | 2 replies | |
| 35/52 | xen/arm: map static memory on demandxen/ xen/ xen/ +1 more | +43 | 4 replies | |
| 36/52 | xen/mpu: implememt ioremap_xxx in MPUxen/ xen/ xen/ | +195 | 2 replies | |
| 37/52 | xen/mpu: implement MPU version of copy_from_paddrxen/ xen/ xen/ | +38 | 0 replies | |
| 38/52 | xen/mpu: map domain page in MPU systemxen/ xen/ xen/ +1 more | +90 | 0 replies | |
| 39/52 | xen/mpu: support free_init_memory in MPU systemxen/ xen/ | +45 | 0 replies | |
| 40/52 | xen/mpu: implement remove_early_mappings in MPU systemxen/ xen/ xen/ +1 more | +18 | 0 replies | |
| 41/52 | xen/mpu: Use secure hypervisor timer in MPU systemxen/ xen/ | +19 | 0 replies | |
| 42/52 | xen/mpu: implement setup_virt_paging for MPU systemxen/ xen/ xen/ +2 more | +121 | 2 replies | |
| 43/52 | xen/mpu: configure VSTCR_EL2 in MPU systemxen/ xen/ | +22 | 2 replies | |
| 44/52 | xen/mpu: P2M initialization in MPU systemxen/ xen/ xen/ +1 more | +99 | 2 replies | |
| 45/52 | xen/mpu: insert an new entry into guest physmap in MPU systemxen/ xen/ xen/ +2 more | +185 | 1 reply | |
| 46/52 | xen/mpu: look up entry in p2m tablexen/ xen/ xen/ | +93 | 0 replies | |
| 47/52 | xen/mpu: support vcpu context switch in MPU systemxen/ xen/ xen/ +1 more | +73 | 0 replies | |
| 48/52 | xen/mpu: enable MMIO region trap in MPU systemxen/ | +54 | 0 replies | |
| 49/52 | xen/mpu: enable device passthrough in MPU systemxen/ | +10 | 0 replies | |
| 50/52 | xen/mpu: dump debug message in MPU systemxen/ xen/ xen/ +2 more | +69 | 0 replies | |
| 51/52 | xen/mpu: create stubs of function/variables for UNSUPPORTED featuresxen/ xen/ xen/ | +38 | 0 replies | |
| 52/52 | xen/arm: add Kconfig option CONFIG_HAS_MPU to enable MPU system supportxen/ | +13 | 2 replies |
Reviews trailers per patch
2 of 52 patches have a Reviewed-by or Acked-by.
| Patch | Julien Grall |
|---|---|
| 1/52 | A-b |
| 2/52 | R-b |
| 3/52 | |
| 4/52 | |
| 5/52 | |
| 6/52 | |
| 7/52 | |
| 8/52 | |
| 9/52 | |
| 10/52 | |
| 11/52 | |
| 12/52 | |
| 13/52 | |
| 14/52 | |
| 15/52 | |
| 16/52 | |
| 17/52 | |
| 18/52 | |
| 19/52 | |
| 20/52 | |
| 21/52 | |
| 22/52 | |
| 23/52 | |
| 24/52 | |
| 25/52 | |
| 26/52 | |
| 27/52 | |
| 28/52 | |
| 29/52 | |
| 30/52 | |
| 31/52 | |
| 32/52 | |
| 33/52 | |
| 34/52 | |
| 35/52 | |
| 36/52 | |
| 37/52 | |
| 38/52 | |
| 39/52 | |
| 40/52 | |
| 41/52 | |
| 42/52 | |
| 43/52 | |
| 44/52 | |
| 45/52 | |
| 46/52 | |
| 47/52 | |
| 48/52 | |
| 49/52 | |
| 50/52 | |
| 51/52 | |
| 52/52 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 00/52] xen/arm: Add Armv8-R64 MPU support to Xen - Part#1
So sorry for the long long wait before v3 serie, since I got sidetracked to a new high priority internal project for quite a time.
The Armv8-R architecture profile was designed to support use cases that have a high sensitivity to deterministic execution. (e.g. Fuel Injection, Brake control, Drive trains, Motor control etc)
Arm announced Armv8-R in 2013, it is the latest generation Arm architecture targeted at the Real-time profile. It introduces virtualization at the highest security level while retaining the Protected Memory System Architecture (PMSA) based on a Memory Protection Unit (MPU). In 2020, Arm announced Cortex-R82, which is the first Arm 64-bit Cortex-R processor based on Armv8-R64. The latest Armv8-R64 document can be found [1]. And the features of Armv8-R64 architecture:
- An exception model that is compatible with the Armv8-A model
- Virtualization with support for guest operating systems
- PMSA virtualization using MPUs In EL2.
- Adds support for the 64-bit A64 instruction set.
- Supports up to 48-bit physical addressing.
- Supports three Exception Levels (ELs)
- Secure EL2 - The Highest Privilege
- Secure EL1 - RichOS (MMU) or RTOS (MPU)
- Secure EL0 - Application Workloads
- Supports only a single Security state - Secure.
- MPU in EL1 & EL2 is configurable, MMU in EL1 is configurable.
These patch series are implementing the Armv8-R64 MPU support for Xen, which are based on the discussion of "Proposal for Porting Xen to Armv8-R64 - DraftC" [2].
We will implement the Armv8-R64 and MPU support in three stages:
1. Support to boot MMU domains on Armv8-R64 Xen.
2. Support to boot MPU domains on Armv8-R64 Xen.
3. SMP and other advanced features of Xen support on Armv8-R64.
For having a overall undestanding for reviewers about MPU framework on Xen, we have introduced a large patch serie here, including 52 commits. At this stage, we could successfully boot a linux guest on FVP_BaseR_AEMv8R model[3].
We will split these patches to several parts, this series is the part#1, v1 is in [4], the full PoC can be found in [5]. More software for Armv8-R64 can be found in [6];
[1] https://developer.arm.com/documentation/ddi0600/latest
[2] https://lists.xenproject.org/archives/html/xen-devel/2022-05/msg00643.html
[3] https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms/arm-ecosystem-models
[4] https://lists.xenproject.org/archives/html/xen-devel/2022-11/msg00289.html
[5] https://gitlab.com/xen-project/people/weic/xen/-/tree/integration/mpu_v3
[6] https://armv8r64-refstack.docs.arm.com/en/v5.0/
Penny Zheng (41):
xen/arm: introduce CONFIG_HAS_MMU
xen/arm: mmu: fold FIXMAP into MMU system
xen/mmu: extract early uart mapping from setup_fixmap xen/mmu: move MMU-specific setup_mm to mmu/setup.c
xen: make VMAP only support in MMU system
xen/mmu: relocate copy_from_paddr into setup.c
xen/arm: do not give memory back to static heap
xen/arm: only map the init text section RW in free_init_memory xen/arm: switch to use ioremap_xxx in common file xen/mmu: move MMU specific P2M code to mmu/p2m.c and mmu/p2m.h
xen: introduce CONFIG_HAS_PAGING_MEMPOOL
xen/mmu: enable SMMU subsystem only in MMU
xen/mpu: build up start-of-day Xen MPU memory region map xen/mpu: introduce helpers for MPU enablement
xen/mpu: map early uart when earlyprintk on
xen/mpu: introduce setup_mm_mappings
xen/mpu: plump virt/maddr conversion in MPU system xen/mpu: introduce a pair helper
read_protection_region()/write_protection_region()
xen/mpu: populate a new region in Xen MPU mapping table xen/mpu: make early_fdt_map support in MPU systems xen/mpu: implement MPU version of setup_mm in mpu/setup.c xen/mpu: initialize frametable in MPU system
xen/mpu: destroy an existing entry in Xen MPU memory mapping table xen/arm: map static memory on demand
xen/mpu: implememt ioremap_xxx in MPU
xen/mpu: implement MPU version of copy_from_paddr xen/mpu: map domain page in MPU system
xen/mpu: support free_init_memory in MPU system
xen/mpu: implement remove_early_mappings in MPU system xen/mpu: Use secure hypervisor timer in MPU system xen/mpu: implement setup_virt_paging for MPU system xen/mpu: configure VSTCR_EL2 in MPU system
xen/mpu: P2M initialization in MPU system
xen/mpu: insert an new entry into guest physmap in MPU system xen/mpu: look up entry in p2m table
xen/mpu: support vcpu context switch in MPU system xen/mpu: enable MMIO region trap in MPU system
xen/mpu: enable device passthrough in MPU system
xen/mpu: dump debug message in MPU system
xen/mpu: create stubs of function/variables for UNSUPPORTED features xen/arm: add Kconfig option CONFIG_HAS_MPU to enable MPU system
support
Wei Chen (11):
xen/arm: remove xen_phys_start and xenheap_phys_end from config.h xen/arm: make ARM_EFI selectable for Arm64
xen/arm: add an option to define Xen start address for Armv8-R xen/arm: add .text.idmap in ld script for Xen identity map sections xen/arm64: head: Introduce enable_boot_mmu and enable_runtime_mmu xen/arm64: prepare for moving MMU related code from head.S xen/arm64: move MMU related code from head.S to mmu/head.S xen/arm: use PA == VA for EARLY_UART_VIRTUAL_ADDRESS on MPU systems xen/arm: Move MMU related definitions from config.h to mmu/layout.h xen/mmu: extract mmu-specific codes from mm.c/mm.h xen/arm: create mpu/layout.h for MPU related address definitions
xen/arch/arm/Kconfig | 52 +-
xen/arch/arm/Kconfig.debug | 7 +
xen/arch/arm/Makefile | 15 +-
xen/arch/arm/arm32/head.S | 2 +-
xen/arch/arm/arm64/Makefile | 7 +-
xen/arch/arm/arm64/head.S | 472 +-----
xen/arch/arm/arm64/mmu/head.S | 463 ++++++
xen/arch/arm/arm64/{ => mmu}/mm.c | 7 +-
xen/arch/arm/arm64/mpu/head.S | 255 ++++
xen/arch/arm/arm64/smpboot.c | 6 +-
xen/arch/arm/bootfdt.c | 2 +-
xen/arch/arm/domain.c | 2 +
xen/arch/arm/domain_build.c | 2 +
xen/arch/arm/include/asm/arm64/macros.h | 51 +
xen/arch/arm/include/asm/arm64/mm.h | 7 +-
xen/arch/arm/include/asm/arm64/mpu.h | 140 ++
xen/arch/arm/include/asm/arm64/sysregs.h | 76 +
xen/arch/arm/include/asm/config.h | 129 +-
xen/arch/arm/include/asm/cpufeature.h | 7 +
xen/arch/arm/include/asm/early_printk.h | 20 +
xen/arch/arm/include/asm/fixmap.h | 31 +-
xen/arch/arm/include/asm/mm.h | 79 +-
xen/arch/arm/include/asm/mmu/layout.h | 141 ++
xen/arch/arm/include/asm/mmu/mm.h | 54 +
xen/arch/arm/include/asm/mmu/p2m.h | 18 +
xen/arch/arm/include/asm/mpu/layout.h | 32 +
xen/arch/arm/include/asm/mpu/mm.h | 36 +
xen/arch/arm/include/asm/mpu/p2m.h | 18 +
xen/arch/arm/include/asm/p2m.h | 48 +-
xen/arch/arm/include/asm/page.h | 46 +-
xen/arch/arm/include/asm/processor.h | 14 +
xen/arch/arm/include/asm/setup.h | 16 +-
xen/arch/arm/kernel.c | 42 +-
xen/arch/arm/mm.c | 1160 +-------------
xen/arch/arm/mmu/mm.c | 1133 ++++++++++++++
xen/arch/arm/mmu/p2m.c | 1612 +++++++++++++++++++
xen/arch/arm/mmu/setup.c | 379 +++++
xen/arch/arm/mpu/domain_page.c | 68 +
xen/arch/arm/mpu/mm.c | 959 ++++++++++++
xen/arch/arm/mpu/p2m.c | 518 +++++++
xen/arch/arm/mpu/setup.c | 102 ++
xen/arch/arm/p2m.c | 1782 ++--------------------
xen/arch/arm/platforms/Kconfig | 8 +-
xen/arch/arm/setup.c | 388 +----
xen/arch/arm/smpboot.c | 6 +-
xen/arch/arm/traps.c | 97 +-
xen/arch/arm/xen.lds.S | 6 +-
xen/arch/x86/Kconfig | 2 +
xen/arch/x86/setup.c | 2 +
xen/common/Kconfig | 8 +
xen/common/Makefile | 2 +-
xen/common/domctl.c | 2 +
xen/common/vmap.c | 7 +
xen/drivers/passthrough/Kconfig | 3 +-
xen/include/xen/vmap.h | 11 +-
55 files changed, 6730 insertions(+), 3822 deletions(-)
create mode 100644 xen/arch/arm/arm64/mmu/head.S
rename xen/arch/arm/arm64/{ => mmu}/mm.c (97%)
create mode 100644 xen/arch/arm/arm64/mpu/head.S
create mode 100644 xen/arch/arm/include/asm/arm64/mpu.h
create mode 100644 xen/arch/arm/include/asm/mmu/layout.h
create mode 100644 xen/arch/arm/include/asm/mmu/mm.h
create mode 100644 xen/arch/arm/include/asm/mmu/p2m.h
create mode 100644 xen/arch/arm/include/asm/mpu/layout.h
create mode 100644 xen/arch/arm/include/asm/mpu/mm.h
create mode 100644 xen/arch/arm/include/asm/mpu/p2m.h
create mode 100644 xen/arch/arm/mmu/mm.c
create mode 100644 xen/arch/arm/mmu/p2m.c
create mode 100644 xen/arch/arm/mmu/setup.c
create mode 100644 xen/arch/arm/mpu/domain_page.c
create mode 100644 xen/arch/arm/mpu/mm.c
create mode 100644 xen/arch/arm/mpu/p2m.c
create mode 100644 xen/arch/arm/mpu/setup.cSignature · 1 line
2.25.1