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

2022-06-19 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 --- v7 changes: - Add page on the rsv_page_list *after* it has been freed --- v6 changes: -

[PATCH v7 8/9] xen: introduce prepare_staticmem_pages

2022-06-19 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 --- v7 changes: - no change --- v6 changes: - adapt to PGC_static --- v5 changes: - new commit --- xen/common/page_al

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

2022-06-19 Thread Penny Zheng
. Signed-off-by: Penny Zheng --- v7 changes: - remove the lock, since we add the page to rsv_page_list after it has been totally freed. --- v6 changes: - drop the lock before returning --- v5 changes: - extract common codes for assigning pages into a helper assign_domstatic_pages - refine commit

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

2022-06-19 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 --- v7 changes: - IS_ENABLED(CONFIG_STATIC_MEMORY) would not be

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

2022-06-19 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 v5 0/8] static shared memory on dom0less system

2022-06-19 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 v5 3/8] xen/arm: allocate static shared memory to a specific owner domain

2022-06-19 Thread Penny Zheng
introduced later in the following commits. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v5 change: - no change --- 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

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

2022-06-19 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 v5 4/8] xen/arm: introduce put_page_nr and get_page_nr

2022-06-19 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 Reviewed-by: Stefano Stabellini --- v5 change: - no change --- v4 changes: - fix the assert about checking overflow to make sure that the right equation return is at

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

2022-06-19 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 Reviewed-by

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

2022-06-19 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 --- v5 change: - no change --- v4 changes: - no change --- v3 change: - use

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

2022-06-19 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 v5 8/8] xen/arm: enable statically shared memory on Dom0

2022-06-19 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 v7 7/9] xen/arm: unpopulate memory when domain is static

2022-06-27 Thread Penny Zheng
Hi jan > -Original Message- > From: Jan Beulich > Sent: Wednesday, June 22, 2022 5:24 PM > To: Penny Zheng > Cc: Wei Chen ; Andrew Cooper > ; George Dunlap ; > Julien Grall ; Stefano Stabellini ; > Wei Liu ; xen-devel@lists.xenproject.org > Subject:

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

2022-06-27 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Saturday, June 25, 2022 3:51 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 v7 7/9] xen/arm: unpopulate memory when domain is static

2022-06-28 Thread Penny Zheng
Hi Julien and Jan > -Original Message- > From: Julien Grall > Sent: Monday, June 27, 2022 6:19 PM > To: Penny Zheng ; Jan Beulich > Cc: Wei Chen ; Andrew Cooper > ; George Dunlap ; > Stefano Stabellini ; Wei Liu ; xen- > de...@lists.xenproject.org > Subject:

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

2022-06-28 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Saturday, June 25, 2022 1:55 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Stefano Stabellini > ; Bertrand Marquis ; > Volodymyr Babchuk > Subject: Re: [PATCH v5 1/8] xen/arm:

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

2022-06-28 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Wednesday, June 29, 2022 1:56 PM > To: Penny Zheng > Cc: Wei Chen ; Andrew Cooper > ; George Dunlap ; > Stefano Stabellini ; Wei Liu ; xen- > de...@lists.xenproject.org; Julien Grall > Subject:

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

2022-06-29 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Saturday, June 25, 2022 2:22 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Stefano Stabellini > ; Bertrand Marquis ; > Volodymyr Babchuk ; Andrew Cooper > ; George Dunlap ;

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

2022-06-29 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Saturday, June 25, 2022 3:07 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Stefano Stabellini > ; Bertrand Marquis ; > Volodymyr Babchuk > Subject: Re: [PATCH v5 3/8] xen/arm

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

2022-06-29 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Saturday, June 25, 2022 3:18 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Stefano Stabellini > ; Bertrand Marquis ; > Volodymyr Babchuk > Subject: Re: [PATCH v5 5/8] xen/arm:

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

2022-06-29 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Saturday, June 25, 2022 1:55 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Stefano Stabellini > ; Bertrand Marquis ; > Volodymyr Babchuk > Subject: Re: [PATCH v5 1/8] xen/arm:

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

