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

2023-07-04 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 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 on

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

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

2023-07-05 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 03/52] xen/arm: add an option to define Xen start address for Armv8-R

2023-07-05 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 08/52] xen/arm64: move MMU related code from head.S to mmu/head.S

2023-07-05 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 to

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

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

[PATCH V3 0/6] populate/unpopulate memory when domain on static

2022-04-27 Thread Penny Zheng
tatic_allocation" to "is_domain_static()" - put reserved pages on resv_page_list after having taken them off the "normal" list - introduce acquire_reserved_page to retrieve reserved pages from resv_page_list - forbid non-zero-order requests in populate_physmap - let is_dom

[PATCH v3 2/6] xen: do not merge reserved pages in free_heap_pages()

2022-04-27 Thread Penny Zheng
, when trying to merge the about-to-be-freed chunk with the predecessor and/or successor. Signed-off-by: Penny Zheng --- v3 changes: - no changes --- v2 changes: - new commit --- xen/common/page_alloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/common/page_alloc.c b/xen/common

[PATCH v3 3/6] xen: add field "flags" to cover all internal CDF_XXX

2022-04-27 Thread Penny Zheng
With more and more CDF_xxx internal flags in and to save the space, this commit introduces a new field "flags" in struct domain to store CDF_* internal flags directly. Another new CDF_xxx will be introduced in the next patch. Signed-off-by: Penny Zheng --- v3 changes: - change fixed

[PATCH v3 4/6] xen/arm: introduce CDF_staticmem

2022-04-27 Thread Penny Zheng
In order to have an easy and quick way to find out whether this domain memory is statically configured, this commit introduces a new flag CDF_staticmem and a new helper is_domain_using_staticmem() to tell. Reviewed-by: Stefano Stabellini Signed-off-by: Penny Zheng --- v3 changes: - change name

[PATCH v3 5/6] xen/arm: unpopulate memory when domain is static

2022-04-27 Thread Penny Zheng
go back to heap allocator. This commit puts reserved pages on the new list resv_page_list only after having taken them off the "normal" list, when the last ref dropped. Signed-off-by: Penny Zheng --- v3 changes: - have page_list_del() just once out of the if() - remove resv_pages coun

[PATCH v3 6/6] xen: retrieve reserved pages on populate_physmap

2022-04-27 Thread Penny Zheng
acquire_reserved_page to make it work. Signed-off-by: Penny Zheng --- v3 changes - move #ifndef is_domain_using_staticmem to the common header file - remove #ifdef CONFIG_STATIC_MEMORY-ary - remove meaningless page_to_mfn(page) in error log --- v2 changes: - introduce acquire_reserved_page to retrieve

RE: [PATCH v3 5/6] xen/arm: unpopulate memory when domain is static

2022-04-27 Thread Penny Zheng
Hi julien > -Original Message- > From: Julien Grall > Sent: Wednesday, April 27, 2022 6:11 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Henry Wang ; > Stefano Stabellini ; Bertrand Marquis > ; Volodymyr Babchuk > ; Andrew Cooper > ; Ge

RE: [PATCH v3 5/6] xen/arm: unpopulate memory when domain is static

2022-04-27 Thread Penny Zheng
Hi julien > -Original Message- > From: Julien Grall > Sent: Wednesday, April 27, 2022 6:23 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Henry Wang ; > Stefano Stabellini ; Bertrand Marquis > ; Volodymyr Babchuk > ; Andrew Cooper > ; Ge

[PATCH v3 1/6] xen: do not free reserved memory into heap

2022-04-27 Thread Penny Zheng
freeing memory resource, so let's drop the __init flag. Signed-off-by: Penny Zheng --- This is a reissued commit for patch serie "populate/unpopulate memory when domain on static allocation"( https://patchwork.kernel.org/project/xen-devel/list/?series=636094). This commit has be

RE: [PATCH v3 5/6] xen/arm: unpopulate memory when domain is static

2022-04-27 Thread Penny Zheng
Hi > -Original Message- > From: Stefano Stabellini > Sent: Thursday, April 28, 2022 6:32 AM > To: Penny Zheng > Cc: Julien Grall ; xen-devel@lists.xenproject.org; Wei Chen > ; Henry Wang ; Stefano > Stabellini ; Bertrand Marquis > ; Volodymyr Babchuk > ; Andr

RE: [PATCH v3 1/6] xen: do not free reserved memory into heap

