Re: [PATCH v5 02/11] xen/arm: avoid repetitive checking in process_shm_node

2023-12-07 Thread Penny Zheng
Hi Michal On 2023/12/6 19:35, Michal Orzel wrote: Hi Penny, On 06/12/2023 10:06, Penny Zheng wrote: Putting overlap and overflow checking in the loop is causing repetitive operation, so this commit extracts both checking outside the loop. Signed-off-by: Penny Zheng In general the patch

[PATCH v5 10/11] xen/arm: fix duplicate /reserved-memory node in Dom0

2023-12-06 Thread Penny Zheng
to insert the shm node along with the copying. And avoiding duplication, we add a checking before make_resv_memory_node(). Signed-off-by: Penny Zheng --- v3 -> v4: new commit --- v4 -> v5: rebase and no change --- xen/arch/arm/domain_build.c | 27 ++--- xen/ar

[PATCH v5 11/11] xen/arm: create another /memory node for static shm

2023-12-06 Thread Penny Zheng
Static shared memory region shall be described both under /memory and /reserved-memory. We introduce export_shm_memory_node() to create another /memory node to contain the static shared memory ranges. Signed-off-by: Penny Zheng --- v3 -> v4: new commit --- v4 -> v5: rebase and no c

[PATCH v5 09/11] xen/docs: refine docs about static shared memory

2023-12-06 Thread Penny Zheng
em-1", not "0x1". Signed-off-by: Penny Zheng --- 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-tree/booting.txt index bbd955e9c2..ac4bad6

[PATCH v5 08/11] xen/p2m: put reference for superpage

2023-12-06 Thread Penny Zheng
references for foreign superpages. Signed-off-by: Penny Zheng --- v1 -> v2: - new commit --- v2 -> v3: - rebase and no change --- v3 -> v4: rebase and no change --- v4 -> v5: rebase and no change --- xen/arch/arm/mmu/p2m.c | 58 +++--- 1 file

[PATCH v5 06/11] xen/arm: support static shared memory when host address not provided

2023-12-06 Thread Penny Zheng
;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" --- v2 -> v3 - fix infinite loop bug and bad indentation

[PATCH v5 04/11] xen/arm: introduce allocate_domheap_memory and guest_physmap_memory

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

[PATCH v5 07/11] xen/arm: remove shm holes for extended regions

2023-12-06 Thread Penny Zheng
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 --- v2 -> v3: - error out non-zero res before

[PATCH v5 02/11] xen/arm: avoid repetitive checking in process_shm_node

2023-12-06 Thread Penny Zheng
Putting overlap and overflow checking in the loop is causing repetitive operation, so this commit extracts both checking outside the loop. Signed-off-by: Penny Zheng --- v6: new commit --- xen/arch/arm/static-shmem.c | 39 +++-- 1 file changed, 16 insertions

[PATCH v5 05/11] xen/arm: use paddr_assigned to indicate whether host address is provided

2023-12-06 Thread Penny Zheng
..). Also, to make codes tidy and 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 memo

[PATCH v5 00/11] Follow-up static shared memory PART I

2023-12-06 Thread Penny Zheng
l above objects have been divided into two parts to complete. And this patch serie is PART I. [1] https://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 (11): x

[PATCH v5 03/11] xen/arm: re-define a set of data structures for static shared memory region

2023-12-06 Thread Penny Zheng
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 making reserving memory more complex and actually memory infor

[PATCH v5 01/11] xen/arm: remove stale addr_cells/size_cells in assign_shared_memory

2023-12-06 Thread Penny Zheng
Function parameters {addr_cells,size_cells} are stale parameters in assign_shared_memory, so we shall remove them. Signed-off-by: Penny Zheng Reviewed-by: Michal Orzel --- v1 -> v2: - new commit --- v2 -> v3: rebase and no change --- v3 -> v4: rebase and no change --- v4 ->

Re: [PATCH v4 00/10] Follow-up static shared memory PART I

2023-11-30 Thread Penny Zheng
Thanks for the reminder! I’ll send the updated version ASAP :) Thanks, Penny > 在 2023年11月30日,18:09,Michal Orzel 写道: > > Hi Penny, > >> On 11/09/2023 12:04, Penny Zheng wrote: >> >> >> Hi Michal >> >>> On 2023/9/11 17:01, Michal Orze

Re: [XEN v1 4/4] xen/arm: traps.c: Enclose VMSA specific registers within CONFIG_MMU

