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

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

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

[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

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

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

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

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

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

[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

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

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

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

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

2022-04-24 Thread Penny Zheng
Hi jan > -Original Message- > From: Jan Beulich > Sent: Tuesday, April 19, 2022 5:11 PM > To: Penny Zheng > Cc: Wei Chen ; Stefano Stabellini > ; Julien Grall ; Bertrand Marquis > ; Volodymyr Babchuk > ; Andrew Cooper > ; George Dunlap ; > Wei Liu ;

RE: [PATCH v1 08/13] xen/arm: destroy static shared memory when de-construct domain

2022-04-21 Thread Penny Zheng
Hi, julien > -Original Message- > From: Julien Grall > Sent: Saturday, April 9, 2022 5:26 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: nd ; Stefano Stabellini ; Bertrand > Marquis ; Volodymyr Babchuk > > Subject: Re: [PATCH v1 08/13] xen/arm: dest

RE: [PATCH v1 06/13] xen/arm: set up shared memory foreign mapping for borrower domain

2022-04-20 Thread Penny Zheng
Hi > -Original Message- > From: Julien Grall > Sent: Saturday, April 9, 2022 5:31 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: nd ; Stefano Stabellini ; Bertrand > Marquis ; Volodymyr Babchuk > > Subject: Re: [PATCH v1 06/13] xen/arm: set

RE: [PATCH v1 06/13] xen/arm: set up shared memory foreign mapping for borrower domain

2022-04-20 Thread Penny Zheng
Hi julien > -Original Message- > From: Julien Grall > Sent: Saturday, April 9, 2022 6:59 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: nd ; Stefano Stabellini ; Bertrand > Marquis ; Volodymyr Babchuk > > Subject: Re: [PATCH v1 06/13] xen/arm: set

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

2022-04-19 Thread Penny Zheng
Hi jan > -Original Message- > From: Jan Beulich > Sent: Tuesday, April 19, 2022 4:59 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 V2 0/6] populate/unpopulate memory when domain on static

2022-04-19 Thread Penny Zheng
Hi jan > -Original Message- > From: Jan Beulich > Sent: Tuesday, April 19, 2022 4:47 PM > To: Penny Zheng > Cc: Wei Chen ; Andrew Cooper > ; George Dunlap ; > Julien Grall ; Stefano Stabellini ; > Wei > Liu ; Bertrand Marquis ; > Volodymyr Babchuk ; xen

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

2022-04-18 Thread Penny Zheng
acquire_reserved_page to make it work. Signed-off-by: Penny Zheng --- v2 changes: - 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 --- xen/common/memory.c | 29

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

2022-04-18 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_static to tell. Signed-off-by: Penny Zheng --- v2 changes: - change name from "is_domain_on_static_allocatio

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

2022-04-18 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 --- v2 changes: - let "fla

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

2022-04-18 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 --- v2 changes: - put reserved pages on resv_page_list after having taken them off the &qu

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

2022-04-18 Thread Penny Zheng
, when trying to merge the about-to-be-freed chunk with the predecessor and/or successor. Signed-off-by: Penny Zheng --- 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/page_alloc.c index 9a3e9c1328

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

2022-04-18 Thread Penny Zheng
al" 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 Zheng (6): xen/arm: do not free reserved memory into heap xen/arm: do n

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

2022-04-18 Thread Penny Zheng
freeing memory resource, so let's drop the __init flag. Signed-off-by: Penny Zheng --- v2 changes: - new commit --- xen/common/page_alloc.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 319029140f..9a3e9

RE: [PATCH v1 02/13] xen/arm: introduce a special domain DOMID_SHARED

2022-04-15 Thread Penny Zheng
Hi jan > -Original Message- > From: Jan Beulich > Sent: Friday, March 18, 2022 4:53 PM > To: Penny Zheng > Cc: nd ; Penny Zheng > ; Stefano Stabellini > ; Julien Grall ; Bertrand Marquis > ; Volodymyr Babchuk > ; Andrew Cooper > ; George

RE: [PATCH v1 02/13] xen/arm: introduce a special domain DOMID_SHARED

2022-04-15 Thread Penny Zheng
Hi Julien and Stefano > -Original Message- > From: Julien Grall > Sent: Saturday, April 9, 2022 5:12 PM > To: Stefano Stabellini ; Jan Beulich > > Cc: Penny Zheng ; nd ; Penny Zheng > ; Bertrand Marquis > ; Volodymyr Babchuk > ; Andrew Cooper > ; George

RE: [PATCH v1 3/5] xen/arm: unpopulate memory when domain on static allocation

2022-04-02 Thread Penny Zheng
Hi Julien and Jan > -Original Message- > From: Julien Grall > Sent: Saturday, April 2, 2022 2:54 AM > To: Penny Zheng ; Jan Beulich > Cc: Wei Chen ; Henry Wang ; > Andrew Cooper ; George Dunlap > ; Stefano Stabellini ; Wei > Liu ; xen-devel@lists.xenproject.org

RE: [PATCH v1 3/5] xen/arm: unpopulate memory when domain on static allocation

2022-03-31 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Thursday, March 31, 2022 3:06 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 v1 4/5] xen/arm: retrieve reserved pages on populate_physmap

