Skip to contentSkip to conversation

uboot-script-gen: Add support for specifying domain P2M pool size

PATCH In review Oleksandr Tyshchenko 2 participants 3 messages Jan 20 – Jan 21

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uboot-script-gen: Add support for specifying domain P2M pool size

The DOMU_P2M_MEM_MB configuration option is used to specify the amount of megabytes of RAM used for the domain P2M pool. It allows users to manually define the memory size reserved for P2M structures in non-hardware domains, overriding the default value calculated by Xen.

---
 README.md                | 7 +++++++
 scripts/uboot-script-gen | 5 +++++
 2 files changed, 12 insertions(+)
README.md +7 -0
index 983cbbc..c7ae98e 100644
@@ -203,6 +203,13 @@ Where:
   NOTE that with this option, user needs to manually set xen,passthrough
   in xen.dtb.
 
+- DOMU_P2M_MEM_MB[number] is optional 32-bit integer specifying the amount
+  of megabytes of RAM used for the domain P2M pool. If not set, the default
+  size is calculated by Xen.
+  Note that the P2M pool is used to allocate pages for P2M structures for
+  non-hardware domains. For the hardware domain, P2M pages are allocated
+  directly from the heap.
+
 - DOMU_MEM[number] is the amount of memory for the VM in MB, default 512MB
 
 - DOMU_VCPUS[number] is the number of vcpus for the VM, default 1
scripts/uboot-script-gen +5 -0
index d18ac55..0c86c2d 100755
@@ -514,6 +514,11 @@ function xen_device_tree_editing()
             dt_set "/chosen/domU$i" "passthrough" "str" "enabled"
         fi
 
+        if test -n "${DOMU_P2M_MEM_MB[$i]}"
+        then
+            dt_set "/chosen/domU$i" "xen,domain-p2m-mem-mb" "int" "${DOMU_P2M_MEM_MB[$i]}"
+        fi
+
         if test -n "${DOMU_SHARED_MEM[i]}"
         then
             add_device_tree_static_shared_mem "/chosen/domU${i}" "${DOMU_SHARED_MEM[i]}"
Signature · 1 line
2.34.1
Reviewed-by Ayan Kumar Halder on v1 1/1
#1 lore raw

Hi Oleksandr,

Quoted 7 lines · Oleksandr Tyshchenko

The DOMU_P2M_MEM_MB configuration option is used to specify the amount of megabytes of RAM used for the domain P2M pool. It allows users to manually define the memory size reserved for P2M structures in non-hardware domains, overriding the default value calculated by Xen.

with a question

Quoted 28 lines
---
  README.md                | 7 +++++++
  scripts/uboot-script-gen | 5 +++++
  2 files changed, 12 insertions(+)
README.md +7 -0
index 983cbbc..c7ae98e 100644
@@ -203,6 +203,13 @@ Where:
    NOTE that with this option, user needs to manually set xen,passthrough
    in xen.dtb.
 
+- DOMU_P2M_MEM_MB[number] is optional 32-bit integer specifying the amount
+  of megabytes of RAM used for the domain P2M pool. If not set, the default
+  size is calculated by Xen.
+  Note that the P2M pool is used to allocate pages for P2M structures for
+  non-hardware domains. For the hardware domain, P2M pages are allocated
+  directly from the heap.
+
  - DOMU_MEM[number] is the amount of memory for the VM in MB, default 512MB
 
  - DOMU_VCPUS[number] is the number of vcpus for the VM, default 1
scripts/uboot-script-gen +0 -0
index d18ac55..0c86c2d 100755

scripts/uboot-script-gen function xen_device_tree_editing() · line 519

Quoted 6 lines
scripts/uboot-script-gen +3 -0
@@ -514,6 +514,11 @@ function xen_device_tree_editing()
              dt_set "/chosen/domU$i" "passthrough" "str" "enabled"
          fi
 
+        if test -n "${DOMU_P2M_MEM_MB[$i]}"
+        then
+            dt_set "/chosen/domU$i" "xen,domain-p2m-mem-mb"

Was this property recently introduced in Xen ? If so, it may be good to refer Xen's commit id.

- Ayan

#2 lore raw
Quoted 1 line · Ayan Kumar

Hi Oleksandr,

Hello Ayan

Quoted 11 lines · Oleksandr Tyshchenko
Quoted 7 lines

The DOMU_P2M_MEM_MB configuration option is used to specify the amount of megabytes of RAM used for the domain P2M pool. It allows users to manually define the memory size reserved for P2M structures in non-hardware domains, overriding the default value calculated by Xen.

thanks

Quoted 33 lines

with a question

Quoted 30 lines

---
  README.md                | 7 +++++++
  scripts/uboot-script-gen | 5 +++++

  2 files changed, 12 insertions(+)
README.md +0 -0
index 983cbbc..c7ae98e 100644
@@ -203,6 +203,13 @@ Where:

    NOTE that with this option, user needs to manually set xen,passthrough
    in xen.dtb.
+- DOMU_P2M_MEM_MB[number] is optional 32-bit integer specifying the amount
+  of megabytes of RAM used for the domain P2M pool. If not set, the default
+  size is calculated by Xen.
+  Note that the P2M pool is used to allocate pages for P2M structures for
+  non-hardware domains. For the hardware domain, P2M pages are allocated +  directly from the heap.
+
  - DOMU_MEM[number] is the amount of memory for the VM in MB, default 512MB
  - DOMU_VCPUS[number] is the number of vcpus for the VM, default 1

scripts/uboot-script-gen +0 -0
index d18ac55..0c86c2d 100755
Quoted 8 lines
Quoted 6 lines
scripts/uboot-script-gen +0 -0
@@ -514,6 +514,11 @@ function xen_device_tree_editing()

              dt_set "/chosen/domU$i" "passthrough" "str" "enabled" fi
+        if test -n "${DOMU_P2M_MEM_MB[$i]}"
+        then
+            dt_set "/chosen/domU$i" "xen,domain-p2m-mem-mb"

Was this property recently introduced in Xen ?

No. It was introduced more than 3 years ago by the following commit cbea5a1149ca7fd4b7cdbfa3ec2e4f109b601ff7 “xen/arm: Allocate and free P2M pages from the P2M pool”.

If so, it may be good to

Quoted 4 lines

refer Xen's commit id.

- Ayan