2023-09-13 Thread Penny Zheng
Hi, Ayan On 2023/9/11 21:59, Ayan Kumar Halder wrote: The VMSA specific registers (ie TCR, TTBR0, TTBR1, VTTBR, etc) are valid when MMU is used, thus we can enclose them with CONFIG_MMU. Signed-off-by: Ayan Kumar Halder --- xen/arch/arm/traps.c | 17 +++-- 1 file changed, 15

Re: [PATCH v4 00/10] Follow-up static shared memory PART I

2023-09-11 Thread Penny Zheng
Hi Michal On 2023/9/11 17:01, Michal Orzel wrote: Hi Penny, On 11/09/2023 06:04, Penny Zheng wrote: There are some unsolving issues on current 4.17 static shared memory feature[1], including: - In order to avoid keeping growing 'membank', having the shared memory info in separate structures

Re: [PATCH v4 04/10] xen/arm: use paddr_assigned to indicate whether host address is provided

2023-09-11 Thread Penny Zheng
Hi, On 2023/9/11 12:04, Penny Zheng wrote: We use paddr_assigned to indicate whether host address is provided, by checking the length of "xen,shared-mem" property. The shm matching criteria shall also be adapt to cover the new scenario, by adding when host address is not provided

Re: [PATCH v4 09/10] xen/arm: fix duplicate /reserved-memory node in Dom0

2023-09-11 Thread Penny Zheng
Hi Michal On 2023/9/11 17:40, Michal Orzel wrote: Hi Penny, On 11/09/2023 06:04, Penny Zheng wrote: In case there is a /reserved-memory node already present in the host dtb, current Xen codes would create yet another /reserved-memory node specially s/codes/code/ for the static shm

Re: [PATCH v3 0/8] Follow-up static shared memory PART I

2023-09-10 Thread Penny Zheng
Hi Michal Sorry for the delayed response, caught up in internal release lately. :\ On 2023/8/22 16:57, Michal Orzel wrote: Hi Penny, On 22/08/2023 07:32, Penny Zheng wrote: Hi, michal On 2023/8/21 18:49, Michal Orzel wrote: Hi Penny, On 21/08/2023 06:00, Penny Zheng wrote

[PATCH v4 08/10] xen/docs: refine docs about static shared memory

2023-09-10 Thread Penny Zheng
em-1", not "0x1". Signed-off-by: Penny Zheng --- v1 -> v2: - no new changes --- v2 -> v3 - rebase and no change --- v3 -> v4: rebase and no change --- docs/misc/arm/device-tree/booting.txt | 52 --- 1 file changed, 39 insertions(+), 13 deletions(-)

[PATCH v4 09/10] xen/arm: fix duplicate /reserved-memory node in Dom0

2023-09-10 Thread Penny Zheng
to insert the shm node along with the copying. And avoiding duplication, we add a checking before make_resv_memory_node(). Signed-off-by: Penny Zheng --- v3 -> v4: new commit --- xen/arch/arm/domain_build.c | 31 --- xen/arch/arm/include/asm/kernel.h | 2 ++

[PATCH v4 10/10] xen/arm: create another /memory node for static shm

2023-09-10 Thread Penny Zheng
Static shared memory region shall be described both under /memory and /reserved-memory. We introduce export_shm_memory_node() to create another /memory node to contain the static shared memory ranges. Signed-off-by: Penny Zheng --- v3 -> v4: new commit --- xen/arch/arm/domain_build.c |

[PATCH v4 06/10] xen/arm: remove shm holes for extended regions

2023-09-10 Thread Penny Zheng
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 --- v2 -> v3: - error out non-zero res before

[PATCH v4 07/10] xen/p2m: put reference for superpage

2023-09-10 Thread Penny Zheng
references for foreign superpages. Signed-off-by: Penny Zheng --- v1 -> v2: - new commit --- v2 -> v3: - rebase and no change --- v3 -> v4: rebase and no change --- xen/arch/arm/p2m.c | 58 ++ 1 file changed, 43 insertions(+), 15 deletions(-) d

[PATCH v4 05/10] xen/arm: support static shared memory when host address not provided

2023-09-10 Thread Penny Zheng
;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" --- v2 -> v3 - fix infinite loop bug and bad indentation - reb

[PATCH v4 04/10] xen/arm: use paddr_assigned to indicate whether host address is provided