2022-03-30 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Wednesday, March 30, 2022 5:59 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 v1 3/5] xen/arm: unpopulate memory when domain on static allocation

2022-03-30 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Wednesday, March 30, 2022 5:53 PM > To: Penny Zheng > Cc: Wei Chen ; Henry Wang ; > Andrew Cooper ; George Dunlap > ; Julien Grall ; Stefano Stabellini > ; Wei Liu ; xen- > de...@lists.xenproject.org &

[PATCH v1 4/5] xen/arm: retrieve reserved pages on populate_physmap

2022-03-30 Thread Penny Zheng
When domain on static allocation populates memory through populate_physmap, other than allocating from heap, it shall allocate from resv_page_list to make sure that all guest RAM are still restricted in statically configured regions. Signed-off-by: Penny Zheng --- xen/common/memory.c | 20

[PATCH v1 5/5] xen/arm: no need to store pages in resv_page_list when domain is directly mapped

2022-03-30 Thread Penny Zheng
When domain on static allocation and is directly mapped, in terms of GPA == HPA(guest physical address == host physical address), we could use mfn_to_page() to easily find the page, so there is no need to store pages in resv_page_list. Signed-off-by: Penny Zheng --- xen/common/memory.c | 5

[PATCH v1 3/5] xen/arm: unpopulate memory when domain on static allocation

2022-03-30 Thread Penny Zheng
to heap. For above purpose, this commit tries to keep page allocated and store it in page list d->resv_page_list on guest_remove_page, when domain on static allocation. Signed-off-by: Penny Zheng --- xen/common/domain.c | 4 xen/common/memory.c | 22 +-

[PATCH v1 1/5] xen/arm: field "flags" to cover all internal CDF_XXX

2022-03-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" to store CDF_* internal flags directly. Another new CDF_xxx will be introduced in the next patch. Signed-off-by: Penny Zheng --- xen/arch/arm/domain.c | 3 ++-

[PATCH v1 2/5] xen/arm: introduce CDF_staticmem

2022-03-30 Thread Penny Zheng
In order to have an easy and quick way to find out whether this domain is on static allocation, this commit introduces a new flag CDF_staticmem and a new helper is_domain_on_static_allocation. Signed-off-by: Penny Zheng --- xen/arch/arm/domain_build.c | 5 - xen/arch/arm/include/asm

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

2022-03-30 Thread Penny Zheng
never go back to heap. This patch serie intends to fix this issue, by keeping page allocated and storing it in page list when unpopulating memory, and retrieving page from page list when populating memory. Penny Zheng (5): xen/arm: field "flags" to cover all internal CDF_XXX

RE: [PATCH v1 11/13] xen/arm: store shm-info for deferred foreign memory map

