RE: [PATCH 10/10] xen/arm: introduce allocate_static_memory

2021-05-19 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Tuesday, May 18, 2021 8:06 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Cc: Bertrand Marquis ; Wei Chen > ; nd > Subject: Re: [PATCH 10/10] xen/arm: introduce alloca

RE: [PATCH 07/10] xen/arm: intruduce alloc_domstatic_pages

2021-05-19 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Tuesday, May 18, 2021 8:13 PM > To: Penny Zheng ; Jan Beulich > Cc: Bertrand Marquis ; Wei Chen > ; nd ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Subject: Re: [PATCH 0

RE: [PATCH 09/10] xen/arm: parse `xen,static-mem` info during domain construction

2021-05-19 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Tuesday, May 18, 2021 8:09 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Cc: Bertrand Marquis ; Wei Chen > ; nd > Subject: Re: [PATCH 09/10] xen/arm: parse `xen

RE: [PATCH] Xen: Design doc for 1:1 direct-map and static allocation

2021-05-19 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Tuesday, May 18, 2021 7:48 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Cc: Bertrand Marquis ; Wei Chen > ; nd > Subject: Re: [PATCH] Xen: Design doc for 1:1 direct-m

RE: [PATCH 01/10] xen/arm: introduce domain on Static Allocation

2021-05-19 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Thursday, May 20, 2021 2:27 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Cc: Bertrand Marquis ; Wei Chen > ; nd > Subject: Re: [PATCH 01/10] xen/arm: introduce dom

RE: [PATCH 03/10] xen/arm: introduce PGC_reserved

2021-05-19 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Thursday, May 20, 2021 3:46 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Cc: Bertrand Marquis ; Wei Chen > ; nd > Subject: Re: [PATCH 03/10] xen/arm: introduce PGC_r

RE: [PATCH 10/10] xen/arm: introduce allocate_static_memory

2021-05-19 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Thursday, May 20, 2021 4:10 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Cc: Bertrand Marquis ; Wei Chen > ; nd > Subject: Re: [PATCH 10/10] xen/arm: introduc

RE: [PATCH 03/10] xen/arm: introduce PGC_reserved

2021-05-20 Thread Penny Zheng
Hi julien > -Original Message- > From: Penny Zheng > Sent: Thursday, May 20, 2021 2:20 PM > To: Julien Grall ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Cc: Bertrand Marquis ; Wei Chen > ; nd > Subject: RE: [PATCH 03/10] xen/arm: introduce PGC

RE: [PATCH 04/10] xen/arm: static memory initialization

2021-05-20 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Tuesday, May 18, 2021 6:43 PM > To: Penny Zheng > Cc: Bertrand Marquis ; Wei Chen > ; nd ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; jul...@xen.org > Subject: Re: [PATCH 04/10] xen/arm: stat

RE: [PATCH 07/10] xen/arm: intruduce alloc_domstatic_pages

2021-05-20 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Tuesday, May 18, 2021 7:23 PM > To: Penny Zheng > Cc: Bertrand Marquis ; Wei Chen > ; nd ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; jul...@xen.org > Subject: Re: [PATCH 0

RE: [PATCH 05/10] xen/arm: introduce alloc_staticmem_pages

2021-05-24 Thread Penny Zheng
Hi Julien > -Original Message- > From: Penny Zheng > Sent: Wednesday, May 19, 2021 1:24 PM > To: Julien Grall ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Cc: Bertrand Marquis ; Wei Chen > ; nd > Subject: RE: [PATCH 05/10] xen/arm: introduce alloc

RE: [PATCH 01/10] xen/arm: introduce domain on Static Allocation

2021-06-02 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Thursday, May 20, 2021 4:51 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Cc: Bertrand Marquis ; Wei Chen > ; nd > Subject: Re: [PATCH 01/10] xen/arm: introduce dom

RE: [PATCH 07/10] xen/arm: intruduce alloc_domstatic_pages

2021-06-02 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Friday, May 21, 2021 3:09 PM > To: Penny Zheng > Cc: Bertrand Marquis ; Wei Chen > ; nd ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; jul...@xen.org > Subject: Re: [PATCH 0

RE: [PATCH 01/10] xen/arm: introduce domain on Static Allocation

2021-06-03 Thread Penny Zheng
Hi stefano and julien > -Original Message- > From: Stefano Stabellini > Sent: Friday, June 4, 2021 7:56 AM > To: Julien Grall > Cc: Stefano Stabellini ; Penny Zheng > ; xen-devel@lists.xenproject.org; Bertrand Marquis > ; Wei Chen ; nd > > Subject: Re: [PATC

[PATCH V2 0/9] Domain on Static Allocation

2021-06-06 Thread Penny Zheng
` and `memory` are both defined - fix the scalability issue in allocate_static_memory - allocate static memory when parse Penny Zheng (9): xen/arm: introduce domain on Static Allocation xen/arm: introduce PGC_reserved xen/arm: introduce CONFIG_STATIC_ALLOCATION xen/arm: static memory

[PATCH 2/9] xen/arm: introduce PGC_reserved

2021-06-06 Thread Penny Zheng
In order to differentiate pages of static memory, from those allocated from heap, this patch introduces a new page flag PGC_reserved to tell. Signed-off-by: Penny Zheng --- changes v2: - remove unused reserved field in struct page_info - remove unused helper page_get_reserved_owner and

[PATCH 1/9] xen/arm: introduce domain on Static Allocation

2021-06-06 Thread Penny Zheng
erved-memory. This patch introduces this new static memory device tree node, and also documents and parses this new attribute at boot time and stores related info in static_mem for later initialization. Signed-off-by: Penny Zheng --- v2 changes: - fix typos - consider reserved-memory binding an

[PATCH 3/9] xen/arm: introduce CONFIG_STATIC_ALLOCATION

2021-06-06 Thread Penny Zheng
For now, since the feature of Domain on Static Allocation is only supported on ARM Architecture, this commit introduces new CONFIG_STATIC_ALLOCATION to avoid bringing dead codes in other archs. Signed-off-by: Penny Zheng --- changes v2: - new commit --- xen/arch/arm/Kconfig | 3 +++ 1 file

[PATCH 4/9] xen/arm: static memory initialization

2021-06-06 Thread Penny Zheng
. scrub the page in need synchronously. Signed-off-by: Penny Zheng --- changes v2: - rename to nr_mfns - extract common code from free_heap_pages and free_staticmem_pages - remove dead codes in other archs, including move some to arm-specific file, and put some under CONFIG_ARM - mark

[PATCH 5/9] xen: introduce assign_pages_nr

2021-06-06 Thread Penny Zheng
Introduce new interface assign_pages_nr to deal with when page number is not in a power-of-two, which will save the trouble each time user needs to split the size in a power of 2 to use assign_pages. Signed-off-by: Penny Zheng --- changes v2: - introduce new interface assign_pages_nr --- xen

[PATCH 6/9] xen/arm: introduce alloc_staticmem_pages and alloc_domstatic_pages

2021-06-06 Thread Penny Zheng
nr_mfns pages of static memory and assign them to one specific domain. It uses alloc_staticmen_pages to get nr_mfns pages of static memory, then on success, it will use assign_pages_nr to assign those pages to one specific domain. Signed-off-by: Penny Zheng --- changes v2: - use mfn_valid() to do

[PATCH 8/9] xen/arm: check `xen,static-mem` property during domain construction

2021-06-06 Thread Penny Zheng
. And if the `memory` property and `xen,static-mem` are both set, it shall be verified that if the memory size defined in both is consistent. Signed-off-by: Penny Zheng --- changes v2: - remove parsing procedure here - check the consistency when `xen,static-mem` and `memory` are both defined

[PATCH 7/9] xen/arm: take care of concurrency on static memory allocation

2021-06-06 Thread Penny Zheng
In the future, user may want to allocate static memory at runtime, and it is quite important to get the code protected from concurrent access. Re-use heap_lock to protect concurrent access in alloc_staticmem_pages. Signed-off-by: Penny Zheng --- changes v2: - new commit --- xen/common

[PATCH 9/9] xen/arm: introduce allocate_static_memory

2021-06-06 Thread Penny Zheng
ranges shall be firstly mapped to the fixed guest RAM address `GUEST_RAM0_BASE`. And until it exhausts the `GUEST_RAM0_SIZE`, it will seek to `GUEST_RAM1_BASE`. `GUEST_RAM0` may take up several pre-defined physical RAM regions. Signed-off-by: Penny Zheng --- changes v2: - rename the values, like

RE: [PATCH 01/10] xen/arm: introduce domain on Static Allocation

2021-06-14 Thread Penny Zheng
Hi julien > -Original Message- > From: Julien Grall > Sent: Wednesday, June 9, 2021 6:47 PM > To: Bertrand Marquis > Cc: Stefano Stabellini ; Julien Grall > ; Penny Zheng ; xen- > de...@lists.xenproject.org; Wei Chen ; nd > > Subject: Re: [PATCH 01/10] x

Re: [PATCH v3 31/52] xen/mpu: make early_fdt_map support in MPU systems

2023-07-12 Thread Penny Zheng
Hi Julien On 2023/7/3 17:20, Julien Grall wrote: Hi, On 03/07/2023 06:12, Penny Zheng wrote: Hi, On 2023/6/30 23:02, Julien Grall wrote: Hi, On 30/06/2023 15:42, Ayan Kumar Halder wrote: Hi Julien, On 30/06/2023 12:22, Julien Grall wrote: On 30/06/2023 11:49, Ayan Kumar Halder wrote

Re: [PATCH v3 35/52] xen/arm: map static memory on demand

2023-07-12 Thread Penny Zheng
Hi Ayan On 2023/7/5 21:33, Ayan Kumar Halder wrote: On 05/07/2023 11:16, Penny Zheng wrote: Hi Ayan Hi Penny, On 2023/7/4 23:10, Ayan Kumar Halder wrote: Hi Penny, On 26/06/2023 04:34, Penny Zheng wrote: CAUTION: This message has originated from an External Source. Please use proper

Re: [PATCH v3 36/52] xen/mpu: implememt ioremap_xxx in MPU

2023-07-13 Thread Penny Zheng
Hi Ayan On 2023/7/5 22:01, Ayan Kumar Halder wrote: Hi Penny, On 26/06/2023 04:34, Penny Zheng wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. A set of

Re: [PATCH v3 43/52] xen/mpu: configure VSTCR_EL2 in MPU system

2023-07-13 Thread Penny Zheng
Hi Ayan On 2023/7/5 22:21, Ayan Kumar Halder wrote: On 26/06/2023 04:34, Penny Zheng wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. VSTCR_EL2, Virtualization

Re: [PATCH v3 33/52] xen/mpu: initialize frametable in MPU system

2023-07-13 Thread Penny Zheng
Hi, On 2023/7/5 21:52, Julien Grall wrote: Hi, On 05/07/2023 10:53, Penny Zheng wrote: Since if not and when anyone wants to update map_pages_to_xen(), destroy_xen_mappings() and modify_xen_mappings() in the future, it is possible for them to leave changes in only one file. The helpers are

Re: [PATCH v3 44/52] xen/mpu: P2M initialization in MPU system

2023-07-13 Thread Penny Zheng
Hi, Ayan On 2023/7/5 23:35, Ayan Kumar Halder wrote: Hi Penny, On 26/06/2023 04:34, Penny Zheng wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. We inherit

Re: [PATCH v2 10/40] xen/arm: split MMU and MPU config files from config.h

2023-06-04 Thread Penny Zheng
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, but there are

[PATCH v1] xen/docs: design doc for GICv4.0 vLPI support

2023-06-24 Thread Penny Zheng
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

[PATCH v3 02/52] xen/arm: make ARM_EFI selectable for Arm64

2023-06-25 Thread Penny Zheng
h, we 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/

[PATCH v3 01/52] xen/arm: remove xen_phys_start and xenheap_phys_end from config.h

2023-06-25 Thread Penny Zheng
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: J

[PATCH v3 00/52] xen/arm: Add Armv8-R64 MPU support to Xen - Part#1

2023-06-25 Thread Penny Zheng
-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

[PATCH v3 05/52] xen/arm64: head: Introduce enable_boot_mmu and enable_runtime_mmu

2023-06-25 Thread Penny Zheng
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 a

[PATCH v3 03/52] xen/arm: add an option to define Xen start address for Armv8-R

2023-06-25 Thread Penny Zheng
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_MPU

[PATCH v3 04/52] xen/arm: add .text.idmap in ld script for Xen identity map sections

2023-06-25 Thread Penny Zheng
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

[PATCH v3 08/52] xen/arm64: move MMU related code from head.S to mmu/head.S

2023-06-25 Thread Penny Zheng
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

[PATCH v3 07/52] xen/arm64: prepare for moving MMU related code from head.S

2023-06-25 Thread Penny Zheng
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/

[PATCH v3 10/52] xen/arm: Move MMU related definitions from config.h to mmu/layout.h

2023-06-25 Thread Penny Zheng
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

[PATCH v3 18/52] xen/arm: only map the init text section RW in free_init_memory

2023-06-25 Thread Penny Zheng
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 a

[PATCH v3 33/52] xen/mpu: initialize frametable in MPU system

2023-06-25 Thread Penny Zheng
metable 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 confirm

[PATCH v3 42/52] xen/mpu: implement setup_virt_paging for MPU system

2023-06-25 Thread Penny Zheng
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

[PATCH v3 36/52] xen/mpu: implememt ioremap_xxx in MPU

2023-06-25 Thread Penny Zheng
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

[PATCH v3 46/52] xen/mpu: look up entry in p2m table

2023-06-25 Thread Penny Zheng
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

[PATCH v3 48/52] xen/mpu: enable MMIO region trap in MPU system

2023-06-25 Thread Penny Zheng
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

[PATCH v3 40/52] xen/mpu: implement remove_early_mappings in MPU system

2023-06-25 Thread Penny Zheng
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

[PATCH v3 51/52] xen/mpu: create stubs of function/variables for UNSUPPORTED features

2023-06-25 Thread Penny Zheng
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

[PATCH v3 22/52] xen/mmu: enable SMMU subsystem only in MMU

2023-06-25 Thread Penny Zheng
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

[PATCH v3 39/52] xen/mpu: support free_init_memory in MPU system

2023-06-25 Thread Penny Zheng
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: - As

[PATCH v3 52/52] xen/arm: add Kconfig option CONFIG_HAS_MPU to enable MPU system support

2023-06-25 Thread Penny Zheng
. 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

[PATCH v3 41/52] xen/mpu: Use secure hypervisor timer in MPU system

2023-06-25 Thread Penny Zheng
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

[PATCH v3 44/52] xen/mpu: P2M initialization in MPU system

2023-06-25 Thread Penny Zheng
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

[PATCH v3 12/52] xen/mmu: extract early uart mapping from setup_fixmap

2023-06-25 Thread Penny Zheng
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

[PATCH v3 21/52] xen: introduce CONFIG_HAS_PAGING_MEMPOOL

2023-06-25 Thread Penny Zheng
codes 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/arc

[PATCH v3 26/52] xen/mpu: map early uart when earlyprintk on

2023-06-25 Thread Penny Zheng
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

[PATCH v3 34/52] xen/mpu: destroy an existing entry in Xen MPU memory mapping table

2023-06-25 Thread Penny Zheng
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

[PATCH v3 37/52] xen/mpu: implement MPU version of copy_from_paddr

2023-06-25 Thread Penny Zheng
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

[PATCH v3 13/52] xen/mmu: extract mmu-specific codes from mm.c/mm.h

2023-06-25 Thread Penny Zheng
d 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

[PATCH v3 06/52] xen/arm: introduce CONFIG_HAS_MMU

2023-06-25 Thread Penny Zheng
address mappings and associated memory properties held in memory-mapped tables known as translation tables. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - new patch --- xen/arch/arm/Kconfig | 8 1 file changed, 8 insertions(+) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm

[PATCH v3 25/52] xen/mpu: introduce helpers for MPU enablement

2023-06-25 Thread Penny Zheng
disabled. Since the default memory map of the Armv8-R AArch64 architecture is IMPLEMENTATION DEFINED, we always turn off the Background region. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - introduce code clearing SCTLR_EL2.BR - document the reason of isb --- xen/arch/arm/arm64

[PATCH v3 30/52] xen/mpu: populate a new region in Xen MPU mapping table

2023-06-25 Thread Penny Zheng
attribute Index [3:4] Execute Never [5:6] Access Permission [7] Region Present Also, we provide a set of definitions(REGION_HYPERVISOR_RW, etc) that combine the memory attribute and permission for common combinations. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - implement pr_set_base

[PATCH v3 20/52] xen/mmu: move MMU specific P2M code to mmu/p2m.c and mmu/p2m.h

2023-06-25 Thread Penny Zheng
: Penny Zheng Signed-off-by: Wei Chen --- v2: - new commit --- v3: - remove MPU stubs - adapt to the introduction of new directories: mmu/ --- xen/arch/arm/Makefile |1 + xen/arch/arm/include/asm/mmu/p2m.h | 18 + xen/arch/arm/include/asm/p2m.h | 30 +- xen/arch/arm/mmu/p2m.c

[PATCH v3 23/52] xen/arm: create mpu/layout.h for MPU related address definitions

2023-06-25 Thread Penny Zheng
contents are MPU specific. Signed-off-by: Wei Chen Signed-off-by: Penny Zheng --- v3: - new commit --- xen/arch/arm/include/asm/config.h | 2 ++ xen/arch/arm/include/asm/mpu/layout.h | 32 +++ 2 files changed, 34 insertions(+) create mode 100644 xen/arch/arm/include/asm

[PATCH v3 50/52] xen/mpu: dump debug message in MPU system

2023-06-25 Thread Penny Zheng
A set of helpers dump_xxx and show_registers are responsible for dumping memory mapping info and register info when debugging. In this commit, we implement them all in MPU system too. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - new commit --- xen/arch/arm/include/asm/mpu/mm.h

[PATCH v3 28/52] xen/mpu: plump virt/maddr conversion in MPU system

2023-06-25 Thread Penny Zheng
: Penny Zheng Signed-off-by: Wei Chen --- v3: - Fix typos - Move the implementation from mm/mpu.h to mm.h, to share as much as possible with MMU system. --- xen/arch/arm/include/asm/mm.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch

[PATCH v3 19/52] xen/arm: switch to use ioremap_xxx in common file

2023-06-25 Thread Penny Zheng
, we also just need to implement MPU version of ioremap_xxx. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - new commit --- xen/arch/arm/kernel.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index

[PATCH v3 43/52] xen/mpu: configure VSTCR_EL2 in MPU system

2023-06-25 Thread Penny Zheng
e PA space, we keep SA bit as 0. VSTCR_EL2.SC is NS check enable bit. To make sure that Stage 2 NS configuration is checked against stage 1 NS configuration in EL1&0 translation regime for the given address, and generates a fault if they are different, we set SC bit 1. Signed-off-by: Penny Zheng

[PATCH v3 16/52] xen/mmu: relocate copy_from_paddr into setup.c

2023-06-25 Thread Penny Zheng
later commit. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - new commit --- xen/arch/arm/kernel.c| 27 --- xen/arch/arm/mmu/setup.c | 27 +++ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/xen/arch/arm/kernel.c b

[PATCH v3 09/52] xen/arm: use PA == VA for EARLY_UART_VIRTUAL_ADDRESS on MPU systems

2023-06-25 Thread Penny Zheng
From: Wei Chen There is no VMSA support on MPU systems, so we can not map early UART to FIXMAP_CONSOLE. In stead, we can use PA == VA for early UART on MPU systems. Signed-off-by: Wei Chen Signed-off-by: Penny Zheng --- v2: 1. New patch --- v3: 1. fix comment 2. change CONFIG_ARM_V8R to

[PATCH v3 15/52] xen: make VMAP only support in MMU system

2023-06-25 Thread Penny Zheng
Kconfig CONFIG_HAS_VMAP, and make it only support in MMU system on ARM architecture. And we make features like ALTERNATIVE, CPUERRATA, LIVEPATCH, Grant Table, etc, now depend on VMAP. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v2: - new commit --- v3: - make LIVEPATCH/ALTERNATIVE

[PATCH v3 35/52] xen/arm: map static memory on demand

2023-06-25 Thread Penny Zheng
ap on demand", to map static memory temporarily before its initialization, and unmap immediately after its initialization. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - new commit --- xen/arch/arm/include/asm/mm.h | 2 ++ xen/arch/arm/mmu/mm.c | 10 ++ xen/ar

[PATCH v3 29/52] xen/mpu: introduce a pair helper read_protection_region()/write_protection_region()

2023-06-25 Thread Penny Zheng
on 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: Pen

[PATCH v3 45/52] xen/mpu: insert an new entry into guest physmap in MPU system

2023-06-25 Thread Penny Zheng
try() - insert the new entry into domain P2M table(p2m->root) Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - new commit --- xen/arch/arm/include/asm/arm64/mpu.h | 3 +- xen/arch/arm/include/asm/mpu/mm.h| 6 + xen/arch/arm/include/asm/p2m.h | 3 + xen/arch/arm/mp

[PATCH v3 47/52] xen/mpu: support vcpu context switch in MPU system

2023-06-25 Thread Penny Zheng
Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - new commit --- xen/arch/arm/include/asm/arm64/sysregs.h | 3 ++ xen/arch/arm/include/asm/page.h | 4 ++ xen/arch/arm/mpu/mm.c| 6 ++- xen/arch/arm/mpu/p2m.c | 61 +++

[PATCH v3 17/52] xen/arm: do not give memory back to static heap

2023-06-25 Thread Penny Zheng
init data section. we introduce a new helper xen_is_using_staticheap to tell whether Xenheap is statically configured in Device Tree. It is always returning false when !CONFIG_STATIC_MEMORY, since static heap depends on static memory feature. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3

[PATCH v3 27/52] xen/mpu: introduce setup_mm_mappings

2023-06-25 Thread Penny Zheng
/setup.c, setup_mm_mappings , with a more generic name, is introduced to replace setup_pagetables. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - introduce bitmap xen_mpumap_mask for dynamic allocation on MPU regions --- xen/arch/arm/include/asm/arm64/mpu.h | 1 + xen/arch/arm

[PATCH v3 14/52] xen/mmu: move MMU-specific setup_mm to mmu/setup.c

2023-06-25 Thread Penny Zheng
components differently in MPU, like xenheap, etc. There are some components that is specific to MMU only, like direct-mapping. In the commit, we move MMU-specific components into mmu/setup.c, in preparation of implementing MPU version of setup_mm later in future commit. Signed-off-by: Penny Zheng Signed

[PATCH v3 11/52] xen/arm: mmu: fold FIXMAP into MMU system

2023-06-25 Thread Penny Zheng
releated codes, then we fold it into MMU system. Since PMAP relies on FIXMAP, so we fold it too into MMU system. Under !CONFIG_HAS_FIXMAP, we provide empty stubbers for not breaking compilation. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v1 -> v2 - new patch --- v3: - f

[PATCH v3 31/52] xen/mpu: make early_fdt_map support in MPU systems

2023-06-25 Thread Penny Zheng
MPU memory region, as it will be relocated into heap and unmapped at the end of boot. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - map the first 2MB. Check the size and then re-map with an extra 2MB if needed --- xen/arch/arm/include/asm/arm64/mpu.h | 3 ++- xen/arch/arm/include

[PATCH v3 49/52] xen/mpu: enable device passthrough in MPU system

2023-06-25 Thread Penny Zheng
In order to enable device passthrough in MPU system, we only need to provide p2m_mmio_direct_dev permission set up. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - new commit --- xen/arch/arm/mpu/p2m.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a

[PATCH v3 38/52] xen/mpu: map domain page in MPU system

2023-06-25 Thread Penny Zheng
In MPU system, we implement map_domain_page()/unmap_domain_page() through mapping the domain page with a transient MPU region on demand. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - new patch --- xen/arch/arm/Makefile | 4 ++ xen/arch/arm/include/asm/mpu/mm.h | 1

[PATCH v3 24/52] xen/mpu: build up start-of-day Xen MPU memory region map

2023-06-25 Thread Penny Zheng
The layout shall be compliant with what we describe in xen.lds.S, or the codes need adjustment. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - cache maintanence for safety when modifying MPU memory mapping table - Hardcode index for all data/text sections - To make sure that

[PATCH v3 32/52] xen/mpu: implement MPU version of setup_mm in mpu/setup.c

2023-06-25 Thread Penny Zheng
In MPU system, resource, like Xenheap, must be statically configured to meet the requirement of static system with expected behavior. Then, in MPU version of setup_mm, we introduce setup_staticheap_mappings to map fixed MPU memory region for static Xenheap. Signed-off-by: Penny Zheng Signed-off

Re: [PATCH v3 15/52] xen: make VMAP only support in MMU system

2023-06-27 Thread Penny Zheng
Hi Jan On 2023/6/26 14:00, Jan Beulich wrote: On 26.06.2023 05:34, Penny Zheng wrote: --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -27,6 +27,7 @@ config X86 select HAS_PDX select HAS_SCHED_GRANULARITY select HAS_UBSAN + select HAS_VMAP With this

Re: [PATCH v3 21/52] xen: introduce CONFIG_HAS_PAGING_MEMPOOL

2023-06-27 Thread Penny Zheng
Hi Jan On 2023/6/26 15:01, Jan Beulich wrote: On 26.06.2023 05:34, Penny Zheng wrote: --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -54,6 +54,9 @@ config HAS_IOPORTS config HAS_KEXEC bool +config HAS_PAGING_MEMPOOL + bool + config HAS_PDX bool --- a/xen

Re: [PATCH v3 15/52] xen: make VMAP only support in MMU system

2023-06-28 Thread Penny Zheng
Hi Julien On 2023/6/28 15:59, Julien Grall wrote: Hi, On 28/06/2023 06:38, Penny Zheng wrote: On 2023/6/26 14:00, Jan Beulich wrote: On 26.06.2023 05:34, Penny Zheng wrote: --- a/xen/common/vmap.c +++ b/xen/common/vmap.c @@ -331,4 +331,11 @@ void vfree(void *va)   while ( (pg

Re: [PATCH v3 30/52] xen/mpu: populate a new region in Xen MPU mapping table

2023-06-28 Thread Penny Zheng
Hi Ayan On 2023/6/28 18:08, Ayan Kumar Halder wrote: (Forgot to cc) On 28/06/2023 11:05, Ayan Kumar Halder wrote: Hi Penny, On 26/06/2023 04:34, Penny Zheng wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments

Re: [PATCH v3 28/52] xen/mpu: plump virt/maddr conversion in MPU system

2023-06-29 Thread Penny Zheng
Hi, On 2023/6/29 23:14, Julien Grall wrote: Hi, On 29/06/2023 15:44, Ayan Kumar Halder wrote: On 29/06/2023 15:23, Andrew Cooper wrote: On 29/06/2023 3:20 pm, Ayan Kumar Halder wrote: On 26/06/2023 04:34, Penny Zheng wrote: diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include

Re: [PATCH v3 27/52] xen/mpu: introduce setup_mm_mappings

2023-06-29 Thread Penny Zheng
Hi, On 2023/6/29 22:50, Ayan Kumar Halder wrote: On 29/06/2023 15:29, Julien Grall wrote: Hi, On 29/06/2023 15:05, Ayan Kumar Halder wrote: On 26/06/2023 04:34, Penny Zheng wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when

Re: [PATCH v3 31/52] xen/mpu: make early_fdt_map support in MPU systems

2023-06-29 Thread Penny Zheng
Hi, On 2023/6/30 01:22, Ayan Kumar Halder wrote: On 26/06/2023 04:34, Penny Zheng wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. In MPU system, MPU memory

Re: [PATCH v3 31/52] xen/mpu: make early_fdt_map support in MPU systems

2023-07-02 Thread Penny Zheng
Hi, On 2023/6/30 23:02, Julien Grall wrote: Hi, On 30/06/2023 15:42, Ayan Kumar Halder wrote: Hi Julien, On 30/06/2023 12:22, Julien Grall wrote: On 30/06/2023 11:49, Ayan Kumar Halder wrote: On 30/06/2023 05:07, Penny Zheng wrote: Hi, Hi Penny, On 2023/6/30 01:22, Ayan Kumar

Re: [PATCH v3 33/52] xen/mpu: initialize frametable in MPU system

2023-07-02 Thread Penny Zheng
Hi Ayan On 2023/6/30 23:19, Ayan Kumar Halder wrote: Hi Penny, On 26/06/2023 04:34, Penny Zheng wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. Xen is using

Re: [PATCH v3 34/52] xen/mpu: destroy an existing entry in Xen MPU memory mapping table

2023-07-03 Thread Penny Zheng
Hi Ayan On 2023/7/1 00:17, Ayan Kumar Halder wrote: On 26/06/2023 04:34, Penny Zheng wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. This commit expands

Re: [PATCH v3 05/52] xen/arm64: head: Introduce enable_boot_mmu and enable_runtime_mmu

2023-07-04 Thread Penny Zheng
Hi Julien On 2023/7/5 05:24, Julien Grall wrote: Hi Penny, On 26/06/2023 04:33, Penny Zheng wrote: From: Wei Chen At the moment, on MMU system, enable_mmu() will return to an address in the 1:1 mapping, then each path is responsible to switch to virtual runtime mapping. Then

Re: [PATCH v3 06/52] xen/arm: introduce CONFIG_HAS_MMU

2023-07-04 Thread Penny Zheng
Hi Julien and Ayan On 2023/7/4 20:04, Ayan Kumar Halder wrote: On 04/07/2023 12:44, Julien Grall wrote: Hi, On 04/07/2023 12:14, Ayan Kumar Halder wrote: On 26/06/2023 04:33, Penny Zheng wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and

Re: [PATCH v3 07/52] xen/arm64: prepare for moving MMU related code from head.S

2023-07-04 Thread Penny Zheng
Hi Julien On 2023/7/5 05:35, Julien Grall wrote: Hi Penny, On 26/06/2023 04:33, Penny Zheng wrote: From: Wei Chen We want to reuse head.S for MPU systems, but there are some code are implemented for MMU systems only. We will move such code to another MMU specific file. But before that we

Re: [PATCH v3 08/52] xen/arm64: move MMU related code from head.S to mmu/head.S

2023-07-04 Thread Penny Zheng
Hi Julien On 2023/7/5 05:46, Julien Grall wrote: Hi Penny, On 26/06/2023 04:33, Penny Zheng wrote: 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

<    1   2   3   4   5   6   7   8   9   10   >