2023-09-10 Thread Penny Zheng
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

[PATCH v4 03/10] xen/arm: introduce allocate_domheap_memory and guest_physmap_memory

2023-09-10 Thread Penny Zheng
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, a

[PATCH v4 00/10] Follow-up static shared memory PART I

2023-09-10 Thread Penny Zheng
l above objects have been divided into two parts to complete. And this patch serie is PART I. [1] https://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 (10): x

[PATCH v4 01/10] xen/arm: remove stale addr_cells/size_cells in assign_shared_memory

2023-09-10 Thread Penny Zheng
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 --- v2 -> v3: rebase and no change --- v3 -> v4: rebase and no change --- xen/arch/arm/domain_build.c | 2 -- 1 fil

[PATCH v4 02/10] xen/arm: re-define a set of data structures for static shared memory region

2023-09-10 Thread Penny Zheng
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

Re: [PATCH v6 01/13] xen/arm64: head.S: Introduce enable_{boot,secondary}_cpu_mm()

2023-09-07 Thread Penny Zheng
enable_boot_cpu_mm() for boot CPU and enable_secondary_cpu_mm() for secondary CPUs in this patch. Signed-off-by: Wei Chen Signed-off-by: Penny Zheng Signed-off-by: Henry Wang Reviewed-by: Julien Grall --- v6: - Add Julien's Reviewed-by tag. v5: - Add missing "()" in title. - Use mo

Re: [PATCH v5 11/13] xen/arm: mmu: move MMU specific P2M code to mmu/p2m.{c,h}

2023-08-22 Thread Penny Zheng
Hi Julien On 2023/8/23 02:01, Julien Grall wrote: Hi Henry, On 14/08/2023 05:25, Henry Wang wrote: From: Penny Zheng Current P2M implementation is designed for MMU system only. We move the MMU-specific codes into mmu/p2m.c, and only keep generic codes in p2m.c, like VMID allocator, etc. We

Re: [PATCH v3 0/8] Follow-up static shared memory PART I

2023-08-22 Thread Penny Zheng
Hi, michal On 2023/8/21 18:49, Michal Orzel wrote: Hi Penny, On 21/08/2023 06:00, Penny Zheng wrote: There are some unsolving issues on current 4.17 static shared memory feature[1], including: - In order to avoid keeping growing 'membank', having the shared memory info in separate

[PATCH v3 7/8] xen/p2m: put reference for superpage

2023-08-20 Thread Penny Zheng
references for foreign superpages. Signed-off-by: Penny Zheng --- v1 -> v2: - new commit --- v2 -> v3: - rebase and no change --- xen/arch/arm/p2m.c | 58 ++ 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xe

[PATCH v3 8/8] xen/docs: refine docs about static shared memory

2023-08-20 Thread Penny Zheng
em-1", not "0x1". Signed-off-by: Penny Zheng --- v1 -> v2: - no new changes --- v2 -> v3 - rebase and no change --- docs/misc/arm/device-tree/booting.txt | 52 --- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/docs/misc/arm/device-tree/boot

[PATCH v3 6/8] xen/arm: remove shm holes for extended regions

2023-08-20 Thread Penny Zheng
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 --- v2 -> v3: - error out non-zero res bef

[PATCH v3 5/8] xen/arm: support static shared memory when host address not provided

2023-08-20 Thread Penny Zheng
;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" --- v2 -> v3 - fix infinite loop bug and bad ind

[PATCH v3 4/8] xen/arm: use paddr_assigned to indicate whether host address is provided

2023-08-20 Thread Penny Zheng
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

[PATCH v3 3/8] xen/arm: introduce allocate_domheap_memory and guest_physmap_memory

2023-08-20 Thread Penny Zheng
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, a

[PATCH v3 2/8] xen/arm: re-define a set of data structures for static shared memory region

2023-08-20 Thread Penny Zheng
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

[PATCH v3 1/8] xen/arm: remove stale addr_cells/size_cells in assign_shared_memory

2023-08-20 Thread Penny Zheng
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 --- v2 -> v3: rebase and no change --- xen/arch/arm/domain_build.c | 2 -- 1 file changed, 2 deletions(-) diff --git

[PATCH v3 0/8] Follow-up static shared memory PART I

2023-08-20 Thread Penny Zheng
/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

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 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

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 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

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 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 12/52] xen/mmu: extract early uart mapping from setup_fixmap

