Xen-Devel Archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] automation: introduce static heap and shared memory tests
@ 2023-03-02  4:44 jiamei.xie
  2023-03-02  4:44 ` [PATCH 1/2] automation: arm64: Create a test job for testing static heap on qemu jiamei.xie
  2023-03-02  4:44 ` [PATCH 2/2] automation: arm64: Create a test job for testing static shared memory " jiamei.xie
  0 siblings, 2 replies; 9+ messages in thread
From: jiamei.xie @ 2023-03-02  4:44 UTC (permalink / raw
  To: xen-devel
  Cc: wei.chen, jiamei.xie, sstabellini, bertrand.marquis,
	Doug Goldstein

Hi all,

This patch series introduces two test jobs:

Jiamei Xie (1):
  automation: arm64: Create a test job for testing static heap on qemu

jiamei.xie (1):
  automation: arm64: Create a test job for testing static shared memory
    on qemu

 automation/gitlab-ci/build.yaml               | 18 +++++++
 automation/gitlab-ci/test.yaml                | 32 +++++++++++++
 .../scripts/qemu-smoke-dom0less-arm64.sh      | 47 +++++++++++++++++++
 3 files changed, 97 insertions(+)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] automation: arm64: Create a test job for testing static heap on qemu
  2023-03-02  4:44 [PATCH 0/2] automation: introduce static heap and shared memory tests jiamei.xie
@ 2023-03-02  4:44 ` jiamei.xie
  2023-03-03  1:50   ` Stefano Stabellini
  2023-03-02  4:44 ` [PATCH 2/2] automation: arm64: Create a test job for testing static shared memory " jiamei.xie
  1 sibling, 1 reply; 9+ messages in thread
From: jiamei.xie @ 2023-03-02  4:44 UTC (permalink / raw
  To: xen-devel
  Cc: wei.chen, jiamei.xie, sstabellini, bertrand.marquis,
	Doug Goldstein

From: Jiamei Xie <jiamei.xie@arm.com>

Create a new test job, called qemu-smoke-dom0less-arm64-gcc-staticheap.

Add property "xen,static-heap" under /chosen node to enable static-heap.
If the domU can start successfully with static-heap enabled, then this
test pass.

Signed-off-by: Jiamei Xie <jiamei.xie@arm.com>
---
 automation/gitlab-ci/test.yaml                 | 16 ++++++++++++++++
 .../scripts/qemu-smoke-dom0less-arm64.sh       | 18 ++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 1c5f400b68..5a9b88477a 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -133,6 +133,22 @@ qemu-smoke-dom0less-arm64-gcc-debug-staticmem:
     - *arm64-test-needs
     - alpine-3.12-gcc-debug-arm64-staticmem
 
+qemu-smoke-dom0less-arm64-gcc-staticheap:
+ extends: .qemu-arm64
+ script:
+   - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-heap 2>&1 | tee ${LOGFILE}
+ needs:
+   - *arm64-test-needs
+   - alpine-3.12-gcc-arm64
+
+qemu-smoke-dom0less-arm64-gcc-debug-staticheap:
+ extends: .qemu-arm64
+ script:
+   - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-heap 2>&1 | tee ${LOGFILE}
+ needs:
+   - *arm64-test-needs
+   - alpine-3.12-gcc-debug-arm64
+
 qemu-smoke-dom0less-arm64-gcc-boot-cpupools:
   extends: .qemu-arm64
   script:
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 182a4b6c18..4e73857199 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -27,6 +27,11 @@ fi
 "
 fi
 
+if [[ "${test_variant}" == "static-heap" ]]; then
+    passed="${test_variant} test passed"
+    domU_check="echo \"${passed}\""
+fi
+
 if [[ "${test_variant}" == "boot-cpupools" ]]; then
     # Check if domU0 (id=1) is assigned to Pool-1 with null scheduler
     passed="${test_variant} test passed"
@@ -128,6 +133,19 @@ if [[ "${test_variant}" == "static-mem" ]]; then
     echo -e "\nDOMU_STATIC_MEM[0]=\"${domu_base} ${domu_size}\"" >> binaries/config
 fi
 
+if [[ "${test_variant}" == "static-heap" ]]; then
+    # ImageBuilder uses the config file to create the uboot script. Devicetree
+    # will be set via the generated uboot script.
+    # The valid memory range is 0x40000000 to 0x80000000 as defined before.
+    # ImageBuillder sets the kernel and ramdisk range based on the file size.
+    # It will use the memory range between 0x45600000 to 0x47AED1E8, so set
+    # memory range between 0x50000000 and 0x80000000 as static heap.
+    echo  '
+STATIC_HEAP="0x50000000 0x30000000"
+# The size of static heap should be greater than the guest memory
+DOMU_MEM[0]="128"' >> binaries/config
+fi
+
 if [[ "${test_variant}" == "boot-cpupools" ]]; then
     echo '
 CPUPOOL[0]="cpu@1 null"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] automation: arm64: Create a test job for testing static shared memory on qemu
  2023-03-02  4:44 [PATCH 0/2] automation: introduce static heap and shared memory tests jiamei.xie
  2023-03-02  4:44 ` [PATCH 1/2] automation: arm64: Create a test job for testing static heap on qemu jiamei.xie
@ 2023-03-02  4:44 ` jiamei.xie
  2023-03-03  1:56   ` Stefano Stabellini
  1 sibling, 1 reply; 9+ messages in thread
