[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 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 3/8] xen: do not merge reserved pages in free_heap_pages()

2022-07-19 Thread Penny Zheng
as a 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 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 0/8] populate/unpopulate memory when domain on static allocation

2022-07-19 Thread Penny Zheng
t; - 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 coding

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

2022-07-18 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

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

2022-07-18 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 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 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 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 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 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:

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

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

[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 4/9] xen: do not merge reserved pages in free_heap_pages()

2022-07-07 Thread Penny Zheng
as a 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 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 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 --- v6

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

[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

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

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

2022-06-29 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 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 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 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-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:

[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

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

[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

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

2022-06-19 Thread Penny Zheng
will be 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 0/8] static shared memory on dom0less system

2022-06-19 Thread Penny Zheng
tails. 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 owner domain

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

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

2022-06-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 v7 4/9] xen: do not merge reserved pages in free_heap_pages()

2022-06-19 Thread Penny Zheng
as a 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 v7 0/9] populate/unpopulate memory when domain on static allocation

2022-06-19 Thread Penny Zheng
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 (9): xen/arm: rename PGC_reserved to PGC_static xen: do not free reserved memory into heap xen: update SUPPORT.md for static allocation xen: d

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

2022-06-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 --- v7 changes: - no change --- v6

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

2022-06-19 Thread Penny Zheng
freeing memory resource, so let's drop the __init flag. Signed-off-by: Penny Zheng Acked-by: Jan Beulich --- v7 changes: - protect free_staticmem_pages with heap_lock to match its reverse function acquire_staticmem_pages --- v6 changes: - adapt to PGC_static - remove #ifdef aroud function

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

2022-06-19 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 --- v7 changes: - no change --- v6 changes: - use domain instead

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

2022-06-17 Thread Penny Zheng
Hi Jan Sorry about the late reply, got sidetracked a few weeks. > -Original Message- > From: Jan Beulich > Sent: Wednesday, May 18, 2022 2:36 PM > To: Penny Zheng > Cc: Wei Chen ; Stefano Stabellini > ; Julien Grall ; Bertrand Marquis > ; Volodymyr Babchuk > ;

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

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

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

2022-06-08 Thread Penny Zheng
Hi Jan > -Original Message- > From: Jan Beulich > Sent: Tuesday, June 7, 2022 3:58 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 v6 2/9] xen: do not free reserved memory into heap

2022-06-08 Thread Penny Zheng
> -Original Message- > From: Julien Grall > Sent: Tuesday, June 7, 2022 5:13 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 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 ;

[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

[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 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 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 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 4/9] xen: do not merge reserved pages in free_heap_pages()

2022-06-07 Thread Penny Zheng
as a 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 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 changes

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

[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

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 ;

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

[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

[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 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 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 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 0/9] populate/unpopulate memory when domain on static allocation

2022-05-30 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

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

2022-05-30 Thread Penny Zheng
as a 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 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 --git

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

[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

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

2022-05-18 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

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

[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

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

2022-05-17 Thread Penny Zheng
will be 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 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 0/8] static shared memory on dom0less system

2022-05-17 Thread Penny Zheng
tails. 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 owner domain

[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

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

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

2022-05-17 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 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:

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

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

[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

<    1   2   3   4   5   6   7   8   >