2023-07-06 Thread Penny Zheng
Hi Julien On 2023/7/5 18:35, Julien Grall wrote: Hi Penny, On 05/07/2023 10:03, Penny Zheng wrote: On 2023/7/5 06:25, Julien Grall wrote: Hi Penny, Title: You want to clarify that this change is arm64 only. So: xen/arm64: mmu: ... On 26/06/2023 04:34, Penny Zheng wrote: Original

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

2023-07-06 Thread Penny Zheng
Hi Julien On 2023/7/5 18:31, Julien Grall wrote: Hi Penny, On 05/07/2023 09:19, Penny Zheng wrote: On 2023/7/5 06:12, Julien Grall wrote: On 26/06/2023 04:34, Penny Zheng wrote: diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index fb77392b82..22b28b8ba2 100644 --- a/xen/arch/arm

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

2023-07-06 Thread Penny Zheng
Hi Julien On 2023/7/5 18:30, Julien Grall wrote: Hi Penny, On 05/07/2023 07:51, Penny Zheng wrote: On 2023/7/5 05:54, Julien Grall wrote: Hi Penny, On 26/06/2023 04:34, Penny Zheng wrote: From: Wei Chen Xen defines some global configuration macros for Arm in config.h. We still want

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

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

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

2023-07-06 Thread Penny Zheng
Hi Julien On 2023/7/5 18:43, Julien Grall wrote: Hi Penny, One more remark. 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

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

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

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

2023-07-06 Thread Penny Zheng
On 2023/7/4 19:47, Julien Grall wrote: On 04/07/2023 11:36, Ayan Kumar Halder wrote: Hi Penny, Hi Ayan, On 26/06/2023 04:33, Penny Zheng wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking

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

2023-07-05 Thread Penny Zheng
Hi Ayan On 2023/7/5 01:49, Ayan Kumar Halder wrote: Hi Penny, Most of these are specific to ARM_64, thus we can add "#ifdef CONFIG_ARM_64" as follows :- Yes, you're right. On 26/06/2023 04:34, Penny Zheng wrote: CAUTION: This message has originated from an External Source. P

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

2023-07-05 Thread Penny Zheng
Hi Ayan 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 judgment and caution when opening attachments, clicking links, or responding to this email. In function

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

2023-07-05 Thread Penny Zheng
Hi, On 2023/7/3 17:31, Julien Grall wrote: Hi, On 03/07/2023 07:10, Penny Zheng wrote: 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

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

2023-07-05 Thread Penny Zheng
Hi Julien On 2023/7/5 06:25, Julien Grall wrote: Hi Penny, Title: You want to clarify that this change is arm64 only. So: xen/arm64: mmu: ... On 26/06/2023 04:34, Penny Zheng wrote: Original setup_fixmap is actually doing two seperate tasks, one is enabling the early UART when earlyprintk

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

2023-07-05 Thread Penny Zheng
Hi, On 2023/7/5 06:12, Julien Grall wrote: Hi, On 26/06/2023 04:34, Penny Zheng wrote: FIXMAP in MMU system is used to do special-purpose 4K mapping, like mapping early UART, temporarily mapping source codes for copy and paste (copy_from_paddr), etc. As FIXMAP feature is highly dependent

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

2023-07-05 Thread Penny Zheng
Hi Julien On 2023/7/5 05:54, Julien Grall wrote: Hi Penny, On 26/06/2023 04:34, Penny Zheng wrote: From: Wei Chen Xen defines some global configuration macros for Arm in config.h. We still want to use it for MMU systems, but there are some address Did you mean MPU? yes, typo layout

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

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 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

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

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 33/52] xen/mpu: initialize frametable in MPU system

2023-07-03 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 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 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 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 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 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 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 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-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

[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

[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

[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 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

[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 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 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 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 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
-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 4 files changed

[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 29/52] xen/mpu: introduce a pair helper read_protection_region()/write_protection_region()

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

[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
t;map 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 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

[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
() in 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 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 28/52] xen/mpu: plump virt/maddr conversion in MPU system

2023-06-25 Thread Penny Zheng
-by: 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 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 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 20/52] xen/mmu: move MMU specific P2M code to mmu/p2m.c and mmu/p2m.h

2023-06-25 Thread Penny Zheng
-by: 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 25/52] xen/mpu: introduce helpers for MPU enablement

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

  1   2   3   4   5   6   7   8   >