2022-03-29 Thread Penny Zheng
Hi Stefano > -Original Message- > From: Stefano Stabellini > Sent: Friday, March 18, 2022 10:01 AM > To: Penny Zheng > Cc: xen-devel@lists.xenproject.org; nd ; Stefano Stabellini > ; Julien Grall ; Bertrand Marquis > ; Volodymyr Babchuk > > Subject: Re: [PAT

RE: [PATCH v1 06/13] xen/arm: set up shared memory foreign mapping for borrower domain

2022-03-28 Thread Penny Zheng
Hi Stefano Sorry for the late response, got sidetracked an emergency issue. ;/ > -Original Message- > From: Stefano Stabellini > Sent: Friday, March 18, 2022 10:00 AM > To: Penny Zheng > Cc: xen-devel@lists.xenproject.org; nd ; Stefano Stabellini > ; Julien Grall

RE: [PATCH v1 03/13] xen/arm: allocate static shared memory to dom_shared

2022-03-18 Thread Penny Zheng
Hi Stefano > -Original Message- > From: Stefano Stabellini > Sent: Friday, March 18, 2022 10:00 AM > To: Penny Zheng > Cc: xen-devel@lists.xenproject.org; nd ; Stefano Stabellini > ; Julien Grall ; Bertrand Marquis > ; Volodymyr Babchuk > > Subject: R

RE: [PATCH v1 02/13] xen/arm: introduce a special domain DOMID_SHARED

2022-03-17 Thread Penny Zheng
Hi Stefano > -Original Message- > From: Stefano Stabellini > Sent: Friday, March 18, 2022 9:59 AM > To: Penny Zheng > Cc: xen-devel@lists.xenproject.org; nd ; Penny Zheng > ; Stefano Stabellini > ; Julien Grall ; Bertrand Marquis > ; Volodymyr Babchuk > ; Andr

[PATCH v1 12/13] xen/arm: defer foreign memory map in shm_init_late

2022-03-10 Thread Penny Zheng
From: Penny Zheng This commit introduces a new helper shm_init_late to implement deferred foreign memory mapping of static shared memory. Signed-off-by: Penny Zheng --- xen/arch/arm/domain_build.c | 51 +++ xen/arch/arm/include/asm/domain.h | 1 + xen/arch

[PATCH v1 11/13] xen/arm: store shm-info for deferred foreign memory map

2022-03-10 Thread Penny Zheng
From: Penny Zheng In a few scenarios where owner domain, is defined after borrower domain in device tree configuration, then statically shared pages haven't been properly allocated if borrower domain tries to do foreign memory map during domain construction. In order to cover such scenari

[PATCH v1 13/13] xen/arm: unmap foreign memory mapping when destroyed domain is owner domain

2022-03-10 Thread Penny Zheng
From: Penny Zheng When destroyed domain is an owner domain of a static shared memory region, then we need to ensure that all according borrower domains shall not have the access to this static shared memory region too. This commit covers above scenario through unmapping all borrowers' acco

[PATCH v1 10/13] xen/arm: allocate static shared memory to a specific owner domain

2022-03-10 Thread Penny Zheng
From: Penny Zheng If owner property is defined, then owner domain of a static shared memory region is not the default dom_shared anymore, but a specific domain. This commit implements allocating static shared memory to a specific domain when owner property is defined. Signed-off-by: Penny

[PATCH v1 09/13] xen/arm: enable statically shared memory on Dom0

2022-03-10 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 v1 07/13] xen/arm: create shared memory nodes in guest device tree

2022-03-10 Thread Penny Zheng
From: Penny Zheng We expose the shared memory to the domU using the "xen,shared-memory-v1" reserved-memory binding. See Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt in Linux for the corresponding device tree binding. To save the cost of re-parsing shared mem

[PATCH v1 01/13] xen/arm: introduce static shared memory

2022-03-10 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. Signed-off-by: Penny Zheng

[PATCH v1 08/13] xen/arm: destroy static shared memory when de-construct domain

2022-03-10 Thread Penny Zheng
From: Penny Zheng This commit introduces a new helper destroy_domain_shm to destroy static shared memory at domain de-construction. This patch only considers the scenario where the owner domain is the default dom_shared, for user-defined owner domain, it will be covered in the following patches

[PATCH v1 06/13] xen/arm: set up shared memory foreign mapping for borrower domain

2022-03-10 Thread Penny Zheng
From: Penny Zheng This commits introduces a new helper guest_physmap_add_shm to set up shared memory foreign mapping for borrower domain. Firstly it should get and take reference of statically shared pages from owner dom_shared. Then it will setup P2M foreign memory map of these statically

[PATCH v1 03/13] xen/arm: allocate static shared memory to dom_shared

2022-03-10 Thread Penny Zheng
From: Penny Zheng This commit introduces process_shm to cope with static shared memory in domain construction. This commit only considers allocating static shared memory to dom_shared when owner domain is not explicitly defined in device tree, the other scenario will be covered in the following

[PATCH v1 04/13] xen/arm: add P2M type parameter in guest_physmap_add_pages

2022-03-10 Thread Penny Zheng
From: 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 --- xen/arch/arm/domain_build.c| 5 +++-- xen/arch/arm/include/asm/p2m.h

[PATCH v1 05/13] xen/arm: introduce get_pages_from_gfn

2022-03-10 Thread Penny Zheng
From: Penny Zheng In order to getting statically shared pages based on gfn with nr_pages, this commit introduces a new helper get_pages_from_gfn to acquire a set of pages based on [gfn, gfn + nr_gfns), with the same P2M type. Signed-off-by: Penny Zheng --- xen/arch/arm/include/asm/p2m.h | 37

[PATCH v1 02/13] xen/arm: introduce a special domain DOMID_SHARED

2022-03-10 Thread Penny Zheng
From: Penny Zheng In case to own statically shared pages when owner domain is not explicitly defined, this commits propose a special domain DOMID_SHARED, and we assign it 0x7FF5, as one of the system domains. Statically shared memory reuses the same way of initialization with static memory

[PATCH v1 00/13] Static shared memory on dom0less system

2022-03-10 Thread Penny Zheng
r more details. Penny Zheng (13): xen/arm: introduce static shared memory xen/arm: introduce a special domain DOMID_SHARED xen/arm: allocate static shared memory to dom_shared xen/arm: add P2M type parameter in guest_physmap_add_pages xen/arm: introduce get_pages_from_gfn xen/arm: set up

