|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH V4 01/10] xen/arm: introduce domain on Static Allocation
Hi Penny, On 28/07/2021 11:27, Penny Zheng wrote: Static Allocation refers to system or sub-system(domains) for which memory areas are pre-defined by configuration using physical address ranges. Those pre-defined memory, -- Static Memory, as parts of RAM reserved in the beginning, shall never go to heap allocator or boot allocator for any use. Domains on Static Allocation is supported through device tree property `xen,static-mem` specifying reserved RAM banks as this domain's guest RAM. By default, they shall be mapped to the fixed guest RAM address `GUEST_RAM0_BASE`, `GUEST_RAM1_BASE`. This patch introduces this new `xen,static-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 <penny.zheng@xxxxxxx> --- docs/misc/arm/device-tree/booting.txt | 40 +++++++++++++++++++++ xen/arch/arm/bootfdt.c | 51 +++++++++++++++++++++++++++ xen/include/asm-arm/setup.h | 2 ++ 3 files changed, 93 insertions(+) diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt index 5243bc7fd3..2a1ddca29b 100644 --- a/docs/misc/arm/device-tree/booting.txt +++ b/docs/misc/arm/device-tree/booting.txt @@ -268,3 +268,43 @@ The DTB fragment is loaded at 0xc000000 in the example above. It should follow the convention explained in docs/misc/arm/passthrough.txt. The DTB fragment will be added to the guest device tree, so that the guest kernel will be able to discover the device. + + +Static Allocation +============= + +Static Allocation refers to system or sub-system(domains) for which memory +areas are pre-defined by configuration using physical address ranges. +Those pre-defined memory, -- Static Memory, as parts of RAM reserved in the +beginning, shall never go to heap allocator or boot allocator for any use. I don't understand "as parts of RAM reserved in the beginning". Could you clarify it? + +Domains on Static Allocation is supported through static memory property, +defined under according /domUx in the name of "xen,static-mem", which are We don't require the domU node to be called /domUx. +specifying physical RAM as this domain's guest RAM. How about:Memory can be statically allocated to a domain using the property "xen,static-mem" defined in the domain configuration. +The size of address-cells/size-cells must be defined in I would say "The number of cells for the address and the size must be defined using respectively the properties..." +"#xen,static-mem-address-cells" and "#xen,static-mem-size-cells". + +On memory allocation, these pre-defined static memory ranges shall be +firstly mapped to the fixed guest bank "GUEST_RAM0". Until it exhausts the +`GUEST_RAM0_SIZE`, then it will seek to `GUEST_RAM1_BASE`, and so on. +`GUEST_RAM0` may take up several pre-defined physical RAM regions. GUEST_RAM0 & co are not part of the stable ABI. So I don't think the documentation should mention them. But I am not convinced we should provide a guarantee how the allocation will happen. Why does it matter? + +The dtb property should look like as follows: Do you mean "node" rather than "property"? I would write "This will reserve a 512MB region starting at the host physical address 0x30000000 to be exclusively used by DomU1".
This is pretty much a copy of process_memory_node(). So can we avoid the duplication? I think I mentionned it in the past but I can't find the outcome. This code is just checking the node compatible is "xen,domain". So I would drop the "domUx". This is also... ... not correct. How about checking the compatible instead? + process_static_memory(fdt, node, &bootinfo.static_mem); You want "rc = ..." so the error is propaged if there is an issue (e.g. we don't have space for more static region). if ( rc < 0 ) Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |