From nobody Wed Apr 24 19:39:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1678957992516652.6289764557822; Thu, 16 Mar 2023 02:13:12 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.510408.788025 (Exim 4.92) (envelope-from ) id 1pcjfH-0007In-MH; Thu, 16 Mar 2023 09:12:51 +0000 Received: by outflank-mailman (output) from mailman id 510408.788025; Thu, 16 Mar 2023 09:12:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pcjfH-0007Ig-In; Thu, 16 Mar 2023 09:12:51 +0000 Received: by outflank-mailman (input) for mailman id 510408; Thu, 16 Mar 2023 09:12:50 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pcjfG-0006zO-Em for xen-devel@lists.xenproject.org; Thu, 16 Mar 2023 09:12:50 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-sth1.inumbo.com (Halon) with ESMTP id b91a9c8e-c3da-11ed-87f5-c1b5be75604c; Thu, 16 Mar 2023 10:12:49 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AACF32F4; Thu, 16 Mar 2023 02:13:32 -0700 (PDT) Received: from comhpcalt.shanghai.arm.com (comhpcalt.shanghai.arm.com [10.169.190.22]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BF1923F67D; Thu, 16 Mar 2023 02:12:46 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b91a9c8e-c3da-11ed-87f5-c1b5be75604c From: "jiamei.xie" To: xen-devel@lists.xenproject.org Cc: wei.chen@arm.com, jiamei.xie@arm.com, sstabellini@kernel.org, bertrand.marquis@arm.com, Doug Goldstein Subject: [PATCH v2 1/2] automation: arm64: Create test jobs for testing static heap on qemu Date: Thu, 16 Mar 2023 09:12:23 +0000 Message-Id: <20230316091224.338620-2-jiamei.xie@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230316091224.338620-1-jiamei.xie@arm.com> References: <20230316091224.338620-1-jiamei.xie@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1678957992809100001 Content-Type: text/plain; charset="utf-8" From: Jiamei Xie Create 2 new test jobs, called qemu-smoke-dom0less-arm64-gcc-staticheap and qemu-smoke-dom0less-arm64-gcc-debug-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. ImageBuillder sets the kernel and ramdisk range based on the file size. It will use the memory range between 0x45600000 to 0x47AED1E8. It 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. Change MEMORY_END to 0x50000000 for all test cases. Signed-off-by: Jiamei Xie Reviewed-by: Stefano Stabellini --- Changes from v1: - Change MEMORY_END to 0x50000000 for all test cases. - Update commit message. --- automation/gitlab-ci/test.yaml | 16 ++++++++++++++ .../scripts/qemu-smoke-dom0less-arm64.sh | 21 ++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index 2e1a6886df..37465305ff 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -158,6 +158,22 @@ qemu-smoke-dom0less-arm64-gcc-debug-staticmem: - *arm64-test-needs - alpine-3.12-gcc-debug-arm64-staticmem =20 +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/s= cripts/qemu-smoke-dom0less-arm64.sh index 182a4b6c18..2d69d976ea 100755 --- a/automation/scripts/qemu-smoke-dom0less-arm64.sh +++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh @@ -27,6 +27,11 @@ fi " fi =20 +if [[ "${test_variant}" =3D=3D "static-heap" ]]; then + passed=3D"${test_variant} test passed" + domU_check=3D"echo \"${passed}\"" +fi + if [[ "${test_variant}" =3D=3D "boot-cpupools" ]]; then # Check if domU0 (id=3D1) is assigned to Pool-1 with null scheduler passed=3D"${test_variant} test passed" @@ -107,7 +112,7 @@ cd .. =20 # ImageBuilder echo 'MEMORY_START=3D"0x40000000" -MEMORY_END=3D"0xC0000000" +MEMORY_END=3D"0x50000000" =20 DEVICE_TREE=3D"virt-gicv2.dtb" XEN=3D"xen" @@ -128,6 +133,20 @@ if [[ "${test_variant}" =3D=3D "static-mem" ]]; then echo -e "\nDOMU_STATIC_MEM[0]=3D\"${domu_base} ${domu_size}\"" >> bina= ries/config fi =20 +if [[ "${test_variant}" =3D=3D "static-heap" ]]; then + # ImageBuilder uses the config file to create the uboot script. Device= tree + # 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 si= ze. + # It will use the memory range between 0x45600000 to 0x47AED1E8, and + # MEMORY_END has been set to 0x50000000 above, so set memory range bet= ween + # 0x50000000 and 0x80000000 as static heap. + echo ' +XEN_STATIC_HEAP=3D"0x50000000 0x30000000" +# The size of static heap should be greater than the guest memory +DOMU_MEM[0]=3D"128"' >> binaries/config +fi + if [[ "${test_variant}" =3D=3D "boot-cpupools" ]]; then echo ' CPUPOOL[0]=3D"cpu@1 null" --=20 2.25.1 From nobody Wed Apr 24 19:39:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1678958002729929.5591328317034; Thu, 16 Mar 2023 02:13:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.510410.788034 (Exim 4.92) (envelope-from ) id 1pcjfR-0007lm-3d; Thu, 16 Mar 2023 09:13:01 +0000 Received: by outflank-mailman (output) from mailman id 510410.788034; Thu, 16 Mar 2023 09:13:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pcjfR-0007lf-0u; Thu, 16 Mar 2023 09:13:01 +0000 Received: by outflank-mailman (input) for mailman id 510410; Thu, 16 Mar 2023 09:12:59 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pcjfP-0006zO-H7 for xen-devel@lists.xenproject.org; Thu, 16 Mar 2023 09:12:59 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-sth1.inumbo.com (Halon) with ESMTP id be7f5df2-c3da-11ed-87f5-c1b5be75604c; Thu, 16 Mar 2023 10:12:58 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D37E62F4; Thu, 16 Mar 2023 02:13:41 -0700 (PDT) Received: from comhpcalt.shanghai.arm.com (comhpcalt.shanghai.arm.com [10.169.190.22]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id EBA3B3F67D; Thu, 16 Mar 2023 02:12:55 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: be7f5df2-c3da-11ed-87f5-c1b5be75604c From: "jiamei.xie" To: xen-devel@lists.xenproject.org Cc: wei.chen@arm.com, jiamei.xie@arm.com, sstabellini@kernel.org, bertrand.marquis@arm.com, Doug Goldstein Subject: [PATCH v2 2/2] automation: arm64: Create test jobs for testing static shared memory on qemu Date: Thu, 16 Mar 2023 09:12:24 +0000 Message-Id: <20230316091224.338620-3-jiamei.xie@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230316091224.338620-1-jiamei.xie@arm.com> References: <20230316091224.338620-1-jiamei.xie@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1678958004872100001 Content-Type: text/plain; charset="utf-8" Create 2 new test jobs, called qemu-smoke-dom0less-arm64-gcc-static-shared-= mem and qemu-smoke-dom0less-arm64-gcc-debug-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/reser= ved-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 Reviewed-by: Stefano Stabellini --- Changes from v1: - Move the second domU creation to the general ImageBuilder script. --- 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.y= aml 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=3Dy CONFIG_STATIC_MEMORY=3Dy =20 +alpine-3.12-gcc-arm64-static-shared-mem: + extends: .gcc-arm64-build + variables: + CONTAINER: alpine:3.12-arm64v8 + EXTRA_XEN_CONFIG: | + CONFIG_UNSUPPORTED=3Dy + CONFIG_STATIC_MEMORY=3Dy + CONFIG_STATIC_SHM=3Dy + +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=3Dy + CONFIG_STATIC_MEMORY=3Dy + CONFIG_STATIC_SHM=3Dy + 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 37465305ff..d75662358f 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -174,6 +174,22 @@ qemu-smoke-dom0less-arm64-gcc-debug-staticheap: - *arm64-test-needs - alpine-3.12-gcc-debug-arm64 =20 +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/s= cripts/qemu-smoke-dom0less-arm64.sh index 2d69d976ea..75f575424a 100755 --- a/automation/scripts/qemu-smoke-dom0less-arm64.sh +++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh @@ -32,6 +32,25 @@ if [[ "${test_variant}" =3D=3D "static-heap" ]]; then domU_check=3D"echo \"${passed}\"" fi =20 + +if [[ "${test_variant}" =3D=3D "static-shared-mem" ]]; then + passed=3D"${test_variant} test passed" + SHARED_MEM_HOST=3D"50000000" + SHARED_MEM_GUEST=3D"4000000" + SHARED_MEM_SIZE=3D"10000000" + SHARED_MEM_ID=3D"my-shared-mem-0" + + domU_check=3D" +current_id=3D\$(cat /proc/device-tree/reserved-memory/xen-shmem@4000000/xe= n,id 2>/dev/null) +expected_id=3D\"\$(echo ${SHARED_MEM_ID})\" +current_reg=3D\$(hexdump -e '16/1 \"%02x\"' /proc/device-tree/reserved-mem= ory/xen-shmem@4000000/reg 2>/dev/null) +expected_reg=3D$(printf \"%016x%016x\" 0x${SHARED_MEM_GUEST} 0x${SHARED_ME= M_SIZE}) +if [[ \"\${expected_reg}\" =3D=3D \"\${current_reg}\" && \"\${current_id}\= " =3D=3D \"\${expected_id}\" ]]; then + echo \"${passed}\" +fi + " +fi + if [[ "${test_variant}" =3D=3D "boot-cpupools" ]]; then # Check if domU0 (id=3D1) is assigned to Pool-1 with null scheduler passed=3D"${test_variant} test passed" @@ -124,6 +143,9 @@ NUM_DOMUS=3D1 DOMU_KERNEL[0]=3D"Image" DOMU_RAMDISK[0]=3D"initrd" DOMU_MEM[0]=3D"256" +DOMU_KERNEL[1]=3D"Image" +DOMU_RAMDISK[1]=3D"initrd" +DOMU_MEM[1]=3D"256" =20 LOAD_CMD=3D"tftpb" UBOOT_SOURCE=3D"boot.source" @@ -133,6 +155,13 @@ if [[ "${test_variant}" =3D=3D "static-mem" ]]; then echo -e "\nDOMU_STATIC_MEM[0]=3D\"${domu_base} ${domu_size}\"" >> bina= ries/config fi =20 +if [[ "${test_variant}" =3D=3D "static-shared-mem" ]]; then +echo " +NUM_DOMUS=3D2 +DOMU_SHARED_MEM[0]=3D\"${SHARED_MEM_ID} 0x${SHARED_MEM_HOST} 0x${SHARED_ME= M_GUEST} 0x${SHARED_MEM_SIZE}\" +DOMU_SHARED_MEM[1]=3D\"${SHARED_MEM_ID} 0x${SHARED_MEM_HOST} 0x${SHARED_ME= M_GUEST} 0x${SHARED_MEM_SIZE}\"" >> binaries/config +fi + if [[ "${test_variant}" =3D=3D "static-heap" ]]; then # ImageBuilder uses the config file to create the uboot script. Device= tree # will be set via the generated uboot script. --=20 2.25.1