uboot-script-gen: Add DOMU_STATIC_MEM
PATCH v3 1/1 uboot-script-gen: Add DOMU_STATIC_MEM
Add a new config parameter to configure a dom0less VM with static allocation. DOMU_STATIC_MEM[number]="baseaddr1 size1 ... baseaddrN sizeN"
The parameter specifies the host physical address regions to be statically allocated to the VM. Each region is defined by its start address and size.
For instance,
DOMU_STATIC_MEM[0]="0x30000000 0x10000000 0x50000000 0x20000000" indicates that the host memory regions [0x30000000, 0x40000000) and [0x50000000, 0x70000000) are statically allocated to the first dom0less VM.
Since currently it is not possible for a VM to have a mix of both statically and non-statically allocated memory regions, when DOMU_STATIC_MEM is specified, adjust VM's memory size to equal the amount of statically allocated memory.
---
Changes in v2
- in add_device_tree_static_mem(), replace 'i' with 'val' because variable 'i' is already in use as an index
Changes in v3
- fix indentation
- in add_device_tree_static_mem(), declare 'cells' and 'val' variables local to not mess up any global variables by accident
- add a new function add_device_tree_mem() responsible for setting up the memory property in the device tree, as well as for adjusting the memory size accordingly when static mem is specified
README.md | 4 ++++ scripts/uboot-script-gen | 48 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-)
README.md +4 -0
@@ -154,6 +154,10 @@ Where: automatically at boot as dom0-less guest. It can still be created later from Dom0. +- DOMU_STATIC_MEM[number]="baseaddr1 size1 ... baseaddrN sizeN" + if specified, indicates the host physical address regions + [baseaddr, baseaddr + size) to be reserved to the VM for static allocation. + - LINUX is optional but specifies the Linux kernel for when Xen is NOT used. To enable this set any LINUX\_\* variables and do NOT set the XEN variable.
scripts/uboot-script-gen +47 -1
61 lines not on this page · raw message
Signature · 1 line
2.34.1
Quoted 10 lines · Xenia Ragiadakou
Add a new config parameter to configure a dom0less VM with static allocation. DOMU_STATIC_MEM[number]="baseaddr1 size1 ... baseaddrN sizeN"
The parameter specifies the host physical address regions to be statically allocated to the VM. Each region is defined by its start address and size.For instance,
DOMU_STATIC_MEM[0]="0x300000000x100000000x500000000x20000000" indicates that the host memory regions [0x30000000,0x40000000) and [0x50000000,0x70000000) are statically allocated to the first dom0less VM.
Quoted 5 lines
Since currently it is not possible for a VM to have a mix of both statically and non-statically allocated memory regions, when
DOMU_STATIC_MEMis specified, adjust VM's memory size to equal the amount of statically allocated memory.Signed-off-by Xenia Ragiadakou <[email protected]>
Reviewed and committed, thanks!
I added a check for DOMU_MEM != DOMU_STATIC_MEM on commit.
Cheers,
Stefano