[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 1/2] docs, xen/arm: Introduce reserved heap memory
On Wed, 24 Aug 2022, Henry Wang wrote: > This commit introduces the reserved heap memory, which is parts of RAM > reserved in the beginning of the boot time for heap. > > A new boolean field `xen_heap` in `struct membank` is added to store the > configuration telling if the memory bank is reserved as heap through > `xen,static-mem` property in device tree `chosen` node. > > Also, this commit introduces the logic to parse the reserved heap > configuation in device tree by reusing the device tree entry definition > of the static memory allocation feature: > > - Add a boolean parameter `xen_heap` to `device_tree_get_meminfo` to > reflect whether the memory bank is reserved as heap. > > - Use `device_tree_get_meminfo` to parse the reserved heap configuation > in `chosen` node of the device tree. > > - In order to reuse the function `device_tree_get_meminfo`, the > return type of `process_chosen_node` is changed from void to int. > > A documentation section is added, describing the definition of reserved > heap memory and the method of enabling the reserved heap memory through > device tree at boot time. > > Signed-off-by: Henry Wang <Henry.Wang@xxxxxxx> > Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx> > --- > The name of the device tree property was chosen because we want to > reuse as much as the device tree parsing helpers from the static > memory allocation feature, but we would like to hear the upstream > reviewers' opinion about if using "xen,static-heap" is better. > --- > Changes from RFC to v1: > - Rename the terminology to reserved heap. > --- > docs/misc/arm/device-tree/booting.txt | 46 +++++++++++++++++++++++++ > xen/arch/arm/bootfdt.c | 49 +++++++++++++++++++++------ > xen/arch/arm/domain_build.c | 5 +-- > xen/arch/arm/include/asm/setup.h | 1 + > 4 files changed, 89 insertions(+), 12 deletions(-) > > diff --git a/docs/misc/arm/device-tree/booting.txt > b/docs/misc/arm/device-tree/booting.txt > index 98253414b8..e064f64d9a 100644 > --- a/docs/misc/arm/device-tree/booting.txt > +++ b/docs/misc/arm/device-tree/booting.txt > @@ -378,3 +378,49 @@ device-tree: > > This will reserve a 512MB region starting at the host physical address > 0x30000000 to be exclusively used by DomU1. > + > + > +Reserved Heap Memory > +==================== > + > +The reserved heap memory (also known as the statically-configured heap) > refers > +to parts of RAM reserved in the beginning for heap. The memory is reserved by > +configuration in the device tree using physical address ranges. > + > +The reserved heap memory declared in the device tree defines the memory areas > +that will be reserved to be used exclusively as heap. > + > +- For Arm32, since there can be seperated heaps, the reserved heap will be > used > +for both domheap and xenheap. > +- For Arm64, since domheap and xenheap are the same, the defined reserved > heap > +areas shall always go to the heap allocator. > + > +The reserved heap memory is an optional feature and can be enabled by adding > a > +device tree property in the `chosen` node. Currently, this feature reuses the > +static memory allocation device tree configuration. > + > +The dtb property should look like as follows: > + > +- property name > + > + "xen,static-mem" (Should be used in the `chosen` node) > + > +- cells > + > + Specify the start address and the length of the reserved heap memory. > + The number of cells for the address and the size should be defined > + using the properties `#xen,static-mem-address-cells` and > + `#xen,static-mem-size-cells` respectively. I would choose a different name for the property not to be confused with a domain's xen,static-mem property which is for a different purpose: the memory of the domain. --- - xen,static-heap Property under the top-level "chosen" node. It specifies the address and size of Xen reserved heap memory. - #xen,static-heap-address-cells and #xen,static-heap-size-cells Specify the number of cells used for the address and size of the xen,static-heap property under "chosen". ---
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |