When implementing MPU version of copy_from_paddr, if source physical address
is not accessible, we shall map it temporarily with a transient MPU
memory region for copying and pasting.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- new patch
---
xen/arch/arm/include/asm/mpu/mm.h
void lots of #ifdef in memory management code
and header files.
Signed-off-by: Wei Chen
Signed-off-by: Penny Zheng
---
v2:
- new patch
---
v3:
- introduce new directories: mmu/ which includes MMU-specific codes
- rename init_ttbr to init_mm, mmu_init_secondary_cpu() to
mm_init_seco
on through PRENR_EL2 which provides direct access to the
PRLAR_EL2.EN bits of EL2 MPU regions.
Rignt now, we only support destroying a *WHOLE* MPU memory region,
part-region removing is not supported, as in worst case, it will
leave two fragments behind.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Ch
to PAGE_SIZE,
or we may map more than necessary in MPU system.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- map the early UART with a hardcoded MPU memory region
- error when uart size doesn't align with PAGE_SIZE
---
xen/arch/arm/Kconfig.debug | 7 +++
xen/arch
with new Kconfig
CONFIG_HAS_PAGING_MEMPOOL in common codes.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- new patch
---
xen/arch/arm/Kconfig| 1 +
xen/arch/arm/domain.c | 2 ++
xen/arch/arm/domain_build.c | 2 ++
xen/arch/arm/p2m.c | 2 ++
xen/arch/x86
and new setup_fixmap.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- new patch
---
xen/arch/arm/arm64/head.S | 3 +++
xen/arch/arm/arm64/mmu/head.S | 24 +---
2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch
hich determines VMID for the
EL1-Guest-OS.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- new commit
---
xen/arch/arm/include/asm/mpu/mm.h | 3 ++
xen/arch/arm/include/asm/p2m.h| 5 +++
xen/arch/arm/mpu/mm.c | 22 ++
xen/arch/arm/mpu/p2m.c
flow unchanged.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- alias CNTHP_*_EL2 to CNTHPS_*_EL2 to avoid renaming
---
xen/arch/arm/Kconfig | 4
xen/arch/arm/include/asm/arm64/sysregs.h | 15 +++
2 files changed, 19 insertions(+)
diff --git a/xen
modification is not supported, as in worst case, it will
leave three fragments behind.
In MPU system, we map init text and init data section, each with a MPU memory
region. So we shall destroy it seperately in free_init_memory().
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3
.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- select ARCH_MAP_DOMAIN_PAGE and ARM_SECURE_STATE
- remove platform-specific config: CONFIG_ARM_V8R
---
xen/arch/arm/Kconfig | 14 +-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/xen/arch/arm/Kconfig b/xen
SMMU subsystem is only supported in MMU system, so we make it dependent
on CONFIG_HAS_MMU.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- new patch
---
xen/drivers/passthrough/Kconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/xen/drivers/passthrough
As we are not introduing features like SMP, SET/WAY emulation, etc,
in MPU system, so we create empty stubs of function/variables and
warnings for these UNSUPPORTED features.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- new commit
---
xen/arch/arm/arm64/mpu/head.S | 6
virtual address to remove the mapping.
As it is not workable for MPU, we pass the FDT physical address
in remove_early_mappings() for MPU to destroy the mapping.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- adapt to the change of mapping FDT in two 2MB chunks if needed
---
xen/arch
Function p2m_lookup() is responsible for looking up an entry in p2m
table. In MPU system, We check whether mapping exists. If it does, we
get the details of the guest MPU memory region in domain P2M table(p2m->root)
through p2m_get_mpu_region()
Signed-off-by: Penny Zheng
Signed-off-by: Wei C
do_mmio_trap_stage2_abort_guest().
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- new commit
---
xen/arch/arm/traps.c | 81 +---
1 file changed, 54 insertions(+), 27 deletions(-)
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index ef5c6a8195..bffa147c36
EL1/EL0 and EL2
- VMSAv8-64 at EL1/EL0 and PMSAv8-64 at EL2
The default option will be the second, unless the platform could not support,
which could be checked against MSA_frac bit in Memory Model Feature Register 0(
ID_AA64MMFR0_EL1).
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3
follow the
rule of "map in demand" in MPU, we implement MPU version of ioremap_xxx,
through mapping the memory with a transient MPU memory region.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- adapt to the new rule of "map in demand"
---
xen/arch/arm/include/a
frametable is successfully initialized, the convertion between machine frame
number/machine address/"virtual address" and page-info structure is
ready too, like mfn_to_page/maddr_to_page/virt_to_page, etc
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- add ASSERT() to conf
In free_init_memory, we do not need to map the whole init section RW,
as only init text section is mapped RO in boot time.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
v3:
- new commit
---
xen/arch/arm/mm.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git
with CONFIG_HAS_MPU to gate these definitions will result
in a messy and hard-to-read/maintain code.
So we keep some common definitions still in config.h, but move MMU
related definitions to a new file - mmu/layout.h to avoid spreading
"#ifdef" everywhere.
Signed-off-by: Wei Chen
Signed-off
of code comments.
2. Fix the indentations for .text.header section.
3. Rename puts() to asm_puts() for global export
Signed-off-by: Wei Chen
Signed-off-by: Penny Zheng
---
v1 -> v2:
1. New patch.
---
v3:
1. fix commit message
2. Rename puts() to asm_puts() for global export
---
xen/arch/
red 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
Signed-off-by: Penny Zheng
---
v
script, we force the .text.idmap contents to linked
after .text.header. This will ensure code of head.S always be
at the top of Xen binary.
Signed-off-by: Wei Chen
Signed-off-by: Penny Zheng
---
v1 -> v2:
1. New patch.
---
v3:
1. adapt to changes to "_end_boot"
---
xen/arch/arm/xen.l
we add !HAS_MPU dependency for these platforms.
Signed-off-by: Wei Chen
Signed-off-by: Penny Zheng
---
v1 -> v2:
1. Remove the platform header fvp_baser.h.
2. Remove the default start address for fvp_baser64.
3. Remove the description of default address from commit log.
4. Change HAS_
enable_boot_mmu for boot CPU and
enable_runtime_mmu for secondary CPUs in this patch.
Signed-off-by: Wei Chen
Signed-off-by: Penny Zheng
---
v3:
- new patch
---
xen/arch/arm/arm64/head.S | 87 +++
1 file changed, 70 insertions(+), 17 deletions(-)
diff --git
From: Wei Chen
These two variables are stale variables, they only have declarations
in config.h, they don't have any definition and no any code is using
these two variables. So in this patch, we remove them from config.h.
Signed-off-by: Wei Chen
Signed-off-by: Penny Zheng
Acked-by: Julien
-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: mm
make ARM_EFI selectable for Arm64, and
based on that, we can use CONFIG_ARM_EFI to gate the EFI
specific code in head.S for those images that will not be
booted in EFI environment.
Signed-off-by: Wei Chen
Signed-off-by: Penny Zheng
---
v1 -> v2:
1. New patch
---
v3:
1. doc fix
---
xen/arch/
This is a design doc for GICv4.0 vLPI support.
Signed-off-by: Penny Zheng
---
docs/designs/gicv4_vlpi.md | 333 +
1 file changed, 333 insertions(+)
create mode 100644 docs/designs/gicv4_vlpi.md
diff --git a/docs/designs/gicv4_vlpi.md b/docs/designs
Hi,
Sorry for the late reply. Got sidetracked by other tasks...
On 2023/1/19 22:20, Julien Grall wrote:
Hi,
On 13/01/2023 05:28, Penny Zheng wrote:
From: Wei Chen
Xen defines some global configuration macros for Arm in
config.h. We still want to use it for Armv8-R systems
references for foreign superpages.
Signed-off-by: Penny Zheng
---
v1 -> v2:
- new commit
---
xen/arch/arm/p2m.c | 60 +-
1 file changed, 44 insertions(+), 16 deletions(-)
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 948f199d84..e8fa61f
em-1",
not "0x1".
Signed-off-by: Penny Zheng
---
v1 -> v2:
- no new changes
---
docs/misc/arm/device-tree/booting.txt | 52 ---
1 file changed, 39 insertions(+), 13 deletions(-)
diff --git a/docs/misc/arm/device-tree/booting.txt
b/docs/misc/arm/device-
;shm_memnode" as function parameter to replace them all, to make codes more
clear and tidy.
Signed-off-by: Penny Zheng
---
v1 -> v2:
- combine commits 4 - 6 in Serie 1
- Adapt to changes of introducing "struct shm_memnode"
---
xen/arch/arm/domain_build.c | 222 ++
use "remove_shm_from_rangeset" to remove static shm.
For direct-map domain with iommu off, as static shm has already been taken
care of through reserved memory banks, we do nothing.
Signed-off-by: Penny Zheng
---
v1 -> v2:
- new commit
---
xen/arch/arm/domain_build.c | 94 +++
nd clear, we extract codes about parsing
"xen,shared-mem" property from function "process_shm" and move them into
a new helper "parse_shm_property".
Signed-off-by: Penny Zheng
---
v1 -> v2
- In order to get allocated banked host memory info during domain
rs.
This commit defines callback "retrieve_meminfo" for data structure
"struct meminfo".
Signed-off-by: Penny Zheng
---
v1 -> v2:
- define a set of MACRO helpers to access common fields in data structure of
"meminfo" type. "struct meminfo" is one of them, and
tructure that contains SHMID and a "struct membank membank"
describing shared memory regions in guest address space, is created in "kinfo"
when dealing with domain information.
Signed-off-by: Penny Zheng
---
v1 -> v2:
- As the original "struct shm_membank" was m
/lore.kernel.org/all/20220908135513.1800511-1-penny.zh...@arm.com/
[2]
https://www.kernel.org/doc/Documentation/devicetree/bindings/reserved-memory/xen%2Cshared-memory.txt
Penny Zheng (8):
xen/arm: remove stale addr_cells/size_cells in assign_shared_memory
xen/arm: re-define a set of data s
Function parameters {addr_cells,size_cells} are stale parameters in
assign_shared_memory, so we shall remove them.
Signed-off-by: Penny Zheng
---
v1 -> v2:
- new commit
---
xen/arch/arm/domain_build.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/xen/arch/arm/domain_build.c b/xen/a
> -Original Message-
> From: Stewart Hildebrand
> Sent: Wednesday, February 8, 2023 4:55 AM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Julien Grall ; Bertrand Marquis
> ; Volodymyr Babchuk
>
> Subject: Re: [
Hi Julien
> -Original Message-
> From: Julien Grall
> Sent: Monday, February 6, 2023 6:11 PM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk
> Subject: Re: [PATCH v2 20/40] xen/
Hi Julien
> -Original Message-
> From: Julien Grall
> Sent: Monday, February 6, 2023 5:46 AM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk
> Subject: Re: [PATCH v2 19/40] xen/mp
Hi Julien
> -Original Message-
> From: Julien Grall
> Sent: Monday, February 6, 2023 5:32 AM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk
> Subject: Re: [PATCH v2 1
Hi,
> -Original Message-
> From: Julien Grall
> Sent: Monday, February 6, 2023 5:30 AM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk
> Subject: Re: [PATCH v2 15/40] xen/arm:
Hi, Julien
> -Original Message-
> From: Julien Grall
> Sent: Thursday, February 2, 2023 6:58 PM
> To: Penny Zheng ; xen-devel@lists.xenproject.org;
> Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> ayan.kumar.hal...@xilinx.com
> Cc: Volodymyr Babchuk
>
Hi Julien,
> -Original Message-
> From: Julien Grall
> Sent: Thursday, February 2, 2023 2:57 AM
> To: Penny Zheng ; xen-devel@lists.xenproject.org;
> Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> ayan.kumar.hal...@xilinx.com
> Cc: Volodymyr Babchuk
>
> -Original Message-
> From: Julien Grall
> Sent: Thursday, February 2, 2023 3:27 AM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk
> Subject: Re: [PATCH v2 13/40] xen/mpu: in
Hi Julien,
> -Original Message-
> From: Julien Grall
> Sent: Tuesday, January 31, 2023 5:28 PM
> To: Penny Zheng ; xen-devel@lists.xenproject.org;
> Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> ayan.kumar.hal...@xilinx.com
> Cc: Volodymyr Babchuk
> S
Hi Julien
> -Original Message-
> From: Julien Grall
> Sent: Tuesday, January 31, 2023 5:42 PM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk
> Subject: Re: [PATCH v2 13/40] xe
Hi Julien
> -Original Message-
> From: Julien Grall
> Sent: Monday, January 30, 2023 6:00 PM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk
> Subject: Re: [PATCH v2 13/40] xe
Hi Julien
> -Original Message-
> From: Julien Grall
> Sent: Monday, January 30, 2023 5:40 PM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk
> Subject: Re: [PATCH v2 11/40] xen/mp
Hi, Julien
> -Original Message-
> From: Julien Grall
> Sent: Sunday, January 29, 2023 3:43 PM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk
> Subject: Re: [PATCH v2 13/40] xe
> -Original Message-
> From: Julien Grall
> Sent: Sunday, January 29, 2023 3:37 PM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk
> Subject: Re: [PATCH v2 11/40] xen/mpu: build
Hi Ayan
> -Original Message-
> From: Ayan Kumar Halder
> Sent: Thursday, January 19, 2023 6:19 PM
> To: xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Penny Zheng
> ; Stefano Stabellini ; Julien
> Grall ; Bertrand Marquis ;
> volodymyr_babc...@epam.com
> S
> -Original Message-
> From: Julien Grall
> Sent: Wednesday, January 25, 2023 3:09 AM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk
> Subject: Re: [PATCH v2 13/40] xen/mpu: in
> -Original Message-
> From: Julien Grall
> Sent: Thursday, January 19, 2023 11:04 PM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk
> Subject: Re: [PATCH v2 11/40] xen/mpu: build
Hi Julien
> -Original Message-
> From: Julien Grall
> Sent: Monday, January 9, 2023 6:58 PM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk
> Subject: Re: [PATCH v1 06/13] xen/a
> -Original Message-
> From: Julien Grall
> Sent: Friday, January 13, 2023 6:07 PM
> To: Penny Zheng ; xen-devel@lists.xenproject.org
> Cc: Wei Chen ; Stefano Stabellini
> ; Bertrand Marquis ;
> Volodymyr Babchuk ; Julien Grall
>
> Subject: Re: [PATC
of remove_early_mappings, we destroy MPU memory
region of early FDT mapping.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/mm_mpu.c| 4
xen/arch/arm/setup.c | 25 -
xen/arch/arm/setup_mmu.c | 25 +
xen/arch/arm
lso introduces "#mpu,guest-memory-section" as an example, for
limiting the scattering of static memory as guest RAM.
Guest RAM shall be not only statically configured through "xen,static-mem"
property in MPU system, but also shall be defined inside
outside "mpu,guest-memory-
guests' boot mudules.
Users shall make sure that any guest boot module defined in Device Tree is
within the section, including kernel module(BOOTMOD_KERNEL), device tree
passthrough module(BOOTMOD_GUEST_DTB), and ramdisk module(BOOTMOD_RAMDISK).
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
idle vcpu entering.
We introduce a bit in region "region.prlar.sw"(struct pr_t region) to
indicate this kind of feature.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/include/asm/arm64/mpu.h | 14 ++---
xen/arch/arm/mm_mpu.c| 47 +++
From: Wei Chen
As we have not implmented guest support in part#1 series of MPU
support, Xen can not create any guest in boot time. So in this
patch we make Xen boot to idle on MPU system for reviewer to
test part#1 series.
THIS PATCH IS ONLY FOR TESTING, NOT FOR REVIEWING.
Signed-off-by: Wei
the default memory map of the Armv8-R AArch64 architecture is
IMPLEMENTATION DEFINED, we always turn off the Background region.
In this patch, we also introduce a neutral name enable_mm for
Xen to enable MMU/MPU. This can help us to keep one code flow
in head.S
Signed-off-by: Penny Zheng
Signed
in this patch, we disable VMAP for MPU systems, and some
features depending on VMAP also need to be disabled at the same
time, Like ALTERNATIVE, CPU ERRATA.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/Kconfig | 3 +-
xen/arch/arm/Makefile | 2
xenheap, and some components could not be applied in MPU system,
like direct-mapping.
In the commit, we move setup_mm and its related functions and
variables to setup_mmu.c in preparation of implementing MPU
version of setup_mm later in future commits
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
for copy_from_paddr in MPU system,
we need to check whether a given paddr is properly mapped.
Signed-off-by: Wei Chen
Signed-off-by: Penny Zheng
---
xen/arch/arm/kernel.c | 2 +-
xen/arch/arm/mm_mpu.c | 21 +
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/xen/arch
in the
front, and switching ones in the heels of them.
We define a MPU memory region mapping table(sw_mpumap) to store all
switching regions. After disabling them at its original position, we
re-enable them at re-ordering position.
Signed-off-by: Penny Zheng
---
xen/arch/arm/include/asm/arm64/mpu.h | 5
not support,
which could be checked against MSA_frac bit in Memory Model Feature Register 0(
ID_AA64MMFR0_EL1)
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/include/asm/arm64/sysregs.h | 6 ++
xen/arch/arm/include/asm/cpufeature.h| 7 ++
xen/arch/arm/include/asm/p2m.h
ugh module(BOOTMOD_GUEST_DTB), and ramdisk module(BOOTMOD_RAMDISK).
We also shall check if any guest RAM through "xen,static-mem" is within
the guest memory section.
Function mpu_memory_section_contains is introduced to do above check.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Che
for MPU system
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/Kconfig | 3 ++-
xen/arch/arm/include/asm/fixmap.h | 28 +---
xen/common/Kconfig| 3 +++
3 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/xen/arch
on through PRENR_EL2 which provides direct access to the
PRLAR_EL2.EN bits of EL2 MPU regions.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/include/asm/arm64/mpu.h | 20 ++
xen/arch/arm/include/asm/arm64/sysregs.h | 3 +
xen/arch/arm/mm_mpu.c
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.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/arm64/head.S | 28
ration is accessible through PRBAR0_EL2 and PRLAR0_EL2
- Region 17 configuration is accessible through PRBAR1_EL2 and PRLAR1_EL2
- Region 18 configuration is accessible through PRBAR2_EL2 and PRLAR2_EL2
- ...
- Region 31 configuration is accessible through PRBAR15_EL2 and PRLAR15_EL2
Signed-off-by: Penny
ccessfully initialized, the convertion between machine frame
number/machine address/"virtual address" and page-info structure is
ready too, like mfn_to_page/maddr_to_page/virt_to_page, etc
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/include/asm/mm.h | 15 -
modify_xen_mappings is introduced to modify permission of the
existing valid MPU memory region.
Then we nuke the instruction cache to remove entries related to init
text.
At last, we destroy these two MPU memory regions referring init text and
init data using destroy_xen_mappings.
Signed-off-by: Penny Zheng
Signed
and permission for common combinations.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/include/asm/arm64/mpu.h | 72 +++
xen/arch/arm/mm_mpu.c| 276 ++-
2 files changed, 340 insertions(+), 8 deletions(-)
diff --git a/xen/arch/arm
In MMU system, we map the UART in the fixmap (when earlyprintk is used).
However in MPU system, we map the UART with a transient MPU memory
region.
So we introduce a new unified function setup_early_uart to replace
the previous setup_fixmap.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
From: Wei Chen
Xen defines some global configuration macros for Arm in
config.h. We still want to use it for Armv8-R systems, but
there are some address related macros that are defined for
MMU systems. These macros will not be used by MPU systems,
Adding ifdefery with CONFIG_HAS_MPU to gate
here we only add a check to verify this assumption.
But for tolerating a few cases where the function is called to map for
temporary copy and paste, like ioremap_wc in kernel image loading, the
region attribute mismatch will be treated as warning than error.
Signed-off-by: Penny Zheng
Signed-off
also move MMU-specific definitions to p2m_mmu.h, like P2M_ROOT_LEVEL and
function p2m_tlb_flush_sync.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/Makefile |5 +
xen/arch/arm/include/asm/p2m.h | 17 +-
xen/arch/arm/include/asm/p2m_mmu.h | 28 +
xen
the other static
memory section mapping will be introduced later.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/Makefile | 2 +
xen/arch/arm/include/asm/mm_mpu.h | 5 +++
xen/arch/arm/mm_mpu.c | 41 ++
xen/arch/arm/setup_mpu.c
, to avoid MPU memory
region overlapping.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/include/asm/arm64/mpu.h | 6 --
xen/arch/arm/include/asm/setup.h | 1 +
xen/arch/arm/mm_mpu.c| 14 +-
xen/arch/arm/setup_mpu.c | 5
in memory management code and header files.
Signed-off-by: Wei Chen
Signed-off-by: Penny Zheng
---
xen/arch/arm/Makefile |5 +
xen/arch/arm/include/asm/mm.h | 19 +-
xen/arch/arm/include/asm/mm_mmu.h | 35 +
xen/arch/arm/mm.c | 1352
Introduce a Kconfig option to enable Armv8-R64 architecture
support. STATIC_MEMORY and HAS_MPU will be selected by
ARM_V8R by default, because Armv8-R64 only has PMSAv8-64 on secure-EL2
and only supports statically configured system.
Signed-off-by: Wei Chen
---
xen/arch/arm/Kconfig | 13
address as the output.
We should overide virt_to_mfn/mfn_to_virt in source file mm_mpu.c the
same way in mm_mmu.c.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/include/asm/mm.h | 26 --
xen/arch/arm/include/asm/mm_mmu.h | 26
code flow unchanged.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/Kconfig | 7 +++
xen/arch/arm/include/asm/arm64/sysregs.h | 21 -
xen/arch/arm/include/asm/cpregs.h| 4 ++--
xen/arch/arm/time.c | 14
add . = ALIGN(PAGE_SIZE); in the head of dtb section to make it happen.
In this commit, we map early FDT with a transient MPU memory region at
rear with REGION_HYPERVISOR_BOOT.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/include/asm/arm64/mpu.h | 5 +++
xen/arch/arm
generic name, is introduced and act as an empty stub in
MPU system.
Signed-off-by: Penny Zheng
Signed-off-by: Wei Chen
---
xen/arch/arm/include/asm/mm.h | 2 ++
xen/arch/arm/include/asm/mm_mpu.h | 16
xen/arch/arm/setup.c | 2 +-
3 files changed, 19 insertions
From: Penny Zheng
The start-of-day Xen MPU memory region layout shall be like as follows:
xen_mpumap[0] : Xen text
xen_mpumap[1] : Xen read-only data
xen_mpumap[2] : Xen read-only after init data
xen_mpumap[3] : Xen read-write data
xen_mpumap[4] : Xen BSS
..
xen_mpumap[max_xen_mpumap - 2
From: Wei Chen
copy_from_paddr will map a page to Xen's FIXMAP_MISC area for
temporary access. But for those systems do not support VMSA,
they can not implement set_fixmap/clear_fixmap, that means they
can't always use the same virtual address for source address.
In this case, we introduce to
From: Wei Chen
There is no VMSA support on Armv8-R AArch64, so we can not map early
UART to FIXMAP_CONSOLE. Instead, we use PA == VA to define
EARLY_UART_VIRTUAL_ADDRESS on Armv8-R AArch64.
Signed-off-by: Wei Chen
---
1. New patch
---
xen/arch/arm/include/asm/early_printk.h | 12
From: Wei Chen
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 head_mmu.S, and keep common code still in head.S.
And some assembly macros that
From: Wei Chen
Only the first 4KB of Xen image will be mapped as identity
(PA == VA). At the moment, Xen guarantees this by having
everything that needs to be used in the identity mapping
in head.S before _end_boot and checking at link time if this
fits in 4KB.
In previous patch, we have moved
From: Wei Chen
We want to reuse head.S for MPU systems, but there are some
code implemented for MMU systems only. We will move such
code to another MMU specific file. But before that, we will
do some preparations in this patch to make them easier
for reviewing:
1. Fix the indentations of code
From: Wei Chen
On Armv8-A, Xen has a fixed virtual start address (link address
too) for all Armv8-A platforms. In an MMU based system, Xen can
map its loaded address to this virtual start address. So, on
Armv8-A platforms, the Xen start address does not need to be
configurable. But on Armv8-R
From: Wei Chen
>From Arm ARM Supplement of Armv8-R AArch64 (DDI 0600A) [1],
section D1.6.2 TLB maintenance instructions, we know that
Armv8-R AArch64 permits an implementation to cache stage 1
VMSAv8-64 and stage 2 PMSAv8-64 attributes as a common entry
for the Secure EL1&0 translation regime.
ocs.arm.com/en/v5.0/
Penny Zheng (28):
xen/mpu: build up start-of-day Xen MPU memory region map
xen/mpu: introduce helpers for MPU enablement
xen/mpu: introduce unified function setup_early_uart to map early UART
xen/arm64: head: Jump to the runtime mapping in enable_mm()
xen/
From: Wei Chen
These two variables are stale variables, they only have declarations
in config.h, they don't have any definition and no any code is using
these two variables. So in this patch, we remove them from config.h.
Signed-off-by: Wei Chen
Acked-by: Julien Grall
---
v1 -> v2:
1. Add Ab.
From: Wei Chen
Currently, ARM_EFI will mandatorily selected by Arm64.
Even if the user knows for sure that their images will not
start in the EFI environment, they can't disable the EFI
support for Arm64. This means there will be about 3K lines
unused code in their images.
So in this patch, we
101 - 200 of 718 matches
Mail list logo