2022-06-29 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Saturday, June 25, 2022 3:26 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Stefano Stabellini > ; Bertrand Marquis ; > Volodymyr Babchuk > Subject: Re: [PATCH v5 1/8] xen/arm:

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

2022-07-04 Thread Penny Zheng
> -Original Message- > From: Julien Grall > Sent: Wednesday, June 29, 2022 6:35 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Stefano Stabellini > ; Bertrand Marquis ; > Volodymyr Babchuk ; Andrew Cooper > ; George Dunlap ; > Jan Beuli

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

2022-07-04 Thread Penny Zheng
Hi Stefano and Julien > -Original Message- > From: Stefano Stabellini > Sent: Saturday, June 25, 2022 5:57 AM > To: Julien Grall > Cc: Penny Zheng ; xen-devel@lists.xenproject.org; > Wei Chen ; Stefano Stabellini > ; Bertrand Marquis ; > Volodymyr Babchuk >

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

2022-07-06 Thread Penny Zheng
Hi Stefano and julien > -Original Message- > From: Stefano Stabellini > Sent: Thursday, July 7, 2022 7:53 AM > To: Penny Zheng > Cc: Stefano Stabellini ; Julien Grall > ; > xen-devel@lists.xenproject.org; Wei Chen ; Bertrand > Marquis ; Volodymyr Babchuk > &

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

2022-07-07 Thread Penny Zheng
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 coding style

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

2022-07-07 Thread Penny Zheng
, and free_staticmem_pages will be called by it in runtime, so let's drop the __init flag. Signed-off-by: Penny Zheng --- v8 changes: - introduce new helper free_domstatic_page - let put_page call free_domstatic_page for static page, when last ref drops - #define PGC_static zero

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

2022-07-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 --- v8 changes: - no change --- v7 changes: - no change -

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

2022-07-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 Acked-by: Jan Beulich --- v8 changes - no change --- v7

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

2022-07-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 v8 5/9] xen: add field "flags" to cover all internal CDF_XXX

2022-07-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 v8 7/9] xen/arm: unpopulate memory when domain is static

2022-07-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 --- v8 changes: - adapt this patch for newly introduced free_domstatic_page - order as a pa

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

2022-07-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 --- v8 changes: - #ifdef-ary around is_domain_using_staticmem

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

2022-07-07 Thread Penny Zheng
. Signed-off-by: Penny Zheng --- v8 changes: - As concurrent free/allocate could modify the resv_page_list, we still need the lock --- v7 changes: - remove the lock, since we add the page to rsv_page_list after it has been totally freed. --- v6 changes: - drop the lock before returning --- v5 changes

[PATCH v8 8/9] xen: introduce prepare_staticmem_pages

2022-07-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 --- v8 changes: - no change --- v7 changes: - no change --- v6 changes: - adapt to PGC_static --- v5 changes: - new commit ---

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

2022-07-11 Thread Penny Zheng
Hi Stefano > -Original Message- > From: Stefano Stabellini > Sent: Saturday, July 9, 2022 12:41 AM > To: Penny Zheng > Cc: Stefano Stabellini ; jul...@xen.org; xen- > de...@lists.xenproject.org; Wei Chen ; Bertrand > Marquis ; Volodymyr Babchuk > > Subject:

RE: [PATCH 2/2] automation: arm64: Create a test job for testing static allocation on qemu