From: jiamei.xie @ 2023-03-02  4:44 UTC (permalink / raw
  To: xen-devel
  Cc: wei.chen, jiamei.xie, sstabellini, bertrand.marquis,
	Doug Goldstein

Create a new test job, called qemu-smoke-dom0less-arm64-gcc-static-shared-mem.

Adjust qemu-smoke-dom0less-arm64.sh script to accomodate the static
shared memory test as a new test variant. The test variant is determined
based on the first argument passed to the script. For testing static
shared memory, the argument is 'static-shared-mem'.

The test configures two dom0less DOMUs with a static shared memory
region and adds a check in the init script.

The check consists in comparing the contents of the /proc/device-tree/reserved-memory
xen-shmem entry with the static shared memory range and id with which
DOMUs were configured. If the memory layout is correct, a message gets
printed by DOMU.

At the end of the qemu run, the script searches for the specific message
in the logs and fails if not found.

Signed-off-by: jiamei.xie <jiamei.xie@arm.com>
---
 automation/gitlab-ci/build.yaml               | 18 ++++++++++++
 automation/gitlab-ci/test.yaml                | 16 ++++++++++
 .../scripts/qemu-smoke-dom0less-arm64.sh      | 29 +++++++++++++++++++
 3 files changed, 63 insertions(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 38bb22d860..820cc0af83 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -623,6 +623,24 @@ alpine-3.12-gcc-debug-arm64-staticmem:
       CONFIG_UNSUPPORTED=y
       CONFIG_STATIC_MEMORY=y
 
+alpine-3.12-gcc-arm64-static-shared-mem:
+  extends: .gcc-arm64-build
+  variables:
+    CONTAINER: alpine:3.12-arm64v8
+    EXTRA_XEN_CONFIG: |
+      CONFIG_UNSUPPORTED=y
+      CONFIG_STATIC_MEMORY=y
+      CONFIG_STATIC_SHM=y
+
+alpine-3.12-gcc-debug-arm64-static-shared-mem:
+  extends: .gcc-arm64-build-debug
+  variables:
+    CONTAINER: alpine:3.12-arm64v8
+    EXTRA_XEN_CONFIG: |
+      CONFIG_UNSUPPORTED=y
+      CONFIG_STATIC_MEMORY=y
+      CONFIG_STATIC_SHM=y
+
 alpine-3.12-gcc-arm64-boot-cpupools:
   extends: .gcc-arm64-build
   variables:
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 5a9b88477a..f4d36babda 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -149,6 +149,22 @@ qemu-smoke-dom0less-arm64-gcc-debug-staticheap:
    - *arm64-test-needs
    - alpine-3.12-gcc-debug-arm64
 
+qemu-smoke-dom0less-arm64-gcc-static-shared-mem:
+  extends: .qemu-arm64
+  script:
+    - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-shared-mem 2>&1 | tee ${LOGFILE}
+  needs:
+    - *arm64-test-needs
+    - alpine-3.12-gcc-arm64-static-shared-mem
+
+qemu-smoke-dom0less-arm64-gcc-debug-static-shared-mem:
+  extends: .qemu-arm64
+  script:
+    - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-shared-mem 2>&1 | tee ${LOGFILE}
+  needs:
+    - *arm64-test-needs
+    - alpine-3.12-gcc-debug-arm64-static-shared-mem
+
 qemu-smoke-dom0less-arm64-gcc-boot-cpupools:
   extends: .qemu-arm64
   script:
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 4e73857199..fe3a282726 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -32,6 +32,25 @@ if [[ "${test_variant}" == "static-heap" ]]; then
     domU_check="echo \"${passed}\""
 fi
 
+
+if [[ "${test_variant}" == "static-shared-mem" ]]; then
+    passed="${test_variant} test passed"
+    SHARED_MEM_HOST="50000000"
+    SHARED_MEM_GUEST="4000000"
+    SHARED_MEM_SIZE="10000000"
+    SHARED_MEM_ID="my-shared-mem-0"
+
+    domU_check="
+current_id=\$(cat /proc/device-tree/reserved-memory/xen-shmem@4000000/xen,id 2>/dev/null)
+expected_id=\"\$(echo ${SHARED_MEM_ID})\"
+current_reg=\$(hexdump -e '16/1 \"%02x\"' /proc/device-tree/reserved-memory/xen-shmem@4000000/reg 2>/dev/null)
+expected_reg=$(printf \"%016x%016x\" 0x${SHARED_MEM_GUEST} 0x${SHARED_MEM_SIZE})
+if [[ \"\${expected_reg}\" == \"\${current_reg}\" && \"\${current_id}\" == \"\${expected_id}\" ]]; then
+    echo \"${passed}\"
+fi
+    "
+fi
+
 if [[ "${test_variant}" == "boot-cpupools" ]]; then
     # Check if domU0 (id=1) is assigned to Pool-1 with null scheduler
     passed="${test_variant} test passed"
@@ -133,6 +152,16 @@ if [[ "${test_variant}" == "static-mem" ]]; then
     echo -e "\nDOMU_STATIC_MEM[0]=\"${domu_base} ${domu_size}\"" >> binaries/config
 fi
 
+if [[ "${test_variant}" == "static-shared-mem" ]]; then
+echo "NUM_DOMUS=2
+DOMU_SHARED_MEM[0]=\""0x${SHARED_MEM_HOST} 0x${SHARED_MEM_GUEST} 0x${SHARED_MEM_SIZE}"\"
+DOMU_SHARED_MEM_ID[0]="${SHARED_MEM_ID}"
+DOMU_KERNEL[1]=\"Image\"
+DOMU_RAMDISK[1]=\"initrd\"
+DOMU_SHARED_MEM[1]=\"0x${SHARED_MEM_HOST} 0x${SHARED_MEM_GUEST} 0x${SHARED_MEM_SIZE}\"
+DOMU_SHARED_MEM_ID[1]=\"${SHARED_MEM_ID}\"" >> binaries/config
+fi
+
 if [[ "${test_variant}" == "static-heap" ]]; then
     # ImageBuilder uses the config file to create the uboot script. Devicetree
     # will be set via the generated uboot script.
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] automation: arm64: Create a test job for testing static heap on qemu
  2023-03-02  4:44 ` [PATCH 1/2] automation: arm64: Create a test job for testing static heap on qemu jiamei.xie
@ 2023-03-03  1:50   ` Stefano Stabellini
  2023-03-03  6:49     ` Jiamei Xie
  0 siblings, 1 reply; 9+ messages in thread
From: Stefano Stabellini @ 2023-03-03  1:50 UTC (permalink / raw
  To: jiamei.xie
  Cc: xen-devel, wei.chen, sstabellini, bertrand.marquis,
	Doug Goldstein

On Thu, 2 Mar 2023, jiamei.xie wrote:
> From: Jiamei Xie <jiamei.xie@arm.com>
> 
> Create a new test job, called qemu-smoke-dom0less-arm64-gcc-staticheap.
> 
> Add property "xen,static-heap" under /chosen node to enable static-heap.
> If the domU can start successfully with static-heap enabled, then this
> test pass.
> 
> Signed-off-by: Jiamei Xie <jiamei.xie@arm.com>

Hi Jiamei, thanks for the patch!


> ---
>  automation/gitlab-ci/test.yaml                 | 16 ++++++++++++++++
>  .../scripts/qemu-smoke-dom0less-arm64.sh       | 18 ++++++++++++++++++
>  2 files changed, 34 insertions(+)
> 
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index 1c5f400b68..5a9b88477a 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -133,6 +133,22 @@ qemu-smoke-dom0less-arm64-gcc-debug-staticmem:
>      - *arm64-test-needs
>      - alpine-3.12-gcc-debug-arm64-staticmem
>  
> +qemu-smoke-dom0less-arm64-gcc-staticheap:
> + extends: .qemu-arm64
> + script:
> +   - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-heap 2>&1 | tee ${LOGFILE}
> + needs:
> +   - *arm64-test-needs
> +   - alpine-3.12-gcc-arm64
> +
> +qemu-smoke-dom0less-arm64-gcc-debug-staticheap:
> + extends: .qemu-arm64
> + script:
> +   - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-heap 2>&1 | tee ${LOGFILE}
> + needs:
> +   - *arm64-test-needs
> +   - alpine-3.12-gcc-debug-arm64
> +
>  qemu-smoke-dom0less-arm64-gcc-boot-cpupools:
>    extends: .qemu-arm64
>    script:
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> index 182a4b6c18..4e73857199 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> @@ -27,6 +27,11 @@ fi
>  "
>  fi
>  
> +if [[ "${test_variant}" == "static-heap" ]]; then
> +    passed="${test_variant} test passed"
> +    domU_check="echo \"${passed}\""
> +fi
> +
>  if [[ "${test_variant}" == "boot-cpupools" ]]; then
>      # Check if domU0 (id=1) is assigned to Pool-1 with null scheduler
>      passed="${test_variant} test passed"
> @@ -128,6 +133,19 @@ if [[ "${test_variant}" == "static-mem" ]]; then
>      echo -e "\nDOMU_STATIC_MEM[0]=\"${domu_base} ${domu_size}\"" >> binaries/config
>  fi
>  
> +if [[ "${test_variant}" == "static-heap" ]]; then
> +    # ImageBuilder uses the config file to create the uboot script. Devicetree
> +    # will be set via the generated uboot script.
> +    # The valid memory range is 0x40000000 to 0x80000000 as defined before.
> +    # ImageBuillder sets the kernel and ramdisk range based on the file size.
> +    # It will use the memory range between 0x45600000 to 0x47AED1E8, so set
> +    # memory range between 0x50000000 and 0x80000000 as static heap.

I think this is OK. One suggestion to make things more reliable would be
to change MEMORY_END to be 0x50000000 so that you can be sure that
ImageBuilder won't go over the limit. You could do it just for this
test, which would be safer, but to be honest you could limit MEMORY_END
to 0x50000000 for all tests in qemu-smoke-dom0less-arm64.sh because it
shouldn't really cause any problems.


> +    echo  '
> +STATIC_HEAP="0x50000000 0x30000000"
> +# The size of static heap should be greater than the guest memory
> +DOMU_MEM[0]="128"' >> binaries/config
> +fi
> +
>  if [[ "${test_variant}" == "boot-cpupools" ]]; then
>      echo '
>  CPUPOOL[0]="cpu@1 null"
> -- 
> 2.25.1
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] automation: arm64: Create a test job for testing static shared memory on qemu
  2023-03-02  4:44 ` [PATCH 2/2] automation: arm64: Create a test job for testing static shared memory " jiamei.xie
@ 2023-03-03  1:56   ` Stefano Stabellini
  0 siblings, 0 replies; 9+ messages in thread
From: Stefano Stabellini @ 2023-03-03  1:56 UTC (permalink / raw
  To: jiamei.xie
  Cc: xen-devel, wei.chen, sstabellini, bertrand.marquis,
	Doug Goldstein

On Thu, 2 Mar 2023, jiamei.xie wrote:
> Create a new test job, called qemu-smoke-dom0less-arm64-gcc-static-shared-mem.
> 
> Adjust qemu-smoke-dom0less-arm64.sh script to accomodate the static
> shared memory test as a new test variant. The test variant is determined
> based on the first argument passed to the script. For testing static
> shared memory, the argument is 'static-shared-mem'.
> 
> The test configures two dom0less DOMUs with a static shared memory
> region and adds a check in the init script.
> 
> The check consists in comparing the contents of the /proc/device-tree/reserved-memory
> xen-shmem entry with the static shared memory range and id with which
> DOMUs were configured. If the memory layout is correct, a message gets
> printed by DOMU.
> 
> At the end of the qemu run, the script searches for the specific message
> in the logs and fails if not found.
> 
> Signed-off-by: jiamei.xie <jiamei.xie@arm.com>
> ---
>  automation/gitlab-ci/build.yaml               | 18 ++++++++++++
>  automation/gitlab-ci/test.yaml                | 16 ++++++++++
>  .../scripts/qemu-smoke-dom0less-arm64.sh      | 29 +++++++++++++++++++
>  3 files changed, 63 insertions(+)
> 
> diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> index 38bb22d860..820cc0af83 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -623,6 +623,24 @@ alpine-3.12-gcc-debug-arm64-staticmem:
>        CONFIG_UNSUPPORTED=y
>        CONFIG_STATIC_MEMORY=y
>  
> +alpine-3.12-gcc-arm64-static-shared-mem:
> +  extends: .gcc-arm64-build
> +  variables:
> +    CONTAINER: alpine:3.12-arm64v8
> +    EXTRA_XEN_CONFIG: |
> +      CONFIG_UNSUPPORTED=y
> +      CONFIG_STATIC_MEMORY=y
> +      CONFIG_STATIC_SHM=y
> +
> +alpine-3.12-gcc-debug-arm64-static-shared-mem:
> +  extends: .gcc-arm64-build-debug
> +  variables:
> +    CONTAINER: alpine:3.12-arm64v8
> +    EXTRA_XEN_CONFIG: |
> +      CONFIG_UNSUPPORTED=y
> +      CONFIG_STATIC_MEMORY=y
> +      CONFIG_STATIC_SHM=y
> +
>  alpine-3.12-gcc-arm64-boot-cpupools:
>    extends: .gcc-arm64-build
>    variables:
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index 5a9b88477a..f4d36babda 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -149,6 +149,22 @@ qemu-smoke-dom0less-arm64-gcc-debug-staticheap:
>     - *arm64-test-needs
>     - alpine-3.12-gcc-debug-arm64
>  
> +qemu-smoke-dom0less-arm64-gcc-static-shared-mem:
> +  extends: .qemu-arm64
> +  script:
> +    - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-shared-mem 2>&1 | tee ${LOGFILE}
> +  needs:
> +    - *arm64-test-needs
> +    - alpine-3.12-gcc-arm64-static-shared-mem
> +
> +qemu-smoke-dom0less-arm64-gcc-debug-static-shared-mem:
> +  extends: .qemu-arm64
> +  script:
> +    - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-shared-mem 2>&1 | tee ${LOGFILE}
> +  needs:
> +    - *arm64-test-needs
> +    - alpine-3.12-gcc-debug-arm64-static-shared-mem
> +
>  qemu-smoke-dom0less-arm64-gcc-boot-cpupools:
>    extends: .qemu-arm64
>    script:
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> index 4e73857199..fe3a282726 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> @@ -32,6 +32,25 @@ if [[ "${test_variant}" == "static-heap" ]]; then
>      domU_check="echo \"${passed}\""
>  fi
>  
> +
> +if [[ "${test_variant}" == "static-shared-mem" ]]; then
> +    passed="${test_variant} test passed"
> +    SHARED_MEM_HOST="50000000"
> +    SHARED_MEM_GUEST="4000000"
> +    SHARED_MEM_SIZE="10000000"
> +    SHARED_MEM_ID="my-shared-mem-0"
> +
> +    domU_check="
> +current_id=\$(cat /proc/device-tree/reserved-memory/xen-shmem@4000000/xen,id 2>/dev/null)
> +expected_id=\"\$(echo ${SHARED_MEM_ID})\"
> +current_reg=\$(hexdump -e '16/1 \"%02x\"' /proc/device-tree/reserved-memory/xen-shmem@4000000/reg 2>/dev/null)
> +expected_reg=$(printf \"%016x%016x\" 0x${SHARED_MEM_GUEST} 0x${SHARED_MEM_SIZE})
> +if [[ \"\${expected_reg}\" == \"\${current_reg}\" && \"\${current_id}\" == \"\${expected_id}\" ]]; then
> +    echo \"${passed}\"
> +fi
> +    "
> +fi

all good so far


>  if [[ "${test_variant}" == "boot-cpupools" ]]; then
>      # Check if domU0 (id=1) is assigned to Pool-1 with null scheduler
>      passed="${test_variant} test passed"
> @@ -133,6 +152,16 @@ if [[ "${test_variant}" == "static-mem" ]]; then
>      echo -e "\nDOMU_STATIC_MEM[0]=\"${domu_base} ${domu_size}\"" >> binaries/config
>  fi
>  
> +if [[ "${test_variant}" == "static-shared-mem" ]]; then
> +echo "NUM_DOMUS=2
> +DOMU_SHARED_MEM[0]=\""0x${SHARED_MEM_HOST} 0x${SHARED_MEM_GUEST} 0x${SHARED_MEM_SIZE}"\"
> +DOMU_SHARED_MEM_ID[0]="${SHARED_MEM_ID}"
> +DOMU_KERNEL[1]=\"Image\"
> +DOMU_RAMDISK[1]=\"initrd\"

Please move the second domU creation above to the general ImageBuilder
script. It is fine to start 2 dom0less guests for all tests (assuming it
doesn't break anything).

So here under the if [[ "${test_variant}" == "static-shared-mem" ]] we
can keep the setting of DOMU_SHARED_MEM and DOMU_SHARED_MEM_ID. (Or only
DOMU_SHARED_MEM if you follow the suggestion on the other patch.)



> +DOMU_SHARED_MEM[1]=\"0x${SHARED_MEM_HOST} 0x${SHARED_MEM_GUEST} 0x${SHARED_MEM_SIZE}\"
> +DOMU_SHARED_MEM_ID[1]=\"${SHARED_MEM_ID}\"" >> binaries/config
> +fi
> +
>  if [[ "${test_variant}" == "static-heap" ]]; then
>      # ImageBuilder uses the config file to create the uboot script. Devicetree
>      # will be set via the generated uboot script.
> -- 
> 2.25.1
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 1/2] automation: arm64: Create a test job for testing static heap on qemu
  2023-03-03  1:50   ` Stefano Stabellini
@ 2023-03-03  6:49     ` Jiamei Xie
  2023-03-03  7:47       ` Michal Orzel
  0 siblings, 1 reply; 9+ messages in thread
From: Jiamei Xie @ 2023-03-03  6:49 UTC (permalink / raw
  To: Stefano Stabellini
  Cc: xen-devel@lists.xenproject.org, Wei Chen, Bertrand Marquis,
	Doug Goldstein

Hi Stefano,

> -----Original Message-----
> From: Stefano Stabellini <sstabellini@kernel.org>
> Sent: Friday, March 3, 2023 9:51 AM
> To: Jiamei Xie <Jiamei.Xie@arm.com>
> Cc: xen-devel@lists.xenproject.org; Wei Chen <Wei.Chen@arm.com>;
> sstabellini@kernel.org; Bertrand Marquis <Bertrand.Marquis@arm.com>;
> Doug Goldstein <cardoe@cardoe.com>
> Subject: Re: [PATCH 1/2] automation: arm64: Create a test job for testing
> static heap on qemu
> 
> On Thu, 2 Mar 2023, jiamei.xie wrote:
> > From: Jiamei Xie <jiamei.xie@arm.com>
> >
> > Create a new test job, called qemu-smoke-dom0less-arm64-gcc-staticheap.
> >
> > Add property "xen,static-heap" under /chosen node to enable static-heap.
> > If the domU can start successfully with static-heap enabled, then this
> > test pass.
> >
> > Signed-off-by: Jiamei Xie <jiamei.xie@arm.com>
> 
> Hi Jiamei, thanks for the patch!
> 
> 
> > ---
> >  automation/gitlab-ci/test.yaml                 | 16 ++++++++++++++++
> >  .../scripts/qemu-smoke-dom0less-arm64.sh       | 18
> ++++++++++++++++++
> >  2 files changed, 34 insertions(+)
> >
> > diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> > index 1c5f400b68..5a9b88477a 100644
> > --- a/automation/gitlab-ci/test.yaml
> > +++ b/automation/gitlab-ci/test.yaml
> > @@ -133,6 +133,22 @@ qemu-smoke-dom0less-arm64-gcc-debug-
> staticmem:
> >      - *arm64-test-needs
> >      - alpine-3.12-gcc-debug-arm64-staticmem
> >
> > +qemu-smoke-dom0less-arm64-gcc-staticheap:
> > + extends: .qemu-arm64
> > + script:
> > +   - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-heap
> 2>&1 | tee ${LOGFILE}
> > + needs:
> > +   - *arm64-test-needs
> > +   - alpine-3.12-gcc-arm64
> > +
> > +qemu-smoke-dom0less-arm64-gcc-debug-staticheap:
> > + extends: .qemu-arm64
> > + script:
> > +   - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-heap
> 2>&1 | tee ${LOGFILE}
> > + needs:
> > +   - *arm64-test-needs
> > +   - alpine-3.12-gcc-debug-arm64
> > +
> >  qemu-smoke-dom0less-arm64-gcc-boot-cpupools:
> >    extends: .qemu-arm64
> >    script:
> > diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh
> b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> > index 182a4b6c18..4e73857199 100755
> > --- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
> > +++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> > @@ -27,6 +27,11 @@ fi
> >  "
> >  fi
> >
> > +if [[ "${test_variant}" == "static-heap" ]]; then
> > +    passed="${test_variant} test passed"
> > +    domU_check="echo \"${passed}\""
> > +fi
> > +
> >  if [[ "${test_variant}" == "boot-cpupools" ]]; then
> >      # Check if domU0 (id=1) is assigned to Pool-1 with null scheduler
> >      passed="${test_variant} test passed"
> > @@ -128,6 +133,19 @@ if [[ "${test_variant}" == "static-mem" ]]; then
> >      echo -e "\nDOMU_STATIC_MEM[0]=\"${domu_base} ${domu_size}\"" >>
> binaries/config
> >  fi
> >
> > +if [[ "${test_variant}" == "static-heap" ]]; then
> > +    # ImageBuilder uses the config file to create the uboot script. Devicetree
> > +    # will be set via the generated uboot script.
> > +    # The valid memory range is 0x40000000 to 0x80000000 as defined
> before.
> > +    # ImageBuillder sets the kernel and ramdisk range based on the file size.
> > +    # It will use the memory range between 0x45600000 to 0x47AED1E8, so
> set
> > +    # memory range between 0x50000000 and 0x80000000 as static heap.
> 
> I think this is OK. One suggestion to make things more reliable would be
> to change MEMORY_END to be 0x50000000 so that you can be sure that
> ImageBuilder won't go over the limit. You could do it just for this
> test, which would be safer, but to be honest you could limit MEMORY_END
> to 0x50000000 for all tests in qemu-smoke-dom0less-arm64.sh because it
> shouldn't really cause any problems.
> 
[Jiamei Xie] 
Thanks for your comments. I am a little confused about " to change MEMORY_END to be 0x50000000". 
 I set 0STATIC_HEAP="0x50000000 0x30000000" where is the start address. Why change MEMORY_END
 to be 0x50000000?


Best wishes
Jiamei Xie


> 
> > +    echo  '
> > +STATIC_HEAP="0x50000000 0x30000000"
> > +# The size of static heap should be greater than the guest memory
> > +DOMU_MEM[0]="128"' >> binaries/config
> > +fi
> > +
> >  if [[ "${test_variant}" == "boot-cpupools" ]]; then
> >      echo '
> >  CPUPOOL[0]="cpu@1 null"
> > --
> > 2.25.1
> >


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] automation: arm64: Create a test job for testing static heap on qemu
  2023-03-03  6:49     ` Jiamei Xie
@ 2023-03-03  7:47       ` Michal Orzel
  2023-03-03  9:13         ` Jiamei Xie
  0 siblings, 1 reply; 9+ messages in thread
From: Michal Orzel @ 2023-03-03  7:47 UTC (permalink / raw
  To: Jiamei Xie, Stefano Stabellini
  Cc: xen-devel@lists.xenproject.org, Wei Chen, Bertrand Marquis,
	Doug Goldstein

Hi Jiamei,

On 03/03/2023 07:49, Jiamei Xie wrote:
> 
> 
> Hi Stefano,
> 
>> -----Original Message-----
>> From: Stefano Stabellini <sstabellini@kernel.org>
>> Sent: Friday, March 3, 2023 9:51 AM
>> To: Jiamei Xie <Jiamei.Xie@arm.com>
>> Cc: xen-devel@lists.xenproject.org; Wei Chen <Wei.Chen@arm.com>;
>> sstabellini@kernel.org; Bertrand Marquis <Bertrand.Marquis@arm.com>;
>> Doug Goldstein <cardoe@cardoe.com>
>> Subject: Re: [PATCH 1/2] automation: arm64: Create a test job for testing
>> static heap on qemu
>>
>> On Thu, 2 Mar 2023, jiamei.xie wrote:
>>> From: Jiamei Xie <jiamei.xie@arm.com>
>>>
>>> Create a new test job, called qemu-smoke-dom0less-arm64-gcc-staticheap.
>>>
>>> Add property "xen,static-heap" under /chosen node to enable static-heap.
>>> If the domU can start successfully with static-heap enabled, then this
>>> test pass.
>>>
>>> Signed-off-by: Jiamei Xie <jiamei.xie@arm.com>
>>
>> Hi Jiamei, thanks for the patch!
>>
>>
>>> ---
>>>  automation/gitlab-ci/test.yaml                 | 16 ++++++++++++++++
>>>  .../scripts/qemu-smoke-dom0less-arm64.sh       | 18
>> ++++++++++++++++++
>>>  2 files changed, 34 insertions(+)
>>>
>>> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
>>> index 1c5f400b68..5a9b88477a 100644
>>> --- a/automation/gitlab-ci/test.yaml
>>> +++ b/automation/gitlab-ci/test.yaml
>>> @@ -133,6 +133,22 @@ qemu-smoke-dom0less-arm64-gcc-debug-
>> staticmem:
>>>      - *arm64-test-needs
>>>      - alpine-3.12-gcc-debug-arm64-staticmem
>>>
>>> +qemu-smoke-dom0less-arm64-gcc-staticheap:
>>> + extends: .qemu-arm64
>>> + script:
>>> +   - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-heap
>> 2>&1 | tee ${LOGFILE}
>>> + needs:
>>> +   - *arm64-test-needs
>>> +   - alpine-3.12-gcc-arm64
>>> +
>>> +qemu-smoke-dom0less-arm64-gcc-debug-staticheap:
>>> + extends: .qemu-arm64
>>> + script:
>>> +   - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-heap
>> 2>&1 | tee ${LOGFILE}
>>> + needs:
>>> +   - *arm64-test-needs
>>> +   - alpine-3.12-gcc-debug-arm64
>>> +
>>>  qemu-smoke-dom0less-arm64-gcc-boot-cpupools:
>>>    extends: .qemu-arm64
>>>    script:
>>> diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh
>> b/automation/scripts/qemu-smoke-dom0less-arm64.sh
>>> index 182a4b6c18..4e73857199 100755
>>> --- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
>>> +++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
>>> @@ -27,6 +27,11 @@ fi
>>>  "
>>>  fi
>>>
>>> +if [[ "${test_variant}" == "static-heap" ]]; then
>>> +    passed="${test_variant} test passed"
>>> +    domU_check="echo \"${passed}\""
>>> +fi
>>> +
>>>  if [[ "${test_variant}" == "boot-cpupools" ]]; then
>>>      # Check if domU0 (id=1) is assigned to Pool-1 with null scheduler
>>>      passed="${test_variant} test passed"
>>> @@ -128,6 +133,19 @@ if [[ "${test_variant}" == "static-mem" ]]; then
>>>      echo -e "\nDOMU_STATIC_MEM[0]=\"${domu_base} ${domu_size}\"" >>
>> binaries/config
>>>  fi
>>>
>>> +if [[ "${test_variant}" == "static-heap" ]]; then
>>> +    # ImageBuilder uses the config file to create the uboot script. Devicetree
>>> +    # will be set via the generated uboot script.
>>> +    # The valid memory range is 0x40000000 to 0x80000000 as defined
>> before.
>>> +    # ImageBuillder sets the kernel and ramdisk range based on the file size.
>>> +    # It will use the memory range between 0x45600000 to 0x47AED1E8, so
>> set
>>> +    # memory range between 0x50000000 and 0x80000000 as static heap.
>>
>> I think this is OK. One suggestion to make things more reliable would be
>> to change MEMORY_END to be 0x50000000 so that you can be sure that
>> ImageBuilder won't go over the limit. You could do it just for this
>> test, which would be safer, but to be honest you could limit MEMORY_END
>> to 0x50000000 for all tests in qemu-smoke-dom0less-arm64.sh because it
>> shouldn't really cause any problems.
>>
> [Jiamei Xie]
> Thanks for your comments. I am a little confused about " to change MEMORY_END to be 0x50000000".
>  I set 0STATIC_HEAP="0x50000000 0x30000000" where is the start address. Why change MEMORY_END
>  to be 0x50000000?
Let me answer to that question so that you do not need to wait another day for Stefano.
ImageBuilder uses MEMORY_START and MEMORY_END from the cfg file as a range in which it can instruct
u-boot where to place the images. It is safer to set MEMORY_END to 0x50000000 rather than to 0xC0000000
because you will be sure that no image will be placed in a region that you defined as static heap.

~Michal



^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 1/2] automation: arm64: Create a test job for testing static heap on qemu
  2023-03-03  7:47       ` Michal Orzel
@ 2023-03-03  9:13         ` Jiamei Xie
  2023-03-03  9:52           ` Michal Orzel
  0 siblings, 1 reply; 9+ messages in thread
From: Jiamei Xie @ 2023-03-03  9:13 UTC (permalink / raw
  To: Michal Orzel, Stefano Stabellini
  Cc: xen-devel@lists.xenproject.org, Wei Chen, Bertrand Marquis,
	Doug Goldstein

Hi Michal,

> -----Original Message-----
> From: Michal Orzel <michal.orzel@amd.com>
> Sent: Friday, March 3, 2023 3:47 PM
> To: Jiamei Xie <Jiamei.Xie@arm.com>; Stefano Stabellini
> <sstabellini@kernel.org>
> Cc: xen-devel@lists.xenproject.org; Wei Chen <Wei.Chen@arm.com>;
> Bertrand Marquis <Bertrand.Marquis@arm.com>; Doug Goldstein
> <cardoe@cardoe.com>
> Subject: Re: [PATCH 1/2] automation: arm64: Create a test job for testing
> static heap on qemu
> 
> Hi Jiamei,
> 
> On 03/03/2023 07:49, Jiamei Xie wrote:
> >
> >
> > Hi Stefano,
> >
> >> -----Original Message-----
> >> From: Stefano Stabellini <sstabellini@kernel.org>
> >> Sent: Friday, March 3, 2023 9:51 AM
> >> To: Jiamei Xie <Jiamei.Xie@arm.com>
> >> Cc: xen-devel@lists.xenproject.org; Wei Chen <Wei.Chen@arm.com>;
> >> sstabellini@kernel.org; Bertrand Marquis <Bertrand.Marquis@arm.com>;
> >> Doug Goldstein <cardoe@cardoe.com>
> >> Subject: Re: [PATCH 1/2] automation: arm64: Create a test job for testing
> >> static heap on qemu
> >>
> >> On Thu, 2 Mar 2023, jiamei.xie wrote:
> >>> From: Jiamei Xie <jiamei.xie@arm.com>
> >>>
> >>> Create a new test job, called qemu-smoke-dom0less-arm64-gcc-
> staticheap.
> >>>
> >>> Add property "xen,static-heap" under /chosen node to enable static-heap.
> >>> If the domU can start successfully with static-heap enabled, then this
> >>> test pass.
> >>>
> >>> Signed-off-by: Jiamei Xie <jiamei.xie@arm.com>
> >>
> >> Hi Jiamei, thanks for the patch!
> >>
> >>
> >>> ---
> >>>  automation/gitlab-ci/test.yaml                 | 16 ++++++++++++++++
> >>>  .../scripts/qemu-smoke-dom0less-arm64.sh       | 18
> >> ++++++++++++++++++
> >>>  2 files changed, 34 insertions(+)
> >>>
> >>> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-
> ci/test.yaml
> >>> index 1c5f400b68..5a9b88477a 100644
> >>> --- a/automation/gitlab-ci/test.yaml
> >>> +++ b/automation/gitlab-ci/test.yaml
> >>> @@ -133,6 +133,22 @@ qemu-smoke-dom0less-arm64-gcc-debug-
> >> staticmem:
> >>>      - *arm64-test-needs
> >>>      - alpine-3.12-gcc-debug-arm64-staticmem
> >>>
> >>> +qemu-smoke-dom0less-arm64-gcc-staticheap:
> >>> + extends: .qemu-arm64
> >>> + script:
> >>> +   - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-heap
> >> 2>&1 | tee ${LOGFILE}
> >>> + needs:
> >>> +   - *arm64-test-needs
> >>> +   - alpine-3.12-gcc-arm64
> >>> +
> >>> +qemu-smoke-dom0less-arm64-gcc-debug-staticheap:
> >>> + extends: .qemu-arm64
> >>> + script:
> >>> +   - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-heap
> >> 2>&1 | tee ${LOGFILE}
> >>> + needs:
> >>> +   - *arm64-test-needs
> >>> +   - alpine-3.12-gcc-debug-arm64
> >>> +
> >>>  qemu-smoke-dom0less-arm64-gcc-boot-cpupools:
> >>>    extends: .qemu-arm64
> >>>    script:
> >>> diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh
> >> b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> >>> index 182a4b6c18..4e73857199 100755
> >>> --- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
> >>> +++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> >>> @@ -27,6 +27,11 @@ fi
> >>>  "
> >>>  fi
> >>>
> >>> +if [[ "${test_variant}" == "static-heap" ]]; then
> >>> +    passed="${test_variant} test passed"
> >>> +    domU_check="echo \"${passed}\""
> >>> +fi
> >>> +
> >>>  if [[ "${test_variant}" == "boot-cpupools" ]]; then
> >>>      # Check if domU0 (id=1) is assigned to Pool-1 with null scheduler
> >>>      passed="${test_variant} test passed"
> >>> @@ -128,6 +133,19 @@ if [[ "${test_variant}" == "static-mem" ]]; then
> >>>      echo -e "\nDOMU_STATIC_MEM[0]=\"${domu_base}
> ${domu_size}\"" >>
> >> binaries/config
> >>>  fi
> >>>
> >>> +if [[ "${test_variant}" == "static-heap" ]]; then
> >>> +    # ImageBuilder uses the config file to create the uboot script.
> Devicetree
> >>> +    # will be set via the generated uboot script.
> >>> +    # The valid memory range is 0x40000000 to 0x80000000 as defined
> >> before.
> >>> +    # ImageBuillder sets the kernel and ramdisk range based on the file
> size.
> >>> +    # It will use the memory range between 0x45600000 to 0x47AED1E8,
> so
> >> set
> >>> +    # memory range between 0x50000000 and 0x80000000 as static
> heap.
> >>
> >> I think this is OK. One suggestion to make things more reliable would be
> >> to change MEMORY_END to be 0x50000000 so that you can be sure that
> >> ImageBuilder won't go over the limit. You could do it just for this
> >> test, which would be safer, but to be honest you could limit MEMORY_END
> >> to 0x50000000 for all tests in qemu-smoke-dom0less-arm64.sh because it
> >> shouldn't really cause any problems.
> >>
> > [Jiamei Xie]
> > Thanks for your comments. I am a little confused about " to change
> MEMORY_END to be 0x50000000".
> >  I set 0STATIC_HEAP="0x50000000 0x30000000" where is the start address.
> Why change MEMORY_END
> >  to be 0x50000000?
> Let me answer to that question so that you do not need to wait another day
> for Stefano.
> ImageBuilder uses MEMORY_START and MEMORY_END from the cfg file as a
> range in which it can instruct
> u-boot where to place the images. It is safer to set MEMORY_END to
> 0x50000000 rather than to 0xC0000000
> because you will be sure that no image will be placed in a region that you
> defined as static heap.

Got it, thanks!  Another question,  set MEMORY_END=0x50000000 for all test cases or just this test cases ? Currently I run the test case manually without xen gitlab ci enviroment . If set this for all test cases, all test cases should be tested.

Best wishes
Jiamei Xie
> 
> ~Michal


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] automation: arm64: Create a test job for testing static heap on qemu
  2023-03-03  9:13         ` Jiamei Xie
@ 2023-03-03  9:52           ` Michal Orzel
  0 siblings, 0 replies; 9+ messages in thread
From: Michal Orzel @ 2023-03-03  9:52 UTC (permalink / raw
  To: Jiamei Xie, Stefano Stabellini
  Cc: xen-devel@lists.xenproject.org, Wei Chen, Bertrand Marquis,
	Doug Goldstein

Hi Jiamei,

On 03/03/2023 10:13, Jiamei Xie wrote:
> 
> 
> Hi Michal,
> 
>> -----Original Message-----
>> From: Michal Orzel <michal.orzel@amd.com>
>> Sent: Friday, March 3, 2023 3:47 PM
>> To: Jiamei Xie <Jiamei.Xie@arm.com>; Stefano Stabellini
>> <sstabellini@kernel.org>
>> Cc: xen-devel@lists.xenproject.org; Wei Chen <Wei.Chen@arm.com>;
>> Bertrand Marquis <Bertrand.Marquis@arm.com>; Doug Goldstein
>> <cardoe@cardoe.com>
>> Subject: Re: [PATCH 1/2] automation: arm64: Create a test job for testing
>> static heap on qemu
>>
>> Hi Jiamei,
>>
>> On 03/03/2023 07:49, Jiamei Xie wrote:
>>>
>>>
>>> Hi Stefano,
>>>
>>>> -----Original Message-----
>>>> From: Stefano Stabellini <sstabellini@kernel.org>
>>>> Sent: Friday, March 3, 2023 9:51 AM
>>>> To: Jiamei Xie <Jiamei.Xie@arm.com>
>>>> Cc: xen-devel@lists.xenproject.org; Wei Chen <Wei.Chen@arm.com>;
>>>> sstabellini@kernel.org; Bertrand Marquis <Bertrand.Marquis@arm.com>;
>>>> Doug Goldstein <cardoe@cardoe.com>
>>>> Subject: Re: [PATCH 1/2] automation: arm64: Create a test job for testing
>>>> static heap on qemu
>>>>
>>>> On Thu, 2 Mar 2023, jiamei.xie wrote:
>>>>> From: Jiamei Xie <jiamei.xie@arm.com>
>>>>>
>>>>> Create a new test job, called qemu-smoke-dom0less-arm64-gcc-
>> staticheap.
>>>>>
>>>>> Add property "xen,static-heap" under /chosen node to enable static-heap.
>>>>> If the domU can start successfully with static-heap enabled, then this
>>>>> test pass.
>>>>>
>>>>> Signed-off-by: Jiamei Xie <jiamei.xie@arm.com>
>>>>
>>>> Hi Jiamei, thanks for the patch!
>>>>
>>>>
>>>>> ---
>>>>>  automation/gitlab-ci/test.yaml                 | 16 ++++++++++++++++
>>>>>  .../scripts/qemu-smoke-dom0less-arm64.sh       | 18
>>>> ++++++++++++++++++
>>>>>  2 files changed, 34 insertions(+)
>>>>>
>>>>> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-
>> ci/test.yaml
>>>>> index 1c5f400b68..5a9b88477a 100644
>>>>> --- a/automation/gitlab-ci/test.yaml
>>>>> +++ b/automation/gitlab-ci/test.yaml
>>>>> @@ -133,6 +133,22 @@ qemu-smoke-dom0less-arm64-gcc-debug-
>>>> staticmem:
>>>>>      - *arm64-test-needs
>>>>>      - alpine-3.12-gcc-debug-arm64-staticmem
>>>>>
>>>>> +qemu-smoke-dom0less-arm64-gcc-staticheap:
>>>>> + extends: .qemu-arm64
>>>>> + script:
>>>>> +   - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-heap
>>>> 2>&1 | tee ${LOGFILE}
>>>>> + needs:
>>>>> +   - *arm64-test-needs
>>>>> +   - alpine-3.12-gcc-arm64
>>>>> +
>>>>> +qemu-smoke-dom0less-arm64-gcc-debug-staticheap:
>>>>> + extends: .qemu-arm64
>>>>> + script:
>>>>> +   - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-heap
>>>> 2>&1 | tee ${LOGFILE}
>>>>> + needs:
>>>>> +   - *arm64-test-needs
>>>>> +   - alpine-3.12-gcc-debug-arm64
>>>>> +
>>>>>  qemu-smoke-dom0less-arm64-gcc-boot-cpupools:
>>>>>    extends: .qemu-arm64
>>>>>    script:
>>>>> diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh
>>>> b/automation/scripts/qemu-smoke-dom0less-arm64.sh
>>>>> index 182a4b6c18..4e73857199 100755
>>>>> --- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
>>>>> +++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
>>>>> @@ -27,6 +27,11 @@ fi
>>>>>  "
>>>>>  fi
>>>>>
>>>>> +if [[ "${test_variant}" == "static-heap" ]]; then
>>>>> +    passed="${test_variant} test passed"
>>>>> +    domU_check="echo \"${passed}\""
>>>>> +fi
>>>>> +
>>>>>  if [[ "${test_variant}" == "boot-cpupools" ]]; then
>>>>>      # Check if domU0 (id=1) is assigned to Pool-1 with null scheduler
>>>>>      passed="${test_variant} test passed"
>>>>> @@ -128,6 +133,19 @@ if [[ "${test_variant}" == "static-mem" ]]; then
>>>>>      echo -e "\nDOMU_STATIC_MEM[0]=\"${domu_base}
>> ${domu_size}\"" >>
>>>> binaries/config
>>>>>  fi
>>>>>
>>>>> +if [[ "${test_variant}" == "static-heap" ]]; then
>>>>> +    # ImageBuilder uses the config file to create the uboot script.
>> Devicetree
>>>>> +    # will be set via the generated uboot script.
>>>>> +    # The valid memory range is 0x40000000 to 0x80000000 as defined
>>>> before.
>>>>> +    # ImageBuillder sets the kernel and ramdisk range based on the file
>> size.
>>>>> +    # It will use the memory range between 0x45600000 to 0x47AED1E8,
>> so
>>>> set
>>>>> +    # memory range between 0x50000000 and 0x80000000 as static
>> heap.
>>>>
>>>> I think this is OK. One suggestion to make things more reliable would be
>>>> to change MEMORY_END to be 0x50000000 so that you can be sure that
>>>> ImageBuilder won't go over the limit. You could do it just for this
>>>> test, which would be safer, but to be honest you could limit MEMORY_END
>>>> to 0x50000000 for all tests in qemu-smoke-dom0less-arm64.sh because it
>>>> shouldn't really cause any problems.
>>>>
>>> [Jiamei Xie]
>>> Thanks for your comments. I am a little confused about " to change
>> MEMORY_END to be 0x50000000".
>>>  I set 0STATIC_HEAP="0x50000000 0x30000000" where is the start address.
>> Why change MEMORY_END
>>>  to be 0x50000000?
>> Let me answer to that question so that you do not need to wait another day
>> for Stefano.
>> ImageBuilder uses MEMORY_START and MEMORY_END from the cfg file as a
>> range in which it can instruct
>> u-boot where to place the images. It is safer to set MEMORY_END to
>> 0x50000000 rather than to 0xC0000000
>> because you will be sure that no image will be placed in a region that you
>> defined as static heap.
> 
> Got it, thanks!  Another question,  set MEMORY_END=0x50000000 for all test cases or just this test cases ? Currently I run the test case manually without xen gitlab ci enviroment . If set this for all test cases, all test cases should be tested.
You can set it globally as it will be helpful also for static-mem and other test cases should not be impacted.
Before pushing any commit related to CI, the maintainer shall check that it does not cause any issues
by running the pipeline on his account before committing a patch.

~Michal


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-03-03  9:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-02  4:44 [PATCH 0/2] automation: introduce static heap and shared memory tests jiamei.xie
2023-03-02  4:44 ` [PATCH 1/2] automation: arm64: Create a test job for testing static heap on qemu jiamei.xie
2023-03-03  1:50   ` Stefano Stabellini
2023-03-03  6:49     ` Jiamei Xie
2023-03-03  7:47       ` Michal Orzel
2023-03-03  9:13         ` Jiamei Xie
2023-03-03  9:52           ` Michal Orzel
2023-03-02  4:44 ` [PATCH 2/2] automation: arm64: Create a test job for testing static shared memory " jiamei.xie
2023-03-03  1:56   ` Stefano Stabellini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).