2022-05-04 Thread Penny Zheng
Hi jan > -Original Message- > From: Jan Beulich > Sent: Wednesday, May 4, 2022 9:27 PM > To: Penny Zheng > Cc: Wei Chen ; Andrew Cooper > ; George Dunlap ; > Julien Grall ; Stefano Stabellini ; > Wei > Liu ; xen-devel@lists.xenproject.org > Subject: Re: [

RE: [PATCH v3 2/6] xen: do not merge reserved pages in free_heap_pages()

2022-05-04 Thread Penny Zheng
Hi, > -Original Message- > From: Jan Beulich > Sent: Wednesday, May 4, 2022 9:30 PM > To: Penny Zheng > Cc: Wei Chen ; Henry Wang ; > Andrew Cooper ; George Dunlap > ; Julien Grall ; Stefano > Stabellini ; Wei Liu ; xen- > de...@lists.xenproject.org > S

RE: [PATCH v3 6/6] xen: retrieve reserved pages on populate_physmap

2022-05-04 Thread Penny Zheng
Hi jan > -Original Message- > From: Jan Beulich > Sent: Wednesday, May 4, 2022 9:45 PM > To: Penny Zheng > Cc: Wei Chen ; Henry Wang ; > Andrew Cooper ; George Dunlap > ; Julien Grall ; Stefano > Stabellini ; Wei Liu ; xen- > de...@lists.xenproject.org > S

RE: [PATCH v3 6/6] xen: retrieve reserved pages on populate_physmap

2022-05-05 Thread Penny Zheng
Hi jan > -Original Message- > From: Jan Beulich > Sent: Thursday, May 5, 2022 3:47 PM > To: Penny Zheng > Cc: Wei Chen ; Henry Wang ; > Andrew Cooper ; George Dunlap > ; Julien Grall ; Stefano > Stabellini ; Wei Liu ; xen- > de...@lists.xenproject.org > S

RE: [PATCH v3 6/6] xen: retrieve reserved pages on populate_physmap

2022-05-05 Thread Penny Zheng
Hi jan > -Original Message- > From: Jan Beulich > Sent: Thursday, May 5, 2022 4:51 PM > To: Penny Zheng > Cc: Wei Chen ; Henry Wang ; > Andrew Cooper ; George Dunlap > ; Julien Grall ; Stefano > Stabellini ; Wei Liu ; xen- > de...@lists.xenproject.org > S

RE: [PATCH v3 6/6] xen: retrieve reserved pages on populate_physmap

2022-05-05 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Thursday, May 5, 2022 8:07 PM > To: Penny Zheng > Cc: Wei Chen ; Henry Wang ; > Andrew Cooper ; George Dunlap > ; Julien Grall ; Stefano Stabellini > ; Wei Liu ; xen- > de...@lists.xenproject.org > S

RE: [PATCH v3 6/6] xen: retrieve reserved pages on populate_physmap

2022-05-05 Thread Penny Zheng
Hi jan > -Original Message- > From: Jan Beulich > Sent: Thursday, May 5, 2022 10:23 PM > To: Penny Zheng > Cc: Wei Chen ; Henry Wang ; > Andrew Cooper ; George Dunlap > ; Julien Grall ; Stefano Stabellini > ; Wei Liu ; xen- > de...@lists.xenproject.org > S

[PATCH v2 3/9] xen/arm: allocate static shared memory to a specific owner domain

2022-05-06 Thread Penny Zheng
introduced later in the following commits. Signed-off-by: Penny Zheng --- v2 change: - P2M mapping is restricted to normal domain - in-code comment fix --- xen/arch/arm/domain_build.c | 55 + 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/xen

[PATCH v2 1/9] xen/arm: introduce static shared memory

2022-05-06 Thread Penny Zheng
From: Penny Zheng This patch serie introduces a new feature: setting up static shared memory on a dom0less system, through device tree configuration. This commit parses shared memory node at boot-time, and reserve it in bootinfo.reserved_mem to avoid other use. This commits proposes a new

[PATCH v2 0/9] static shared memory on dom0less system

2022-05-06 Thread Penny Zheng
r more details. Penny Zheng (9): xen/arm: introduce static shared memory xen/arm: allocate static shared memory to the default owner dom_io xen/arm: allocate static shared memory to a specific owner domain xen/arm: introduce put_page_nr and get_page_nr xen/arm: Add additional reference t

[PATCH v2 2/9] xen/arm: allocate static shared memory to the default owner dom_io

2022-05-06 Thread Penny Zheng
From: Penny Zheng This commit introduces process_shm to cope with static shared memory in domain construction. DOMID_IO will be the default owner of memory pre-shared among multiple domains at boot time, when no explicit owner is specified. This commit only considers allocating static shared

[PATCH v2 5/9] xen/arm: Add additional reference to owner domain when the owner is allocated

2022-05-06 Thread Penny Zheng
Borrower domain will fail to get a page ref using the owner domain during allocation, when the owner is created after borrower. So here, we decide to get and add the right amount of reference, which is the number of borrowers, when the owner is allocated. Signed-off-by: Penny Zheng --- v2

[PATCH v2 4/9] xen/arm: introduce put_page_nr and get_page_nr

2022-05-06 Thread Penny Zheng
introduces a set of new helpers put_page_nr() and get_page_nr() to increment/drop the page reference by nr. Signed-off-by: Penny Zheng --- v2 change: - new commit --- xen/arch/arm/include/asm/mm.h | 4 xen/arch/arm/mm.c | 36 +-- 2 files changed, 30

[PATCH v2 6/9] xen/arm: add P2M type parameter in guest_physmap_add_pages

2022-05-06 Thread Penny Zheng
In order to cover the scenario where users intend to set up guest p2m foreign mapping with nr_pages, this commit adds a new P2M type parameter in guest_physmap_add_pages. Signed-off-by: Penny Zheng --- v2 change: - no change --- xen/arch/arm/domain_build.c| 5 +++-- xen/arch/arm/include/asm

[PATCH v2 7/9] xen/arm: set up shared memory foreign mapping for borrower domain

2022-05-06 Thread Penny Zheng
This commit sets up shared memory foreign mapping for borrower domain. If owner domain is the default dom_io, all shared domain are treated as borrower domain. Signed-off-by: Penny Zheng --- v2 change: - remove guest_physmap_add_shm, since for borrower domain, we only do P2M foreign memory

[PATCH v2 9/9] xen/arm: enable statically shared memory on Dom0

2022-05-06 Thread Penny Zheng
From: Penny Zheng To add statically shared memory nodes in Dom0, user shall put according static shared memory configuration under /chosen node. This commit adds shm-processing function process_shm in construct_dom0 to enable statically shared memory on Dom0. Signed-off-by: Penny Zheng --- v2

[PATCH v2 8/9] xen/arm: create shared memory nodes in guest device tree

2022-05-06 Thread Penny Zheng
following properties: - compatible: compatible = "xen,shared-memory-v1" - reg: the base guest physical address and size of the shared memory region - xen,id: a string that identifies the shared memory region. Signed-off-by: Penny Zheng --- v2 change: - using xzal

RE: [PATCH v3 6/6] xen: retrieve reserved pages on populate_physmap

2022-05-06 Thread Penny Zheng
Hi jan and julien > -Original Message- > From: Jan Beulich > Sent: Friday, May 6, 2022 2:14 PM > To: Penny Zheng > Cc: Wei Chen ; Henry Wang ; > Andrew Cooper ; George Dunlap > ; Julien Grall ; Stefano Stabellini > ; Wei Liu ; xen- > de...@lists.xenproject.org

RE: [PATCH v2 1/9] xen/arm: introduce static shared memory

2022-05-06 Thread Penny Zheng
Hi Stefano > -Original Message- > From: Stefano Stabellini > Sent: Saturday, May 7, 2022 9:08 AM > To: Penny Zheng > Cc: xen-devel@lists.xenproject.org; Wei Chen ; Stefano > Stabellini ; Julien Grall ; Bertrand > Marquis ; Volodymyr Babchuk > > Subject:

RE: [PATCH v2 4/9] xen/arm: introduce put_page_nr and get_page_nr

2022-05-07 Thread Penny Zheng
Hi Stefano > -Original Message- > From: Stefano Stabellini > Sent: Saturday, May 7, 2022 9:09 AM > To: Penny Zheng > Cc: xen-devel@lists.xenproject.org; Wei Chen ; Stefano > Stabellini ; Julien Grall ; Bertrand > Marquis ; Volodymyr Babchuk > > Subject:

RE: [PATCH v2 6/9] xen/arm: add P2M type parameter in guest_physmap_add_pages

2022-05-07 Thread Penny Zheng
Hi julien > -Original Message- > From: Julien Grall > Sent: Saturday, May 7, 2022 5:01 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Stefano Stabellini > ; Bertrand Marquis ; > Volodymyr Babchuk > Subject: Re: [PATCH v2 6/9] xen/arm: a

[PATCH v4 1/6] xen: do not free reserved memory into heap

2022-05-09 Thread Penny Zheng
freeing memory resource, so let's drop the __init flag. Signed-off-by: Penny Zheng --- v4 changes: - no changes --- v3 changes: - fix possible racy issue in free_staticmem_pages() - introduce a stub free_staticmem_pages() for the !CONFIG_STATIC_MEMORY case - move the change to free_heap_pages

[PATCH V4 0/6] populate/unpopulate memory when domain on static

2022-05-09 Thread Penny Zheng
ages on resv_page_list after having taken them off the "normal" list - introduce acquire_reserved_page to retrieve reserved pages from resv_page_list - forbid non-zero-order requests in populate_physmap - let is_domain_static return ((void)(d), false) on x86 - fix coding style Penny Zhe

[PATCH v4 2/6] xen: do not merge reserved pages in free_heap_pages()

2022-05-09 Thread Penny Zheng
result. So in order to avoid the above scenario, this commit updates free_heap_pages() to check whether the predecessor and/or successor has PGC_reserved set, when trying to merge the about-to-be-freed chunk with the predecessor and/or successor. Signed-off-by: Penny Zheng Suggested-by: Julien Grall

[PATCH v4 3/6] xen: add field "flags" to cover all internal CDF_XXX

2022-05-09 Thread Penny Zheng
With more and more CDF_xxx internal flags in and to save the space, this commit introduces a new field "flags" in struct domain to store CDF_* internal flags directly. Another new CDF_xxx will be introduced in the next patch. Signed-off-by: Penny Zheng Acked-by: Julien Grall ---

[PATCH v4 4/6] xen/arm: introduce CDF_staticmem

2022-05-09 Thread Penny Zheng
In order to have an easy and quick way to find out whether this domain memory is statically configured, this commit introduces a new flag CDF_staticmem and a new helper is_domain_using_staticmem() to tell. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v4 changes: - no changes

[PATCH v4 5/6] xen/arm: unpopulate memory when domain is static

2022-05-09 Thread Penny Zheng
go back to heap allocator. This commit puts reserved pages on the new list resv_page_list only after having taken them off the "normal" list, when the last ref dropped. Signed-off-by: Penny Zheng --- v4 changes: - no changes --- v3 changes: - have page_list_del() just once out

[PATCH v4 6/6] xen: retrieve reserved pages on populate_physmap

2022-05-09 Thread Penny Zheng
acquire_reserved_page to make it work. Signed-off-by: Penny Zheng --- v4 changes: - miss dropping __init in acquire_domstatic_pages - add the page back to the reserved list in case of error - remove redundant printk - refine log message and make it warn level --- v3 changes: - move is_domain_using_staticmem

[PATCH v3 2/8] xen/arm: allocate static shared memory to the default owner dom_io

2022-05-12 Thread Penny Zheng
From: Penny Zheng This commit introduces process_shm to cope with static shared memory in domain construction. DOMID_IO will be the default owner of memory pre-shared among multiple domains at boot time, when no explicit owner is specified. This commit only considers allocating static shared

[PATCH v3 0/8] static shared memory on dom0less system

2022-05-12 Thread Penny Zheng
r more details. Penny Zheng (8): xen/arm: introduce static shared memory xen/arm: allocate static shared memory to the default owner dom_io xen/arm: allocate static shared memory to a specific owner domain xen/arm: introduce put_page_nr and get_page_nr xen/arm: Add additional reference to own

[PATCH v3 1/8] xen/arm: introduce static shared memory

2022-05-12 Thread Penny Zheng
From: Penny Zheng This patch serie introduces a new feature: setting up static shared memory on a dom0less system, through device tree configuration. This commit parses shared memory node at boot-time, and reserve it in bootinfo.reserved_mem to avoid other use. This commits proposes a new

[PATCH v3 3/8] xen/arm: allocate static shared memory to a specific owner domain

2022-05-12 Thread Penny Zheng
introduced later in the following commits. Signed-off-by: Penny Zheng --- v3 change: - simplify the code since o_gbase is not used if the domain is dom_io --- v2 change: - P2M mapping is restricted to normal domain - in-code comment fix --- xen/arch/arm/domain_build.c | 44

[PATCH v3 4/8] xen/arm: introduce put_page_nr and get_page_nr

2022-05-12 Thread Penny Zheng
introduces a set of new helpers put_page_nr() and get_page_nr() to increment/drop the page reference by nr. Signed-off-by: Penny Zheng --- v3 changes: - check overflow with "n" - remove spurious change - bring back the check that we enter the loop only when count_info is greater than 0 ---

[PATCH v3 5/8] xen/arm: Add additional reference to owner domain when the owner is allocated

2022-05-12 Thread Penny Zheng
Borrower domain will fail to get a page ref using the owner domain during allocation, when the owner is created after borrower. So here, we decide to get and add the right amount of reference, which is the number of borrowers, when the owner is allocated. Signed-off-by: Penny Zheng --- v3

[PATCH v3 8/8] xen/arm: enable statically shared memory on Dom0

2022-05-12 Thread Penny Zheng
From: Penny Zheng To add statically shared memory nodes in Dom0, user shall put according static shared memory configuration under /chosen node. This commit adds shm-processing function process_shm in construct_dom0 to enable statically shared memory on Dom0. Signed-off-by: Penny Zheng

[PATCH v3 6/8] xen/arm: set up shared memory foreign mapping for borrower domain

2022-05-12 Thread Penny Zheng
This commit sets up shared memory foreign mapping for borrower domain. If owner domain is the default dom_io, all shared domain are treated as borrower domain. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v3 change: - use map_regions_p2mt instead --- v2 change: - remove

[PATCH v3 7/8] xen/arm: create shared memory nodes in guest device tree

2022-05-12 Thread Penny Zheng
following properties: - compatible: compatible = "xen,shared-memory-v1" - reg: the base guest physical address and size of the shared memory region - xen,id: a string that identifies the shared memory region. Signed-off-by: Penny Zheng --- v3 change: - move field &

RE: [PATCH v3 4/8] xen/arm: introduce put_page_nr and get_page_nr

2022-05-12 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Thursday, May 12, 2022 6:14 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Stefano Stabellini > ; Bertrand Marquis ; > Volodymyr Babchuk > Subject: Re: [PATCH v3 4/8] xen/arm: i

RE: [PATCH v3 5/8] xen/arm: Add additional reference to owner domain when the owner is allocated

2022-05-12 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Thursday, May 12, 2022 6:54 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Stefano Stabellini > ; Bertrand Marquis ; > Volodymyr Babchuk > Subject: Re: [PATCH v3 5/8] xen/arm: Add

RE: [PATCH v4 6/6] xen: retrieve reserved pages on populate_physmap

2022-05-16 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Tuesday, May 17, 2022 2:29 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Andrew Cooper > ; George Dunlap ; > Jan Beulich ; Stefano Stabellini ; > Wei Liu > Subject: Re: [

RE: [PATCH v4 1/6] xen: do not free reserved memory into heap

2022-05-17 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Tuesday, May 17, 2022 2:01 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Andrew Cooper > ; George Dunlap ; > Jan Beulich ; Stefano Stabellini ; > Wei Liu > Subject: Re: [PAT

[PATCH v4 1/8] xen/arm: introduce static shared memory

2022-05-17 Thread Penny Zheng
From: Penny Zheng This patch serie introduces a new feature: setting up static shared memory on a dom0less system, through device tree configuration. This commit parses shared memory node at boot-time, and reserve it in bootinfo.reserved_mem to avoid other use. This commits proposes a new

[PATCH v4 0/8] static shared memory on dom0less system

2022-05-17 Thread Penny Zheng
r more details. Penny Zheng (8): xen/arm: introduce static shared memory xen/arm: allocate static shared memory to the default owner dom_io xen/arm: allocate static shared memory to a specific owner domain xen/arm: introduce put_page_nr and get_page_nr xen/arm: Add additional reference to own

[PATCH v4 2/8] xen/arm: allocate static shared memory to the default owner dom_io

2022-05-17 Thread Penny Zheng
From: Penny Zheng This commit introduces process_shm to cope with static shared memory in domain construction. DOMID_IO will be the default owner of memory pre-shared among multiple domains at boot time, when no explicit owner is specified. This commit only considers allocating static shared

[PATCH v4 3/8] xen/arm: allocate static shared memory to a specific owner domain

2022-05-17 Thread Penny Zheng
introduced later in the following commits. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v4 change: - no changes --- v3 change: - simplify the code since o_gbase is not used if the domain is dom_io --- v2 change: - P2M mapping is restricted to normal domain - in-code comment fix

[PATCH v4 4/8] xen/arm: introduce put_page_nr and get_page_nr

2022-05-17 Thread Penny Zheng
introduces a set of new helpers put_page_nr() and get_page_nr() to increment/drop the page reference by nr. Signed-off-by: Penny Zheng --- v4 changes: - make sure that the right equation return is at least equal to n - simplify the underflow --- v3 changes: - check overflow with "n" - remov

[PATCH v4 5/8] xen/arm: Add additional reference to owner domain when the owner is allocated

2022-05-17 Thread Penny Zheng
Borrower domain will fail to get a page ref using the owner domain during allocation, when the owner is created after borrower. So here, we decide to get and add the right amount of reference, which is the number of borrowers, when the owner is allocated. Signed-off-by: Penny Zheng --- v4

[PATCH v4 7/8] xen/arm: create shared memory nodes in guest device tree

2022-05-17 Thread Penny Zheng
following properties: - compatible: compatible = "xen,shared-memory-v1" - reg: the base guest physical address and size of the shared memory region - xen,id: a string that identifies the shared memory region. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabelli

[PATCH v4 6/8] xen/arm: set up shared memory foreign mapping for borrower domain

2022-05-17 Thread Penny Zheng
This commit sets up shared memory foreign mapping for borrower domain. If owner domain is the default dom_io, all shared domain are treated as borrower domain. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v4 changes: - no change --- v3 change: - use map_regions_p2mt instead

[PATCH v4 8/8] xen/arm: enable statically shared memory on Dom0

2022-05-17 Thread Penny Zheng
From: Penny Zheng To add statically shared memory nodes in Dom0, user shall put according static shared memory configuration under /chosen node. This commit adds shm-processing function process_shm in construct_dom0 to enable statically shared memory on Dom0. Signed-off-by: Penny Zheng

RE: [PATCH v4 1/6] xen: do not free reserved memory into heap

2022-05-17 Thread Penny Zheng
Hi Jan and Julien > -Original Message- > From: Jan Beulich > Sent: Wednesday, May 18, 2022 12:11 AM > To: Penny Zheng > Cc: Wei Chen ; Andrew Cooper > ; George Dunlap ; > Julien Grall ; Stefano Stabellini ; > Wei > Liu ; xen-devel@lists.xenproject.org > S

RE: [PATCH v4 2/8] xen/arm: allocate static shared memory to the default owner dom_io

2022-05-17 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Wednesday, May 18, 2022 12:01 AM > To: Penny Zheng > Cc: Wei Chen ; Stefano Stabellini > ; Julien Grall ; Bertrand Marquis > ; Volodymyr Babchuk > ; Andrew Cooper > ; George Dunlap ; > Wei Liu ;

RE: [PATCH v4 1/6] xen: do not free reserved memory into heap

2022-05-17 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Tuesday, May 17, 2022 5:29 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Andrew Cooper > ; George Dunlap ; > Jan Beulich ; Stefano Stabellini ; > Wei Liu > Subject: Re: [PAT

[PATCH v5 2/9] xen: do not free reserved memory into heap

2022-05-30 Thread Penny Zheng
freeing memory resource, so let's drop the __init flag. Signed-off-by: Penny Zheng --- v5 changes: - In order to avoid stub functions, we #define PGC_staticmem to non-zero only when CONFIG_STATIC_MEMORY - use "unlikely()" around pg->count_info & PGC_staticmem - remove

[PATCH v5 1/9] xen/arm: rename PGC_reserved to PGC_staticmem

2022-05-30 Thread Penny Zheng
PGC_reserved could be ambiguous, and we have to tell what the pages are reserved for, so this commit intends to rename PGC_reserved to PGC_staticmem, which clearly indicates the page is reserved for static memory. Signed-off-by: Penny Zheng --- v5 changes: - new commit --- xen/arch/arm/include

[PATCH v5 3/9] xen: update SUPPORT.md for static allocation

2022-05-30 Thread Penny Zheng
SUPPORT.md doesn't seem to explicitly say whether static memory is supported, so this commit updates SUPPORT.md to add feature static allocation tech preview for now. Signed-off-by: Penny Zheng --- v5 changes: - new commit --- SUPPORT.md | 7 +++ 1 file changed, 7 insertions(+) diff

[PATCH v5 0/9] populate/unpopulate memory when domain on static allocation

2022-05-30 Thread Penny Zheng
quot; - put reserved pages on resv_page_list after having taken them off the "normal" list - introduce acquire_reserved_page to retrieve reserved pages from resv_page_list - forbid non-zero-order requests in populate_physmap - let is_domain_static return ((void)(d), false) on x86 - fix

[PATCH v5 4/9] xen: do not merge reserved pages in free_heap_pages()

2022-05-30 Thread Penny Zheng
result. So in order to avoid the above scenario, this commit updates free_heap_pages() to check whether the predecessor and/or successor has PGC_reserved set, when trying to merge the about-to-be-freed chunk with the predecessor and/or successor. Suggested-by: Julien Grall Signed-off-by: Penny Zheng

[PATCH v5 5/9] xen: add field "flags" to cover all internal CDF_XXX

2022-05-30 Thread Penny Zheng
With more and more CDF_xxx internal flags in and to save the space, this commit introduces a new field "flags" in struct domain to store CDF_* internal flags directly. Another new CDF_xxx will be introduced in the next patch. Signed-off-by: Penny Zheng Acked-by: Julien Grall ---

[PATCH v5 7/9] xen/arm: unpopulate memory when domain is static

2022-05-30 Thread Penny Zheng
go back to heap allocator. This commit puts reserved pages on the new list resv_page_list only after having taken them off the "normal" list, when the last ref dropped. Signed-off-by: Penny Zheng --- v5 changes: - adapt this patch for PGC_staticmem --- v4 changes: - no changes ---

[PATCH v5 8/9] xen: introduce prepare_staticmem_pages

2022-05-30 Thread Penny Zheng
acquire_staticmem_pages() in two parts, and introduces prepare_staticmem_pages to bypass all "pointless work". Signed-off-by: Penny Zheng --- v5 changes: - new commit --- xen/common/page_alloc.c | 61 - 1 file changed, 36 insertions(+), 25 deletion

[PATCH v5 6/9] xen/arm: introduce CDF_staticmem

2022-05-30 Thread Penny Zheng
In order to have an easy and quick way to find out whether this domain memory is statically configured, this commit introduces a new flag CDF_staticmem and a new helper is_domain_using_staticmem() to tell. Signed-off-by: Penny Zheng --- v5 changes: - guard "is_domain_using_staticmem&q

[PATCH v5 9/9] xen: retrieve reserved pages on populate_physmap

2022-05-30 Thread Penny Zheng
. Signed-off-by: Penny Zheng --- v5 changes: - extract common codes for assigning pages into a helper assign_domstatic_pages - refine commit message - remove stub function acquire_reserved_page - Alloc/free of memory can happen concurrently. So access to rsv_page_list needs to be protected with a

RE: [PATCH v5 1/9] xen/arm: rename PGC_reserved to PGC_staticmem

2022-06-01 Thread Penny Zheng
Hi jan > -Original Message- > From: Jan Beulich > Sent: Tuesday, May 31, 2022 4:33 PM > To: Penny Zheng > Cc: Wei Chen ; Stefano Stabellini > ; Julien Grall ; Bertrand Marquis > ; Volodymyr Babchuk > ; Andrew Cooper > ; George Dunlap ; > Wei Liu ;

RE: [PATCH v5 2/9] xen: do not free reserved memory into heap

2022-06-01 Thread Penny Zheng
> -Original Message- > From: Jan Beulich > Sent: Tuesday, May 31, 2022 4:37 PM > To: Penny Zheng > Cc: Wei Chen ; Stefano Stabellini > ; Julien Grall ; Bertrand Marquis > ; Volodymyr Babchuk > ; Andrew Cooper > ; George Dunlap ; > Wei Liu ; xen-devel@list

RE: [PATCH v5 6/9] xen/arm: introduce CDF_staticmem

2022-06-02 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Tuesday, May 31, 2022 4:41 PM > To: Penny Zheng > Cc: Wei Chen ; Stefano Stabellini > ; Julien Grall ; Bertrand Marquis > ; Volodymyr Babchuk > ; Andrew Cooper > ; George Dunlap ; > Wei Liu ;

[PATCH v6 0/9] populate/unpopulate memory when domain on static allocation

2022-06-07 Thread Penny Zheng
"is_domain_static()" - put reserved pages on resv_page_list after having taken them off the "normal" list - introduce acquire_reserved_page to retrieve reserved pages from resv_page_list - forbid non-zero-order requests in populate_physmap - let is_domain_static return ((void)(d), false) on x86 - f

[PATCH v6 1/9] xen/arm: rename PGC_reserved to PGC_static

2022-06-07 Thread Penny Zheng
PGC_reserved could be ambiguous, and we have to tell what the pages are reserved for, so this commit intends to rename PGC_reserved to PGC_static, which clearly indicates the page is reserved for static memory. Signed-off-by: Penny Zheng --- v6 changes: - rename PGC_staticmem to PGC_static

[PATCH v6 2/9] xen: do not free reserved memory into heap

2022-06-07 Thread Penny Zheng
freeing memory resource, so let's drop the __init flag. Signed-off-by: Penny Zheng --- v6 changes: - adapt to PGC_static - remove #ifdef aroud function declaration --- v5 changes: - In order to avoid stub functions, we #define PGC_staticmem to non-zero only when CONFIG_STATIC_MEMORY - use &quo

[PATCH v6 3/9] xen: update SUPPORT.md for static allocation

2022-06-07 Thread Penny Zheng
SUPPORT.md doesn't seem to explicitly say whether static memory is supported, so this commit updates SUPPORT.md to add feature static allocation tech preview for now. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v6 changes: - use domain instead of sub-systems --- v5 ch

[PATCH v6 4/9] xen: do not merge reserved pages in free_heap_pages()

2022-06-07 Thread Penny Zheng
result. So in order to avoid the above scenario, this commit updates free_heap_pages() to check whether the predecessor and/or successor has PGC_reserved set, when trying to merge the about-to-be-freed chunk with the predecessor and/or successor. Suggested-by: Julien Grall Signed-off-by: Penny Zheng

[PATCH v6 5/9] xen: add field "flags" to cover all internal CDF_XXX

2022-06-07 Thread Penny Zheng
With more and more CDF_xxx internal flags in and to save the space, this commit introduces a new field "flags" in struct domain to store CDF_* internal flags directly. Another new CDF_xxx will be introduced in the next patch. Signed-off-by: Penny Zheng Acked-by: Julien Grall ---

[PATCH v6 6/9] xen/arm: introduce CDF_staticmem

2022-06-07 Thread Penny Zheng
In order to have an easy and quick way to find out whether this domain memory is statically configured, this commit introduces a new flag CDF_staticmem and a new helper is_domain_using_staticmem() to tell. Signed-off-by: Penny Zheng --- v6 changes: - move non-zero is_domain_using_staticmem

[PATCH v6 9/9] xen: retrieve reserved pages on populate_physmap

2022-06-07 Thread Penny Zheng
. Signed-off-by: Penny Zheng --- v6 changes: - drop the lock before returning --- v5 changes: - extract common codes for assigning pages into a helper assign_domstatic_pages - refine commit message - remove stub function acquire_reserved_page - Alloc/free of memory can happen concurrently. So access

[PATCH v6 7/9] xen/arm: unpopulate memory when domain is static

2022-06-07 Thread Penny Zheng
go back to heap allocator. This commit puts reserved pages on the new list resv_page_list only after having taken them off the "normal" list, when the last ref dropped. Signed-off-by: Penny Zheng Acked-by: Jan Beulich --- v6 changes: - refine in-code comment - move

[PATCH v6 8/9] xen: introduce prepare_staticmem_pages

2022-06-07 Thread Penny Zheng
acquire_staticmem_pages() in two parts, and introduces prepare_staticmem_pages to bypass all "pointless work". Signed-off-by: Penny Zheng Acked-by: Jan Beulich --- v6 changes: - adapt to PGC_static --- v5 changes: - new commit --- xen/common/page_al

RE: [PATCH v6 7/9] xen/arm: unpopulate memory when domain is static

2022-06-08 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Tuesday, June 7, 2022 5:20 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Stefano Stabellini > ; Bertrand Marquis ; > Volodymyr Babchuk ; Andrew Cooper > ; George Dunlap ;

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