2022-07-11 Thread Penny Zheng
>> +# Run the test > >>> +rm -f qemu-staticmem.serial > >>> +set +e > >>> +echo " virtio scan; dhcp; tftpb 0x4000 boot.scr; source > >>> +0x4000"| \ timeout -k 1 60 ./binaries/qemu-system-aarch64 - > nographic \ > >>> +-M virtualization=true \ > >>> +-M virt \ > >>> +-M virt,gic-version=2 \ > >>> +-cpu cortex-a57 \ > >>> +-smp 2 \ > >>> +-m 8G \ > >>> +-no-reboot \ > >>> +-device virtio-net-pci,netdev=vnet0 -netdev > >>> +user,id=vnet0,tftp=binaries > >>> \ > >>> +-bios /usr/lib/u-boot/qemu_arm64/u-boot.bin \ > >>> +-dtb ./binaries/virt-gicv2.dtb \ > >>> +|& tee qemu-staticmem.serial > >>> + > >>> +set -e > >> > >> A lot of the code above is duplicated from qemu-smoke-arm64.sh. I > >> think it would be better to consolidate in a single script. Looking > >> briefly throught the existing scripts, it looks like it is possible > >> to pass arguments (see qemu-smoke-x86-64.sh). > > > > One idea would be to make the script common and "source" a second > > script or config file with just the ImageBuilder configuration because > > it looks like it is the only thing different. > > > > > >>> + > >>> +(grep -q "Xen dom0less mode detected" qemu-staticmem.serial) || > >>> +exit 1 > >>> + > >>> +for ((i=0; i<${#base[@]}; i++)) > >>> +do > >>> +start="$(printf "0x%016x" ${base[$i]})" > >>> +end="$(printf "0x%016x" $((${base[$i]} + ${size[$i]} - 1)))" > >>> +grep -q "node 0: \[mem ${start}-${end}\]" qemu-staticmem.serial > >>> +if test $? -eq 1 > >>> +then > >>> +exit 1 > >>> +fi > >>> +done > >> > >> Please add a comment on top to explain what this is meant to do. > >> However, I think we should avoid relying on output that we have > >> written ourself. IOW, relying on Xen/Linux to always write the same > >> message is risky because they can change at any time. > > > > Especially if we make the script common, then we could just rely on > > the existing check to see if the guest started correctly (no special > > check for static memory). > > In this case, how the test will verify that the static memory configuration > has > been taken into account and has not just been ignored? > If only statically allocated memory is enabled, guest memory address will still be mapped to GUEST_RAM_BASE(0x4000) > >>> + > >>> +(grep -q "BusyBox" qemu-staticmem.serial) || exit 1 > > > > -- > Xenia --- Cheers, Penny Zheng

RE: [PATCH 2/2] automation: arm64: Create a test job for testing static allocation on qemu

2022-07-11 Thread Penny Zheng
Hi Xenia > -Original Message- > From: Xenia Ragiadakou > Sent: Monday, July 11, 2022 11:29 PM > To: Penny Zheng ; Stefano Stabellini > ; Julien Grall > Cc: xen-devel@lists.xenproject.org; Doug Goldstein > Subject: Re: [PATCH 2/2] automation: arm64: Create a

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

2022-07-12 Thread Penny Zheng
Hi Julien Before submitting the v6 patch series, I would like to double confirm that ... > -Original Message- > From: Julien Grall > Sent: Wednesday, June 29, 2022 6:18 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Stefano Stabellini >

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

2022-07-17 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Saturday, July 16, 2022 2:10 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org > Cc: Wei Chen ; Stefano Stabellini > ; Bertrand Marquis ; > Volodymyr Babchuk > Subject: Re: [PATCH v5 1/8] xen/arm:

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

2022-07-17 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Friday, July 8, 2022 8:48 PM > To: Penny Zheng > Cc: Wei Chen ; Stefano Stabellini > ; Julien Grall ; Bertrand Marquis > ; Volodymyr Babchuk > ; Andrew Cooper > ; George Dunlap ; > Wei Liu ; xen-devel@

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

2022-07-17 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Friday, July 8, 2022 9:06 PM > To: Penny Zheng > Cc: Wei Chen ; Andrew Cooper > ; George Dunlap ; > Julien Grall ; Stefano Stabellini ; > Wei Liu ; xen-devel@lists.xenproject.org > Subject: Re: [PATCH v8

[PATCH v9 0/8] populate/unpopulate memory when domain on static allocation

2022-07-19 Thread Penny Zheng
)" - 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 c

[PATCH v9 1/8] xen/arm: rename PGC_reserved to PGC_static