RE: [PATCH] design: design doc for shared memory on a dom0less system

2022-03-10 Thread Penny Zheng
Hi Julien Sorry for the late response, Since I'm considering sending the code together for better understanding. > -Original Message- > From: Julien Grall > Sent: Wednesday, January 26, 2022 6:58 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabel

RE: Proposal for Porting Xen to Armv8-R64 - DraftA

2022-03-01 Thread Penny Zheng
Hi julien > -Original Message- > From: Wei Chen > Sent: Tuesday, March 1, 2022 3:52 PM > To: Julien Grall ; xen-devel@lists.xenproject.org; Stefano > Stabellini > Cc: Bertrand Marquis ; Penny Zheng > ; Henry Wang ; nd > > Subject: RE: Proposal for Portin

[PATCH v6 09/11] xen/arm: if direct-map domain use native addresses for GICv3

2022-02-13 Thread Penny Zheng
future, this patch introduces a new helper "domain_use_host_layout()" that wraps both two check "is_domain_direct_mapped(d) || is_hardware_domain(d)" for more flexible usage. Signed-off-by: Stefano Stabellini Signed-off-by: Penny Zheng Reviewed-by: Julien Grall Tested-by

[PATCH v6 11/11] xen/docs: Document how to do passthrough without IOMMU

2022-02-13 Thread Penny Zheng
From: Stefano Stabellini This commit creates a new doc to document how to do passthrough without IOMMU. Signed-off-by: Stefano Stabellini Signed-off-by: Penny Zheng Acked-by: Julien Grall Tested-by: Stefano Stabellini --- v2 changes: - nothing changed --- v3 changes: - nothing changed

[PATCH v6 08/11] xen/arm: gate make_gicv3_domU_node with CONFIG_GICV3

2022-02-13 Thread Penny Zheng
This commit gates function make_gicv3_domU_node with CONFIG_GICV3. Signed-off-by: Penny Zheng Acked-by: Stefano Stabellini Tested-by: Stefano Stabellini --- v4 changes: - remove ASSERT_UNREACHABLE() to avoid breaking compilation on prod build with CONFIG_GICV3=n --- v5 changes: - nothing

[PATCH v6 10/11] xen/arm: if direct-map domain use native UART address and IRQ number for vPL011

2022-02-13 Thread Penny Zheng
number: instead of always using GUEST_VPL011_SPI, try to reuse the physical SPI number if possible. Signed-off-by: Stefano Stabellini Signed-off-by: Penny Zheng Reviewed-by: Julien Grall Tested-by: Stefano Stabellini --- v2 changes: - explain why vpl011 initialization before creating its

[PATCH v6 06/11] xen/arm: add ASSERT_UNREACHABLE in allocate_static_memory

2022-02-13 Thread Penny Zheng
Helper allocate_static_memory is not meant to be reachable when built with !CONFIG_STATIC_MEMORY, so this commit adds ASSERT_UNREACHABLE in it to catch potential misuse. Signed-off-by: Penny Zheng Acked-by: Julien Grall Tested-by: Stefano Stabellini --- v3 changes: - new commit --- v4 changes

[PATCH v6 07/11] xen/arm: if direct-map domain use native addresses for GICv2

2022-02-13 Thread Penny Zheng
address as vgic_dist_base, other than the dbase. So this patch also introduces vgic_dist_base/vgic_cpu_base accessor to access correct distributor base address/cpu interface base address on varied scenarios, Signed-off-by: Stefano Stabellini Signed-off-by: Penny Zheng Reviewed-by: Julien Grall Tested

[PATCH v6 05/11] xen/arm: introduce direct-map for domUs

2022-02-13 Thread Penny Zheng
t memory layout This commit introduces a new helper assign_static_memory_11 to allocate static memory as guest RAM for direct-map domain. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini Tested-by: Stefano Stabellini --- v2 changes: - split the common codes into two helpers: parse_stat

[PATCH v6 00/11] direct-map memory map

2022-02-13 Thread Penny Zheng
creating its device tree node - error out if the domain is direct-mapped and the IRQ is not found - harden the code and add a check/comment when the hardware UART region is smaller than CUEST_VPL011_SIZE. Penny Zheng (4): xen/arm: introduce new helper parse_static_mem_prop and acquire_stat

[PATCH v6 03/11] xen/arm: Allow device-passthrough even the IOMMU is off

2022-02-13 Thread Penny Zheng
in so long they are direct-mapped or the device doesn't do DMA. Note that when the IOMMU is disabled, it will be necessary to add xen,force-assign-without-iommu for every device that needs to be assigned. Signed-off-by: Stefano Stabellini Signed-off-by: Penny Zheng Tested-by: Stefano Stabelli

<    1   2   3   4   5   6   7   8   >