2022-07-19 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 Acked-by: Jan Beulich Acked-by: Julien Grall --- v8

[PATCH v9 3/8] xen: do not merge reserved pages in free_heap_pages()

2022-07-19 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 v9 2/8] xen: do not free reserved memory into heap

2022-07-19 Thread Penny Zheng
, and free_staticmem_pages will be called by it in runtime, so let's drop the __init flag. Signed-off-by: Penny Zheng --- v9 changes: - move free_domheap_page into else-condition - considering scrubbing static pages, domain dying case and opt_scrub_domheap both donot apply to static pages.

[PATCH v9 4/8] xen: add field "flags" to cover all internal CDF_XXX

2022-07-19 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 v9 5/8] xen/arm: introduce CDF_staticmem

2022-07-19 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 Acked-by: Julien Grall Acked-by: Jan Beulich --- v9 changes

[PATCH v9 6/8] xen/arm: unpopulate memory when domain is static

2022-07-19 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 --- v9 change: - remove macro helper put_static_page, and just expand its c

[PATCH v9 7/8] xen: introduce prepare_staticmem_pages

2022-07-19 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 Acked-by: Julien Grall --- v8 changes: - no change --- v7 changes: - no change --- v6 changes: - adapt to PGC_static ---

[PATCH v9 8/8] xen: retrieve reserved pages on populate_physmap

2022-07-19 Thread Penny Zheng
. Signed-off-by: Penny Zheng --- v9 changes: - Use ASSERT_ALLOC_CONTEXT() in acquire_reserved_page - Add free_staticmem_pages to undo prepare_staticmem_pages when assign_domstatic_pages fails - Remove redundant static in error message --- v8 changes: - As concurrent free/allocate could modify the

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

2022-07-21 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 to own

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

2022-07-21 Thread Penny Zheng
From: Penny Zheng This patch series 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 v6 2/9] xen/arm: allocate static shared memory to the default owner dom_io

2022-07-21 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 v6 4/9] xen/arm: introduce put_page_nr and get_page_nr

2022-07-21 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 Reviewed-by: Stefano Stabellini Reviewed-by: Julien Grall --- v6 change: - no change --- v5 change: - no change --- v4 changes: - fix the assert about checking

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

2022-07-21 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 Reviewed-by

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

2022-07-21 Thread Penny Zheng
introduced later in the following commits. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v6 change: - fix coding-style - role_str and owner_dom_io shall be defined within the loop --- v5 change: - no change --- v4 change: - no changes --- v3 change: - simplify the code since

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

2022-07-21 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 --- v6 change: - no change --- v5 change: - no change --- v4 changes: - no

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

2022-07-21 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 Stabe

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

2022-07-21 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 v6 9/9] xen: Add static memory sharing in SUPPORT.md

2022-07-21 Thread Penny Zheng
on ARM, static memory sharing is tech preview, which shall be documented in SUPPORT.md Signed-off-by: Penny Zheng --- v6 change: - new commit --- SUPPORT.md | 6 ++ 1 file changed, 6 insertions(+) diff --git a/SUPPORT.md b/SUPPORT.md index 8e040d1c1e..3dfe6d2fbe 100644 --- a/SUPPORT.md

RE: [PATCH v9 6/8] xen/arm: unpopulate memory when domain is static

2022-07-25 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Monday, July 25, 2022 11:36 PM > To: Penny Zheng > Cc: Wei Chen ; Andrew Cooper > ; George Dunlap ; > Julien Grall ; Stefano Stabellini ; > Wei Liu ; xen-devel@lists.xenproject.org > Subject: Re: [PATCH

RE: [PATCH v9 2/8] xen: do not free reserved memory into heap

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

RE: [PATCH v2 2/2] automation: arm64: Create a test job for testing static allocation on qemu

2022-07-27 Thread Penny Zheng
the contents of the /proc/device-tree > memory entry with the static memory range with which DOM1 was > configured. > If the memory layout is correct, a message gets printed by DOM1. > > At the end of the qemu run, the script searches for the specific message in > th

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

2021-07-04 Thread Penny Zheng
Hi Julien Sorry for so long to respond, just back from a long holiday. 😉 > -Original Message- > From: Julien Grall > Sent: Thursday, July 1, 2021 1:44 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; jbeul...@suse.com > Cc: Bertrand

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

2021-07-04 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Thursday, July 1, 2021 1:45 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; jbeul...@suse.com > Cc: Bertrand Marquis ; Wei Chen > > Subject: Re: [PATCH

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

2021-07-04 Thread Penny Zheng
Hi Julien and Jan > -Original Message- > From: Julien Grall > Sent: Thursday, July 1, 2021 1:46 AM > To: Jan Beulich ; Penny Zheng > Cc: Bertrand Marquis ; Wei Chen > ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Subject: Re: [PATCH 4/9

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

2021-07-05 Thread Penny Zheng
Hi Jan > -Original Message- > From: Penny Zheng > Sent: Monday, July 5, 2021 1:22 PM > To: Julien Grall ; Jan Beulich > Cc: Bertrand Marquis ; Wei Chen > ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Subject: RE: [PATCH 4/9] xen/arm: static memor

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

2021-07-05 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Thursday, July 1, 2021 2:10 AM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; jbeul...@suse.com > Cc: Bertrand Marquis ; Wei Chen > > Subject: Re: [PATCH 4/9] xen/arm: stat

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

2021-07-05 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Monday, July 5, 2021 3:51 PM > To: Penny Zheng > Cc: Bertrand Marquis ; Wei Chen > ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; Julien Grall > Subject: Re: [PATCH 4/9] xen/arm: static memor

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

2021-07-05 Thread Penny Zheng
Hi > -Original Message- > From: Jan Beulich > Sent: Thursday, June 10, 2021 6:23 PM > To: Penny Zheng > Cc: Bertrand Marquis ; Wei Chen > ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; jul...@xen.org > Subject: Re: [PATCH 6/9] xen/arm: introduce a

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

2021-07-05 Thread Penny Zheng
Hi > -Original Message- > From: Julien Grall > Sent: Saturday, July 3, 2021 9:26 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; jbeul...@suse.com > Cc: Bertrand Marquis ; Wei Chen > > Subject: Re: [PATCH 8/9] xen/arm: check `

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

2021-07-06 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Saturday, July 3, 2021 10:18 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; jbeul...@suse.com > Cc: Bertrand Marquis ; Wei Chen > > Subject: Re: [PATCH

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

2021-07-06 Thread Penny Zheng
Hi jan > -Original Message- > From: Jan Beulich > Sent: Tuesday, July 6, 2021 2:58 PM > To: Penny Zheng ; Julien Grall > Cc: Bertrand Marquis ; Wei Chen > ; sstabell...@kernel.org; xen- > de...@lists.xenproject.org > Subject: Re: [PATCH 8/9] xen/arm: check `

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

2021-07-06 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Tuesday, July 6, 2021 5:10 PM > To: Penny Zheng ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; jbeul...@suse.com > Cc: Bertrand Marquis ; Wei Chen > > Subject: Re: [PATCH 4/9] xen/arm: stat

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

2021-07-08 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Tuesday, July 6, 2021 2:54 PM > To: Penny Zheng > Cc: Bertrand Marquis ; Wei Chen > ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; Julien Grall > Subject: Re: [PATCH 6/9] xen/arm: introduce a

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

2021-07-08 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Thursday, July 8, 2021 6:06 PM > To: Penny Zheng > Cc: Bertrand Marquis ; xen- > de...@lists.xenproject.org; sstabell...@kernel.org; Julien Grall > ; Wei Chen > Subject: Re: [PATCH 6/9] xen/arm: introduce a

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

2021-07-14 Thread Penny Zheng
c-mem` feature, and also documents and parses this new attribute at boot time and stores related info in static_mem for later initialization. Signed-off-by: Penny Zheng --- v3 changes: - use "xen,static-mem" property to be compatible with System Sevice Tree in the future --- docs/misc/

[PATCH V3 00/10] Domain on Static Allocation

2021-07-14 Thread Penny Zheng
domstatic_pages. - remove hunks' #ifdef-ary by introducing PGC_reserved = 0 - remove DMA restriction - "memory" property shall be mandatory - rename allocate_static_bank_memory to append_static_memory_to_bank - infer the next GFN from the bank information in append_static_memory_to_bank

[PATCH V3 02/10] xen/arm: introduce new helper device_tree_get_meminfo

2021-07-14 Thread Penny Zheng
A few functions iterate over the device tree property to get memory info, like "reg" or "xen,static-mem", so this commit creates a new helper device_tree_get_meminfo to extract the common codes. Signed-off-by: Penny Zheng --- xen/arch

[PATCH V3 04/10] xen: introduce mark_page_free

2021-07-14 Thread Penny Zheng
This commit defines a new helper mark_page_free to extract common code, like following the same cache/TLB coherency policy, between free_heap_pages and the new function free_staticmem_pages, which will be introduced later. Signed-off-by: Penny Zheng --- v3 changes: - rename from "free_pag

[PATCH V3 03/10] xen/arm: handle static memory in dt_unreserved_regions

2021-07-14 Thread Penny Zheng
static memory regions overlap with memory nodes. The overlapping memory is reserved-memory and should be handled accordingly: dt_unreserved_regions should skip these regions the same way they are already skipping mem-reserved regions. Signed-off-by: Penny Zheng --- v3 changes: - extract common

[PATCH V3 05/10] xen/arm: static memory initialization

2021-07-14 Thread Penny Zheng
new CONFIG_STATIC_MEMORY to avoid bringing dead codes in other archs. Put asynchronous scrubbing for pages of static memory in TODO list. Signed-off-by: Penny Zheng --- v3 change: - include addition of CONFIG_STATIC_ALLOCATION in this commit, where it is firstly used and also change the name to

[PATCH V3 08/10] xen/arm: introduce acquire_staticmem_pages and acquire_domstatic_pages

2021-07-14 Thread Penny Zheng
nr_mfns contiguous pages of static memory and assign them to one specific domain. It uses acquire_staticmem_pages to acquire nr_mfns pre-configured pages of static memory, then on success, it will use assign_pages to assign those pages to one specific domain. Signed-off-by: Penny Zheng --- v3 change

[PATCH V3 06/10] xen/arm: introduce PGC_reserved

2021-07-14 Thread Penny Zheng
This patch introduces a new page flag PGC_reserved in order to differentiate pages of static memory from those allocated from heap. Mark pages of static memory PGC_reserved when initializing them. Signed-off-by: Penny Zheng --- v3 change: - introduce PGC_reserved when it is firstly used

[PATCH V3 07/10] xen: re-define assign_pages and introduce assign_page

2021-07-14 Thread Penny Zheng
, such that the compiler would point out that adjustments at call sites are needed. Signed-off-by: Penny Zheng --- v3 change: - rename assign_pages_nr to assign_pages - alter the order of assign_pages parameters --- xen/arch/x86/pv/dom0_build.c | 2 +- xen/common/grant_table.c | 2 +- xen

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

2021-07-14 Thread Penny Zheng
shall be firstly mapped to the fixed guest RAM address `GUEST_RAM0_BASE`. And until it exhausts the `GUEST_RAM0_SIZE`, it will seek to `GUEST_RAM1_BASE`, and so on. `GUEST_RAM0` may take up several pre-defined physical RAM regions. Signed-off-by: Penny Zheng --- v3 changes: - parse "xen,s

[PATCH V3 09/10] xen/arm: check "xen,static-mem" property during domain construction

2021-07-14 Thread Penny Zheng
the moment. Signed-off-by: Penny Zheng --- v3 change: - parse "xen,static-mem" in way of phandle back to property - The return for dt_property_read_u32() shall be checked. - "memory" property shall be mandatory --- xen/arch/arm/domain_build.c | 37 +++

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

2021-07-20 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Monday, July 19, 2021 4:20 PM > To: Penny Zheng > Cc: Bertrand Marquis ; Wei Chen > ; nd ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; jul...@xen.org > Subject: Re: [PATCH V3 05/10

RE: [PATCH V3 07/10] xen: re-define assign_pages and introduce assign_page

2021-07-20 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Monday, July 19, 2021 4:41 PM > To: Penny Zheng ; jul...@xen.org > Cc: Bertrand Marquis ; Wei Chen > ; nd ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Subject: Re: [PATCH V3 07/10] xen: re

RE: [PATCH V3 08/10] xen/arm: introduce acquire_staticmem_pages and acquire_domstatic_pages

2021-07-21 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Monday, July 19, 2021 5:26 PM > To: Penny Zheng > Cc: Bertrand Marquis ; Wei Chen > ; nd ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org; jul...@xen.org > Subject: Re: [PATCH V3 0

RE: [PATCH V3 08/10] xen/arm: introduce acquire_staticmem_pages and acquire_domstatic_pages

2021-07-21 Thread Penny Zheng
Hi Julien > -Original Message- > From: Julien Grall > Sent: Monday, July 19, 2021 6:00 PM > To: Jan Beulich ; Penny Zheng > Cc: Bertrand Marquis ; Wei Chen > ; nd ; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Subject: Re: [PATCH V3 0

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

2021-07-26 Thread Penny Zheng
Hi Julien > -Original Message- > From: Penny Zheng > Sent: Thursday, July 15, 2021 1:18 PM > To: xen-devel@lists.xenproject.org; sstabell...@kernel.org; jul...@xen.org > Cc: Bertrand Marquis ; Penny Zheng > ; Wei Chen ; > jbeul...@suse.com; nd > Subject:

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

2021-07-26 Thread Penny Zheng
Hi Julien > -Original Message- > From: Penny Zheng > Sent: Tuesday, July 27, 2021 11:45 AM > To: jul...@xen.org > Cc: Bertrand Marquis ; Wei Chen > ; jbeul...@suse.com; xen-devel@lists.xenproject.org; > sstabell...@kernel.org > Subject: RE: [PATCH V3 1

[PATCH V4 00/10] Domain on Static Allocation

2021-07-28 Thread Penny Zheng
case - make acquire_staticmem_pages/acquire_domstatic_pages being __init TODO: - reboot domain on static allocation - Implement all memory-ops(hypercalls) regarding domain on static allocation to balloon in/out memory - asynchronously scrubbing PGC_reserved pages - consider domain on static allocation on NUM

[PATCH V4 02/10] xen/arm: introduce new helper device_tree_get_meminfo

2021-07-28 Thread Penny Zheng
A few functions iterate over the device tree property to get memory info, like "reg" or "xen,static-mem", so this commit creates a new helper device_tree_get_meminfo to extract the common codes. Signed-off-by: Penny Zheng --- xen/arch

[PATCH V4 03/10] xen/arm: handle static memory in dt_unreserved_regions

2021-07-28 Thread Penny Zheng
static memory regions overlap with memory nodes. The overlapping memory is reserved-memory and should be handled accordingly: dt_unreserved_regions should skip these regions the same way they are already skipping mem-reserved regions. Signed-off-by: Penny Zheng --- xen/arch/arm/setup.c | 47

[PATCH V4 06/10] xen/arm: introduce PGC_reserved

2021-07-28 Thread Penny Zheng
This patch introduces a new page flag PGC_reserved in order to differentiate pages of static memory from those allocated from heap. Mark pages of static memory PGC_reserved when initializing them. Signed-off-by: Penny Zheng --- xen/common/page_alloc.c | 3 +++ xen/include/asm-arm/mm.h | 3

[PATCH V4 04/10] xen: introduce mark_page_free

2021-07-28 Thread Penny Zheng
This commit defines a new helper mark_page_free to extract common code, like following the same cache/TLB coherency policy, between free_heap_pages and the new function free_staticmem_pages, which will be introduced later. Signed-off-by: Penny Zheng Acked-by: Jan Beulich --- xen/common

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