All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/10] GitLab CI cleanup & improvements for Arm
@ 2022-09-27  9:47 Michal Orzel
  2022-09-27  9:47 ` [for-4.17,PATCH v3 01/10] automation: qemu-smoke-arm{32/64}.sh: Fix typo in DEBIAN_FRONTENT Michal Orzel
                   ` (9 more replies)
  0 siblings, 10 replies; 21+ messages in thread
From: Michal Orzel @ 2022-09-27  9:47 UTC (permalink / raw)
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini

This patch series performs necessary cleanup and improvements in our
GitLab CI automation for Arm. This is crucial so that in the future
we can focus on adding new tests instead of spending time to fix
issues, making the behavior consistent, removing ambiguity, etc.

With the increased interest in gitlab-ci and using it locally, there
is still some work to do mainly to improve documentation. This however,
will be handled in the future series.

Michal Orzel (10):
  automation: qemu-smoke-arm{32/64}.sh: Fix typo in DEBIAN_FRONTENT
  automation: Add randconfig build jobs for arm64 alpine container
  automation: qemu-smoke-arm64.sh: Increase RAM size
  automation: Add debug versions of Arm tests
  automation: Add Arm containers to containerize script
  automation: qemu-smoke-arm32.sh: Modify script to use ImageBuilder
  automation: qemu-alpine-arm64: Cleanup and fixes
  automation: Rename qemu-smoke-arm64.sh to qemu-smoke-dom0less-arm64.sh
  automation: Rename qemu-alpine-arm64.sh to qemu-smoke-dom0-arm64.sh
  automation: Rename qemu-smoke-arm32.sh to qemu-smoke-dom0-arm32.sh

 automation/gitlab-ci/build.yaml               |  28 +++++
 automation/gitlab-ci/test.yaml                | 113 ++++++++++++++++--
 automation/scripts/containerize               |   3 +
 ...moke-arm32.sh => qemu-smoke-dom0-arm32.sh} |  59 +++++----
 ...pine-arm64.sh => qemu-smoke-dom0-arm64.sh} |  14 +--
 ...-arm64.sh => qemu-smoke-dom0less-arm64.sh} |   8 +-
 6 files changed, 173 insertions(+), 52 deletions(-)
 rename automation/scripts/{qemu-smoke-arm32.sh => qemu-smoke-dom0-arm32.sh} (54%)
 rename automation/scripts/{qemu-alpine-arm64.sh => qemu-smoke-dom0-arm64.sh} (88%)
 rename automation/scripts/{qemu-smoke-arm64.sh => qemu-smoke-dom0less-arm64.sh} (96%)

-- 
2.25.1



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

* [for-4.17,PATCH v3 01/10] automation: qemu-smoke-arm{32/64}.sh: Fix typo in DEBIAN_FRONTENT
  2022-09-27  9:47 [PATCH v3 00/10] GitLab CI cleanup & improvements for Arm Michal Orzel
@ 2022-09-27  9:47 ` Michal Orzel
  2022-09-27  9:51   ` Henry Wang
                     ` (2 more replies)
  2022-09-27  9:47 ` [PATCH v3 02/10] automation: Add randconfig build jobs for arm64 alpine container Michal Orzel
                   ` (8 subsequent siblings)
  9 siblings, 3 replies; 21+ messages in thread
From: Michal Orzel @ 2022-09-27  9:47 UTC (permalink / raw)
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini, Henry Wang

The correct variable name is DEBIAN_FRONTEND and not DEBIAN_FRONTENT.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
CC: Henry Wang <Henry.Wang@arm.com>

Rationale for taking this patch for 4.17:
Setting DEBIAN_FRONTEND to noninteractive menas that we need zero interaction
while installing/upgrading the system via apt-get. It accepts the default
answer to all the questions (using apt-get -y only works for "yes"/"no"
prompts). With the typo not fixed, we might get stuck in CI jobs.
The risk is very low as we perform pre-push testing using GitLab CI to make
sure the changes will not break the pipeline.

Changes in v3:
- new patch
---
 automation/scripts/qemu-smoke-arm32.sh | 2 +-
 automation/scripts/qemu-smoke-arm64.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/qemu-smoke-arm32.sh b/automation/scripts/qemu-smoke-arm32.sh
index 530f3892fdd3..c8ae0bfb9b1c 100755
--- a/automation/scripts/qemu-smoke-arm32.sh
+++ b/automation/scripts/qemu-smoke-arm32.sh
@@ -2,7 +2,7 @@
 
 set -ex
 
-export DEBIAN_FRONTENT=noninteractive
+export DEBIAN_FRONTEND=noninteractive
 apt-get -qy update
 apt-get -qy install --no-install-recommends device-tree-compiler \
                                             curl \
diff --git a/automation/scripts/qemu-smoke-arm64.sh b/automation/scripts/qemu-smoke-arm64.sh
index f803835779f4..5b566072f72a 100755
--- a/automation/scripts/qemu-smoke-arm64.sh
+++ b/automation/scripts/qemu-smoke-arm64.sh
@@ -38,7 +38,7 @@ fi
 "
 fi
 
-export DEBIAN_FRONTENT=noninteractive
+export DEBIAN_FRONTEND=noninteractive
 apt-get -qy update
 apt-get -qy install --no-install-recommends u-boot-qemu \
                                             u-boot-tools \
-- 
2.25.1



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

* [PATCH v3 02/10] automation: Add randconfig build jobs for arm64 alpine container
  2022-09-27  9:47 [PATCH v3 00/10] GitLab CI cleanup & improvements for Arm Michal Orzel
  2022-09-27  9:47 ` [for-4.17,PATCH v3 01/10] automation: qemu-smoke-arm{32/64}.sh: Fix typo in DEBIAN_FRONTENT Michal Orzel
@ 2022-09-27  9:47 ` Michal Orzel
  2022-09-27  9:47 ` [PATCH v3 03/10] automation: qemu-smoke-arm64.sh: Increase RAM size Michal Orzel
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Michal Orzel @ 2022-09-27  9:47 UTC (permalink / raw)
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini, Luca Fancellu

For arm64 we perform builds using debian and alpine containers.
We are missing the randconfig build jobs for the latter, so add them.
This way for each container we have 4 fundamental build jobs:
- defconfig non-debug/debug
- randconfig non-debug/debug

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
---
Changes in v3:
- none
Changes in v2:
- none
---
 automation/gitlab-ci/build.yaml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index a39ed72aac6d..d931441b910a 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -566,6 +566,18 @@ alpine-3.12-gcc-debug-arm64:
   variables:
     CONTAINER: alpine:3.12-arm64v8
 
+alpine-3.12-gcc-arm64-randconfig:
+  extends: .gcc-arm64-build
+  variables:
+    CONTAINER: alpine:3.12-arm64v8
+    RANDCONFIG: y
+
+alpine-3.12-gcc-debug-arm64-randconfig:
+  extends: .gcc-arm64-build-debug
+  variables:
+    CONTAINER: alpine:3.12-arm64v8
+    RANDCONFIG: y
+
 alpine-3.12-gcc-arm64-staticmem:
   extends: .gcc-arm64-build
   variables:
-- 
2.25.1



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

* [PATCH v3 03/10] automation: qemu-smoke-arm64.sh: Increase RAM size
  2022-09-27  9:47 [PATCH v3 00/10] GitLab CI cleanup & improvements for Arm Michal Orzel
  2022-09-27  9:47 ` [for-4.17,PATCH v3 01/10] automation: qemu-smoke-arm{32/64}.sh: Fix typo in DEBIAN_FRONTENT Michal Orzel
  2022-09-27  9:47 ` [PATCH v3 02/10] automation: Add randconfig build jobs for arm64 alpine container Michal Orzel
@ 2022-09-27  9:47 ` Michal Orzel
  2022-09-27  9:47 ` [PATCH v3 04/10] automation: Add debug versions of Arm tests Michal Orzel
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Michal Orzel @ 2022-09-27  9:47 UTC (permalink / raw)
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini, Luca Fancellu

In the follow-up patch we will add new jobs using debug Xen builds.
Because the debug builds take more space and we might end up in
a situation when there is not enough free space (especially during
a static memory test that reserves some region in the middle), increase
RAM size for QEMU from 1GB to 2GB.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
---
Changes in v3:
- none
Changes in v2:
- new patch carved out from previous v1 [3/9] patch
---
 automation/scripts/qemu-smoke-arm64.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/automation/scripts/qemu-smoke-arm64.sh b/automation/scripts/qemu-smoke-arm64.sh
index 5b566072f72a..933209e2e01e 100755
--- a/automation/scripts/qemu-smoke-arm64.sh
+++ b/automation/scripts/qemu-smoke-arm64.sh
@@ -52,7 +52,7 @@ curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
 ./binaries/qemu-system-aarch64 \
    -machine virtualization=true \
    -cpu cortex-a57 -machine type=virt \
-   -m 1024 -smp 2 -display none \
+   -m 2048 -smp 2 -display none \
    -machine dumpdtb=binaries/virt-gicv2.dtb
 
 # XXX disable pl061 to avoid Linux crash
@@ -117,7 +117,7 @@ cd ..
 
 # ImageBuilder
 echo 'MEMORY_START="0x40000000"
-MEMORY_END="0x80000000"
+MEMORY_END="0xC0000000"
 
 DEVICE_TREE="virt-gicv2.dtb"
 XEN="xen"
@@ -158,7 +158,7 @@ timeout -k 1 240 \
 ./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
-    -m 1024 -monitor none -serial stdio \
+    -m 2048 -monitor none -serial stdio \
     -smp 2 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
-- 
2.25.1



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

* [PATCH v3 04/10] automation: Add debug versions of Arm tests
  2022-09-27  9:47 [PATCH v3 00/10] GitLab CI cleanup & improvements for Arm Michal Orzel
                   ` (2 preceding siblings ...)
  2022-09-27  9:47 ` [PATCH v3 03/10] automation: qemu-smoke-arm64.sh: Increase RAM size Michal Orzel
@ 2022-09-27  9:47 ` Michal Orzel
  2022-09-27  9:47 ` [PATCH v3 05/10] automation: Add Arm containers to containerize script Michal Orzel
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Michal Orzel @ 2022-09-27  9:47 UTC (permalink / raw)
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini, Luca Fancellu

At the moment, all the tests are executed on non-debug Xen builds.
To improve the coverage (e.g. we might catch some asserts), add new
test jobs using debug Xen builds.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
---
Changes in v3:
- none
Changes in v2:
- carve out the RAM size change to a separate patch [v2 03/10]
---
 automation/gitlab-ci/build.yaml | 16 ++++++
 automation/gitlab-ci/test.yaml  | 93 +++++++++++++++++++++++++++++++++
 2 files changed, 109 insertions(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index d931441b910a..6ce92531f61f 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -587,6 +587,15 @@ alpine-3.12-gcc-arm64-staticmem:
       CONFIG_UNSUPPORTED=y
       CONFIG_STATIC_MEMORY=y
 
+alpine-3.12-gcc-debug-arm64-staticmem:
+  extends: .gcc-arm64-build-debug
+  variables:
+    CONTAINER: alpine:3.12-arm64v8
+    EXTRA_XEN_CONFIG: |
+      CONFIG_EXPERT=y
+      CONFIG_UNSUPPORTED=y
+      CONFIG_STATIC_MEMORY=y
+
 alpine-3.12-gcc-arm64-boot-cpupools:
   extends: .gcc-arm64-build
   variables:
@@ -594,6 +603,13 @@ alpine-3.12-gcc-arm64-boot-cpupools:
     EXTRA_XEN_CONFIG: |
       CONFIG_BOOT_TIME_CPUPOOLS=y
 
+alpine-3.12-gcc-debug-arm64-boot-cpupools:
+  extends: .gcc-arm64-build-debug
+  variables:
+    CONTAINER: alpine:3.12-arm64v8
+    EXTRA_XEN_CONFIG: |
+      CONFIG_BOOT_TIME_CPUPOOLS=y
+
 ## Test artifacts common
 
 .test-jobs-artifact-common:
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 4f96e6e322de..1b51030c6175 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -44,6 +44,25 @@ qemu-alpine-arm64-gcc:
   tags:
     - arm64
 
+qemu-alpine-arm64-gcc-debug:
+  extends: .test-jobs-common
+  variables:
+    CONTAINER: debian:unstable-arm64v8
+  script:
+    - ./automation/scripts/qemu-alpine-arm64.sh 2>&1 | tee qemu-smoke-arm64.log
+  needs:
+    - alpine-3.12-gcc-debug-arm64
+    - alpine-3.12-arm64-rootfs-export
+    - kernel-5.19-arm64-export
+    - qemu-system-aarch64-6.0.0-arm64-export
+  artifacts:
+    paths:
+      - smoke.serial
+      - '*.log'
+    when: always
+  tags:
+    - arm64
+
 qemu-alpine-x86_64-gcc:
   extends: .test-jobs-common
   variables:
@@ -81,6 +100,25 @@ qemu-smoke-arm64-gcc:
   tags:
     - arm64
 
+qemu-smoke-arm64-gcc-debug:
+  extends: .test-jobs-common
+  variables:
+    CONTAINER: debian:unstable-arm64v8
+  script:
+    - ./automation/scripts/qemu-smoke-arm64.sh 2>&1 | tee qemu-smoke-arm64.log
+  needs:
+    - alpine-3.12-gcc-debug-arm64
+    - alpine-3.12-arm64-rootfs-export
+    - kernel-5.19-arm64-export
+    - qemu-system-aarch64-6.0.0-arm64-export
+  artifacts:
+    paths:
+      - smoke.serial
+      - '*.log'
+    when: always
+  tags:
+    - arm64
+
 qemu-smoke-arm64-gcc-staticmem:
   extends: .test-jobs-common
   variables:
@@ -100,6 +138,25 @@ qemu-smoke-arm64-gcc-staticmem:
   tags:
     - arm64
 
+qemu-smoke-arm64-gcc-debug-staticmem:
+  extends: .test-jobs-common
+  variables:
+    CONTAINER: debian:unstable-arm64v8
+  script:
+    - ./automation/scripts/qemu-smoke-arm64.sh static-mem 2>&1 | tee qemu-smoke-arm64.log
+  needs:
+    - alpine-3.12-gcc-debug-arm64-staticmem
+    - alpine-3.12-arm64-rootfs-export
+    - kernel-5.19-arm64-export
+    - qemu-system-aarch64-6.0.0-arm64-export
+  artifacts:
+    paths:
+      - smoke.serial
+      - '*.log'
+    when: always
+  tags:
+    - arm64
+
 qemu-smoke-arm64-gcc-boot-cpupools:
   extends: .test-jobs-common
   variables:
@@ -119,6 +176,25 @@ qemu-smoke-arm64-gcc-boot-cpupools:
   tags:
     - arm64
 
+qemu-smoke-arm64-gcc-debug-boot-cpupools:
+  extends: .test-jobs-common
+  variables:
+    CONTAINER: debian:unstable-arm64v8
+  script:
+    - ./automation/scripts/qemu-smoke-arm64.sh boot-cpupools 2>&1 | tee qemu-smoke-arm64.log
+  needs:
+    - alpine-3.12-gcc-debug-arm64-boot-cpupools
+    - alpine-3.12-arm64-rootfs-export
+    - kernel-5.19-arm64-export
+    - qemu-system-aarch64-6.0.0-arm64-export
+  artifacts:
+    paths:
+      - smoke.serial
+      - '*.log'
+    when: always
+  tags:
+    - arm64
+
 qemu-smoke-arm32-gcc:
   extends: .test-jobs-common
   variables:
@@ -136,6 +212,23 @@ qemu-smoke-arm32-gcc:
   tags:
     - arm64
 
+qemu-smoke-arm32-gcc-debug:
+  extends: .test-jobs-common
+  variables:
+    CONTAINER: debian:unstable-arm64v8
+  script:
+    - ./automation/scripts/qemu-smoke-arm32.sh 2>&1 | tee qemu-smoke-arm32.log
+  needs:
+    - debian-unstable-gcc-arm32-debug
+    - qemu-system-aarch64-6.0.0-arm32-export
+  artifacts:
+    paths:
+      - smoke.serial
+      - '*.log'
+    when: always
+  tags:
+    - arm64
+
 qemu-smoke-x86-64-gcc:
   extends: .test-jobs-common
   variables:
-- 
2.25.1



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

* [PATCH v3 05/10] automation: Add Arm containers to containerize script
  2022-09-27  9:47 [PATCH v3 00/10] GitLab CI cleanup & improvements for Arm Michal Orzel
                   ` (3 preceding siblings ...)
  2022-09-27  9:47 ` [PATCH v3 04/10] automation: Add debug versions of Arm tests Michal Orzel
@ 2022-09-27  9:47 ` Michal Orzel
  2022-10-20  3:00   ` Jiamei Xie
  2022-09-27  9:47 ` [PATCH v3 06/10] automation: qemu-smoke-arm32.sh: Modify script to use ImageBuilder Michal Orzel
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 21+ messages in thread
From: Michal Orzel @ 2022-09-27  9:47 UTC (permalink / raw)
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini

Script automation/scripts/containerize makes it easy to build Xen within
predefined containers from gitlab container registry. This script is
currently missing the helpers to select Arm containers, so populate the
necessary entries.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v3:
- none
Changes in v2:
- modify commit msg to reflect that we are missing helpers but in reality
  it could be possible to use Arm containers by specifying the full path
  to gitlab container registry. However, such usage is annoying.
---
 automation/scripts/containerize | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index 9d4beca4fa4b..0f4645c4cccb 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -25,6 +25,7 @@ die() {
 BASE="registry.gitlab.com/xen-project/xen"
 case "_${CONTAINER}" in
     _alpine) CONTAINER="${BASE}/alpine:3.12" ;;
+    _alpine-arm64v8) CONTAINER="${BASE}/alpine:3.12-arm64v8" ;;
     _archlinux|_arch) CONTAINER="${BASE}/archlinux:current" ;;
     _riscv64) CONTAINER="${BASE}/archlinux:riscv64" ;;
     _centos7) CONTAINER="${BASE}/centos:7" ;;
@@ -35,6 +36,8 @@ case "_${CONTAINER}" in
     _stretch|_) CONTAINER="${BASE}/debian:stretch" ;;
     _buster-gcc-ibt) CONTAINER="${BASE}/debian:buster-gcc-ibt" ;;
     _unstable|_) CONTAINER="${BASE}/debian:unstable" ;;
+    _unstable-arm32-gcc) CONTAINER="${BASE}/debian:unstable-arm32-gcc" ;;
+    _unstable-arm64v8) CONTAINER="${BASE}/debian:unstable-arm64v8" ;;
     _trusty) CONTAINER="${BASE}/ubuntu:trusty" ;;
     _xenial) CONTAINER="${BASE}/ubuntu:xenial" ;;
     _opensuse-leap|_leap) CONTAINER="${BASE}/suse:opensuse-leap" ;;
-- 
2.25.1



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

* [PATCH v3 06/10] automation: qemu-smoke-arm32.sh: Modify script to use ImageBuilder
  2022-09-27  9:47 [PATCH v3 00/10] GitLab CI cleanup & improvements for Arm Michal Orzel
                   ` (4 preceding siblings ...)
  2022-09-27  9:47 ` [PATCH v3 05/10] automation: Add Arm containers to containerize script Michal Orzel
@ 2022-09-27  9:47 ` Michal Orzel
  2022-09-27  9:47 ` [PATCH v3 07/10] automation: qemu-alpine-arm64: Cleanup and fixes Michal Orzel
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Michal Orzel @ 2022-09-27  9:47 UTC (permalink / raw)
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini, Luca Fancellu

Take an example from arm64 qemu test scripts and use ImageBuilder
to generate u-boot script automatically. Calculating the addresses
manually is quite error prone and also we will be able to benefit
from using ImageBuilder when adding domUs to this test in the future.

Install and use u-boot from the debian package.
Modify the script so that binaries are loaded from u-boot via tftp.
Remove dtuart=/pl011@9000000 because stdout-path in QEMU dtb is always
set to pl011 node path.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v3:
- none
Changes in v2:
- add explanation in commit msg why we remove dtuart path
---
 automation/scripts/qemu-smoke-arm32.sh | 57 ++++++++++++--------------
 1 file changed, 27 insertions(+), 30 deletions(-)

diff --git a/automation/scripts/qemu-smoke-arm32.sh b/automation/scripts/qemu-smoke-arm32.sh
index c8ae0bfb9b1c..ef19b988c2c4 100755
--- a/automation/scripts/qemu-smoke-arm32.sh
+++ b/automation/scripts/qemu-smoke-arm32.sh
@@ -4,7 +4,9 @@ set -ex
 
 export DEBIAN_FRONTEND=noninteractive
 apt-get -qy update
-apt-get -qy install --no-install-recommends device-tree-compiler \
+apt-get -qy install --no-install-recommends u-boot-qemu \
+                                            u-boot-tools \
+                                            device-tree-compiler \
                                             curl \
                                             cpio
 
@@ -20,10 +22,6 @@ tar xvzf ../initrd.tar.gz
 find . | cpio -H newc -o | gzip > ../initrd.gz
 cd ..
 
-kernel=`stat -L --printf="%s" vmlinuz`
-initrd=`stat -L --printf="%s" initrd.gz`
-
-# For Xen, we need a couple of more node. Dump the DT from QEMU and add them
 # XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
 curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
 ./qemu-system-arm \
@@ -36,31 +34,31 @@ curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
    -display none \
    -machine dumpdtb=virt.dtb
 
-dtc -I dtb -O dts virt.dtb > virt.dts
+# ImageBuilder
+echo 'MEMORY_START="0x40000000"
+MEMORY_END="0x80000000"
+
+DEVICE_TREE="virt.dtb"
+XEN="xen"
+DOM0_KERNEL="vmlinuz"
+DOM0_RAMDISK="initrd.gz"
+DOM0_CMD="console=hvc0 earlyprintk clk_ignore_unused root=/dev/ram0 rdinit=/bin/sh"
+XEN_CMD="console=dtuart dom0_mem=512M bootscrub=0"
+
+NUM_DOMUS=0
+
+LOAD_CMD="tftpb"
+BOOT_CMD="bootm"
+UBOOT_SOURCE="boot.source"
+UBOOT_SCRIPT="boot.scr"' > config
 
-cat >> virt.dts << EOF
-/ {
-	chosen {
-		#address-cells = <0x2>;
-		#size-cells = <0x2>;
-		stdout-path = "/pl011@9000000";
-        xen,xen-bootargs = "console=dtuart dtuart=/pl011@9000000 dom0_mem=512M bootscrub=0";
-		xen,dom0-bootargs = "console=tty0 console=hvc0 earlyprintk clk_ignore_unused root=/dev/ram0 rdinit=/bin/sh";
-		dom0 {
-			compatible = "xen,linux-zimage", "xen,multiboot-module";
-			reg = <0x0 0x1000000 0x0 $kernel>;
-		};
-        dom0-ramdisk {
-			compatible = "xen,linux-initrd", "xen,multiboot-module";
-			reg = <0x0 0x3200000 0x0 $initrd>;
-		};
-	};
-};
-EOF
-dtc -I dts -O dtb virt.dts > virt.dtb
+rm -rf imagebuilder
+git clone https://gitlab.com/ViryaOS/imagebuilder
+bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
 
 rm -f smoke.serial
 set +e
+echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
 timeout -k 1 240 \
 ./qemu-system-arm \
    -machine virt \
@@ -70,11 +68,10 @@ timeout -k 1 240 \
    -serial stdio \
    -monitor none \
    -display none \
-   -dtb virt.dtb \
    -no-reboot \
-   -kernel ./xen \
-   -device loader,file=./vmlinuz,addr=0x1000000 \
-   -device loader,file=./initrd.gz,addr=0x3200000 |& tee smoke.serial
+   -device virtio-net-pci,netdev=n0 \
+   -netdev user,id=n0,tftp=./ \
+   -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& tee smoke.serial
 
 set -e
 (grep -q "^/ #" smoke.serial) || exit 1
-- 
2.25.1



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

* [PATCH v3 07/10] automation: qemu-alpine-arm64: Cleanup and fixes
  2022-09-27  9:47 [PATCH v3 00/10] GitLab CI cleanup & improvements for Arm Michal Orzel
                   ` (5 preceding siblings ...)
  2022-09-27  9:47 ` [PATCH v3 06/10] automation: qemu-smoke-arm32.sh: Modify script to use ImageBuilder Michal Orzel
@ 2022-09-27  9:47 ` Michal Orzel
  2022-09-27  9:52   ` Luca Fancellu
  2022-09-28  0:29   ` Stefano Stabellini
  2022-09-27  9:47 ` [PATCH v3 08/10] automation: Rename qemu-smoke-arm64.sh to qemu-smoke-dom0less-arm64.sh Michal Orzel
                   ` (2 subsequent siblings)
  9 siblings, 2 replies; 21+ messages in thread
From: Michal Orzel @ 2022-09-27  9:47 UTC (permalink / raw)
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini

Perform the following cleanup:
- rename the device tree from virt-gicv3 to virt-gicv2 as the GIC version
  used in this test is v2,
- use fdtput to perform modifications on the dtb,
- use DEBIAN_FRONTEND=noninteractive to prevent interactive prompt being
  stuck waiting for answer other than "yes",
- fix the number of cpus in the device tree because currently we generate
  it with a single cpu and try to run QEMU with two,
- fix the memory size we pass when generating QEMU device tree as it does
  not match the memory size with what we run QEMU.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v3:
- s/DEBIAN_FRONTENT/DEBIAN_FRONTEND/, drop Ack
Changes in v2:
- none
---
 automation/scripts/qemu-alpine-arm64.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/automation/scripts/qemu-alpine-arm64.sh b/automation/scripts/qemu-alpine-arm64.sh
index f4ac2d856fa0..9004c537e325 100755
--- a/automation/scripts/qemu-alpine-arm64.sh
+++ b/automation/scripts/qemu-alpine-arm64.sh
@@ -2,6 +2,7 @@
 
 set -ex
 
+export DEBIAN_FRONTEND=noninteractive
 apt-get -qy update
 apt-get -qy install --no-install-recommends u-boot-qemu \
                                             u-boot-tools \
@@ -73,18 +74,17 @@ curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
 ./binaries/qemu-system-aarch64 \
    -machine virtualization=true \
    -cpu cortex-a57 -machine type=virt \
-   -m 1024 -display none \
-   -machine dumpdtb=binaries/virt-gicv3.dtb
+   -m 2048 -smp 2 -display none \
+   -machine dumpdtb=binaries/virt-gicv2.dtb
+
 # XXX disable pl061 to avoid Linux crash
-dtc -I dtb -O dts binaries/virt-gicv3.dtb > binaries/virt-gicv3.dts
-sed 's/compatible = "arm,pl061.*/status = "disabled";/g' binaries/virt-gicv3.dts > binaries/virt-gicv3-edited.dts
-dtc -I dts -O dtb binaries/virt-gicv3-edited.dts > binaries/virt-gicv3.dtb
+fdtput binaries/virt-gicv2.dtb -p -t s /pl061@9030000 status disabled
 
 # ImageBuilder
 echo 'MEMORY_START="0x40000000"
-MEMORY_END="0x80000000"
+MEMORY_END="0xC0000000"
 
-DEVICE_TREE="virt-gicv3.dtb"
+DEVICE_TREE="virt-gicv2.dtb"
 XEN="xen"
 DOM0_KERNEL="Image"
 DOM0_RAMDISK="xen-rootfs.cpio.gz"
-- 
2.25.1



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

* [PATCH v3 08/10] automation: Rename qemu-smoke-arm64.sh to qemu-smoke-dom0less-arm64.sh
  2022-09-27  9:47 [PATCH v3 00/10] GitLab CI cleanup & improvements for Arm Michal Orzel
                   ` (6 preceding siblings ...)
  2022-09-27  9:47 ` [PATCH v3 07/10] automation: qemu-alpine-arm64: Cleanup and fixes Michal Orzel
@ 2022-09-27  9:47 ` Michal Orzel
  2022-09-27  9:47 ` [PATCH v3 09/10] automation: Rename qemu-alpine-arm64.sh to qemu-smoke-dom0-arm64.sh Michal Orzel
  2022-09-27  9:47 ` [PATCH v3 10/10] automation: Rename qemu-smoke-arm32.sh to qemu-smoke-dom0-arm32.sh Michal Orzel
  9 siblings, 0 replies; 21+ messages in thread
From: Michal Orzel @ 2022-09-27  9:47 UTC (permalink / raw)
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini

Testing arm64 is done using the qemu-alpine-arm64.sh and
qemu-smoke-arm64.sh scripts. These scripts are executed with exactly
the same artifacts (container, rootfs, kernel, qemu) and the only
difference is that the former is used to perform dom0 based testing
and the latter - dom0less based testing.

Because the current naming is quite ambiguous, rename qemu-smoke-arm64.sh
script to qemu-smoke-dom0less-arm64.sh to reflect its usage.

qemu-alpine-arm64.sh will be renamed in the follow-up patch.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v3:
- commit msg: s/umbiguous/ambiguous/
Changes in v2:
- none
---
 automation/gitlab-ci/test.yaml                | 24 +++++++++----------
 ...-arm64.sh => qemu-smoke-dom0less-arm64.sh} |  0
 2 files changed, 12 insertions(+), 12 deletions(-)
 rename automation/scripts/{qemu-smoke-arm64.sh => qemu-smoke-dom0less-arm64.sh} (100%)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 1b51030c6175..f620622671f8 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -81,12 +81,12 @@ qemu-alpine-x86_64-gcc:
   tags:
     - x86_64
 
-qemu-smoke-arm64-gcc:
+qemu-smoke-dom0less-arm64-gcc:
   extends: .test-jobs-common
   variables:
     CONTAINER: debian:unstable-arm64v8
   script:
-    - ./automation/scripts/qemu-smoke-arm64.sh 2>&1 | tee qemu-smoke-arm64.log
+    - ./automation/scripts/qemu-smoke-dom0less-arm64.sh 2>&1 | tee qemu-smoke-arm64.log
   needs:
     - alpine-3.12-gcc-arm64
     - alpine-3.12-arm64-rootfs-export
@@ -100,12 +100,12 @@ qemu-smoke-arm64-gcc:
   tags:
     - arm64
 
-qemu-smoke-arm64-gcc-debug:
+qemu-smoke-dom0less-arm64-gcc-debug:
   extends: .test-jobs-common
   variables:
     CONTAINER: debian:unstable-arm64v8
   script:
-    - ./automation/scripts/qemu-smoke-arm64.sh 2>&1 | tee qemu-smoke-arm64.log
+    - ./automation/scripts/qemu-smoke-dom0less-arm64.sh 2>&1 | tee qemu-smoke-arm64.log
   needs:
     - alpine-3.12-gcc-debug-arm64
     - alpine-3.12-arm64-rootfs-export
@@ -119,12 +119,12 @@ qemu-smoke-arm64-gcc-debug:
   tags:
     - arm64
 
-qemu-smoke-arm64-gcc-staticmem:
+qemu-smoke-dom0less-arm64-gcc-staticmem:
   extends: .test-jobs-common
   variables:
     CONTAINER: debian:unstable-arm64v8
   script:
-    - ./automation/scripts/qemu-smoke-arm64.sh static-mem 2>&1 | tee qemu-smoke-arm64.log
+    - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-mem 2>&1 | tee qemu-smoke-arm64.log
   needs:
     - alpine-3.12-gcc-arm64-staticmem
     - alpine-3.12-arm64-rootfs-export
@@ -138,12 +138,12 @@ qemu-smoke-arm64-gcc-staticmem:
   tags:
     - arm64
 
-qemu-smoke-arm64-gcc-debug-staticmem:
+qemu-smoke-dom0less-arm64-gcc-debug-staticmem:
   extends: .test-jobs-common
   variables:
     CONTAINER: debian:unstable-arm64v8
   script:
-    - ./automation/scripts/qemu-smoke-arm64.sh static-mem 2>&1 | tee qemu-smoke-arm64.log
+    - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-mem 2>&1 | tee qemu-smoke-arm64.log
   needs:
     - alpine-3.12-gcc-debug-arm64-staticmem
     - alpine-3.12-arm64-rootfs-export
@@ -157,12 +157,12 @@ qemu-smoke-arm64-gcc-debug-staticmem:
   tags:
     - arm64
 
-qemu-smoke-arm64-gcc-boot-cpupools:
+qemu-smoke-dom0less-arm64-gcc-boot-cpupools:
   extends: .test-jobs-common
   variables:
     CONTAINER: debian:unstable-arm64v8
   script:
-    - ./automation/scripts/qemu-smoke-arm64.sh boot-cpupools 2>&1 | tee qemu-smoke-arm64.log
+    - ./automation/scripts/qemu-smoke-dom0less-arm64.sh boot-cpupools 2>&1 | tee qemu-smoke-arm64.log
   needs:
     - alpine-3.12-gcc-arm64-boot-cpupools
     - alpine-3.12-arm64-rootfs-export
@@ -176,12 +176,12 @@ qemu-smoke-arm64-gcc-boot-cpupools:
   tags:
     - arm64
 
-qemu-smoke-arm64-gcc-debug-boot-cpupools:
+qemu-smoke-dom0less-arm64-gcc-debug-boot-cpupools:
   extends: .test-jobs-common
   variables:
     CONTAINER: debian:unstable-arm64v8
   script:
-    - ./automation/scripts/qemu-smoke-arm64.sh boot-cpupools 2>&1 | tee qemu-smoke-arm64.log
+    - ./automation/scripts/qemu-smoke-dom0less-arm64.sh boot-cpupools 2>&1 | tee qemu-smoke-arm64.log
   needs:
     - alpine-3.12-gcc-debug-arm64-boot-cpupools
     - alpine-3.12-arm64-rootfs-export
diff --git a/automation/scripts/qemu-smoke-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
similarity index 100%
rename from automation/scripts/qemu-smoke-arm64.sh
rename to automation/scripts/qemu-smoke-dom0less-arm64.sh
-- 
2.25.1



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

* [PATCH v3 09/10] automation: Rename qemu-alpine-arm64.sh to qemu-smoke-dom0-arm64.sh
  2022-09-27  9:47 [PATCH v3 00/10] GitLab CI cleanup & improvements for Arm Michal Orzel
                   ` (7 preceding siblings ...)
  2022-09-27  9:47 ` [PATCH v3 08/10] automation: Rename qemu-smoke-arm64.sh to qemu-smoke-dom0less-arm64.sh Michal Orzel
@ 2022-09-27  9:47 ` Michal Orzel
  2022-09-27  9:47 ` [PATCH v3 10/10] automation: Rename qemu-smoke-arm32.sh to qemu-smoke-dom0-arm32.sh Michal Orzel
  9 siblings, 0 replies; 21+ messages in thread
From: Michal Orzel @ 2022-09-27  9:47 UTC (permalink / raw)
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini

qemu-alpine-arm64.sh script is used to perform dom0 based testing.
Rename this script to qemu-smoke-dom0-arm64.sh to reflect its usage.
Also rename the corresponding test jobs.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v3:
- none
Changes in v2:
- none
---
 automation/gitlab-ci/test.yaml                            | 8 ++++----
 .../{qemu-alpine-arm64.sh => qemu-smoke-dom0-arm64.sh}    | 0
 2 files changed, 4 insertions(+), 4 deletions(-)
 rename automation/scripts/{qemu-alpine-arm64.sh => qemu-smoke-dom0-arm64.sh} (100%)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index f620622671f8..3b147c88ab08 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -25,12 +25,12 @@ build-each-commit-gcc:
   tags:
     - x86_64
 
-qemu-alpine-arm64-gcc:
+qemu-smoke-dom0-arm64-gcc:
   extends: .test-jobs-common
   variables:
     CONTAINER: debian:unstable-arm64v8
   script:
-    - ./automation/scripts/qemu-alpine-arm64.sh 2>&1 | tee qemu-smoke-arm64.log
+    - ./automation/scripts/qemu-smoke-dom0-arm64.sh 2>&1 | tee qemu-smoke-arm64.log
   needs:
     - alpine-3.12-gcc-arm64
     - alpine-3.12-arm64-rootfs-export
@@ -44,12 +44,12 @@ qemu-alpine-arm64-gcc:
   tags:
     - arm64
 
-qemu-alpine-arm64-gcc-debug:
+qemu-smoke-dom0-arm64-gcc-debug:
   extends: .test-jobs-common
   variables:
     CONTAINER: debian:unstable-arm64v8
   script:
-    - ./automation/scripts/qemu-alpine-arm64.sh 2>&1 | tee qemu-smoke-arm64.log
+    - ./automation/scripts/qemu-smoke-dom0-arm64.sh 2>&1 | tee qemu-smoke-arm64.log
   needs:
     - alpine-3.12-gcc-debug-arm64
     - alpine-3.12-arm64-rootfs-export
diff --git a/automation/scripts/qemu-alpine-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
similarity index 100%
rename from automation/scripts/qemu-alpine-arm64.sh
rename to automation/scripts/qemu-smoke-dom0-arm64.sh
-- 
2.25.1



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

* [PATCH v3 10/10] automation: Rename qemu-smoke-arm32.sh to qemu-smoke-dom0-arm32.sh
  2022-09-27  9:47 [PATCH v3 00/10] GitLab CI cleanup & improvements for Arm Michal Orzel
                   ` (8 preceding siblings ...)
  2022-09-27  9:47 ` [PATCH v3 09/10] automation: Rename qemu-alpine-arm64.sh to qemu-smoke-dom0-arm64.sh Michal Orzel
@ 2022-09-27  9:47 ` Michal Orzel
  9 siblings, 0 replies; 21+ messages in thread
From: Michal Orzel @ 2022-09-27  9:47 UTC (permalink / raw)
  To: xen-devel; +Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini

After qemu arm64 test scripts had been renamed to reflect their
usage, do the same for the qemu arm32 test script. Currently it only
boots dom0, so we can assume that this script will be used to perform
dom0 based testing. In the future we will be able to create corresponding
script qemu-smoke-dom0less-arm32.sh to perform dom0less based testing.
This is the last step to get rid of ambiguity with regards to naming
of Arm test scripts.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes in v3:
- none
Changes in v2:
- none
---
 automation/gitlab-ci/test.yaml                            | 8 ++++----
 .../{qemu-smoke-arm32.sh => qemu-smoke-dom0-arm32.sh}     | 0
 2 files changed, 4 insertions(+), 4 deletions(-)
 rename automation/scripts/{qemu-smoke-arm32.sh => qemu-smoke-dom0-arm32.sh} (100%)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 3b147c88ab08..92e0a1f7c510 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -195,12 +195,12 @@ qemu-smoke-dom0less-arm64-gcc-debug-boot-cpupools:
   tags:
     - arm64
 
-qemu-smoke-arm32-gcc:
+qemu-smoke-dom0-arm32-gcc:
   extends: .test-jobs-common
   variables:
     CONTAINER: debian:unstable-arm64v8
   script:
-    - ./automation/scripts/qemu-smoke-arm32.sh 2>&1 | tee qemu-smoke-arm32.log
+    - ./automation/scripts/qemu-smoke-dom0-arm32.sh 2>&1 | tee qemu-smoke-arm32.log
   needs:
     - debian-unstable-gcc-arm32
     - qemu-system-aarch64-6.0.0-arm32-export
@@ -212,12 +212,12 @@ qemu-smoke-arm32-gcc:
   tags:
     - arm64
 
-qemu-smoke-arm32-gcc-debug:
+qemu-smoke-dom0-arm32-gcc-debug:
   extends: .test-jobs-common
   variables:
     CONTAINER: debian:unstable-arm64v8
   script:
-    - ./automation/scripts/qemu-smoke-arm32.sh 2>&1 | tee qemu-smoke-arm32.log
+    - ./automation/scripts/qemu-smoke-dom0-arm32.sh 2>&1 | tee qemu-smoke-arm32.log
   needs:
     - debian-unstable-gcc-arm32-debug
     - qemu-system-aarch64-6.0.0-arm32-export
diff --git a/automation/scripts/qemu-smoke-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
similarity index 100%
rename from automation/scripts/qemu-smoke-arm32.sh
rename to automation/scripts/qemu-smoke-dom0-arm32.sh
-- 
2.25.1



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

* RE: [for-4.17,PATCH v3 01/10] automation: qemu-smoke-arm{32/64}.sh: Fix typo in DEBIAN_FRONTENT
  2022-09-27  9:47 ` [for-4.17,PATCH v3 01/10] automation: qemu-smoke-arm{32/64}.sh: Fix typo in DEBIAN_FRONTENT Michal Orzel
@ 2022-09-27  9:51   ` Henry Wang
  2022-09-27  9:54   ` Luca Fancellu
  2022-09-28  0:29   ` Stefano Stabellini
  2 siblings, 0 replies; 21+ messages in thread
From: Henry Wang @ 2022-09-27  9:51 UTC (permalink / raw)
  To: Michal Orzel, xen-devel; +Cc: Doug Goldstein, Stefano Stabellini

Hi Michal,

> -----Original Message-----
> From: Michal Orzel <michal.orzel@amd.com>
> Subject: [for-4.17,PATCH v3 01/10] automation: qemu-smoke-arm{32/64}.sh:
> Fix typo in DEBIAN_FRONTENT
> 
> The correct variable name is DEBIAN_FRONTEND and not DEBIAN_FRONTENT.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> ---
> CC: Henry Wang <Henry.Wang@arm.com>
> 
> Rationale for taking this patch for 4.17:
> Setting DEBIAN_FRONTEND to noninteractive menas that we need zero
> interaction
> while installing/upgrading the system via apt-get. It accepts the default
> answer to all the questions (using apt-get -y only works for "yes"/"no"
> prompts). With the typo not fixed, we might get stuck in CI jobs.
> The risk is very low as we perform pre-push testing using GitLab CI to make
> sure the changes will not break the pipeline.

I have no objection to take this patch for 4.17, so as long as you have the
R-b or ack from CI maintainers, you can have my release ack.

Kind regards,
Henry


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

* Re: [PATCH v3 07/10] automation: qemu-alpine-arm64: Cleanup and fixes
  2022-09-27  9:47 ` [PATCH v3 07/10] automation: qemu-alpine-arm64: Cleanup and fixes Michal Orzel
@ 2022-09-27  9:52   ` Luca Fancellu
  2022-09-28  0:29   ` Stefano Stabellini
  1 sibling, 0 replies; 21+ messages in thread
From: Luca Fancellu @ 2022-09-27  9:52 UTC (permalink / raw)
  To: Michal Orzel; +Cc: Xen-devel, Doug Goldstein, Stefano Stabellini



> On 27 Sep 2022, at 10:47, Michal Orzel <michal.orzel@amd.com> wrote:
> 
> Perform the following cleanup:
> - rename the device tree from virt-gicv3 to virt-gicv2 as the GIC version
>  used in this test is v2,
> - use fdtput to perform modifications on the dtb,
> - use DEBIAN_FRONTEND=noninteractive to prevent interactive prompt being
>  stuck waiting for answer other than "yes",
> - fix the number of cpus in the device tree because currently we generate
>  it with a single cpu and try to run QEMU with two,
> - fix the memory size we pass when generating QEMU device tree as it does
>  not match the memory size with what we run QEMU.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> ---
> Changes in v3:
> - s/DEBIAN_FRONTENT/DEBIAN_FRONTEND/, drop Ack
> Changes in v2:
> - none
> ---

Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>





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

* Re: [for-4.17,PATCH v3 01/10] automation: qemu-smoke-arm{32/64}.sh: Fix typo in DEBIAN_FRONTENT
  2022-09-27  9:47 ` [for-4.17,PATCH v3 01/10] automation: qemu-smoke-arm{32/64}.sh: Fix typo in DEBIAN_FRONTENT Michal Orzel
  2022-09-27  9:51   ` Henry Wang
@ 2022-09-27  9:54   ` Luca Fancellu
  2022-09-28  0:29   ` Stefano Stabellini
  2 siblings, 0 replies; 21+ messages in thread
From: Luca Fancellu @ 2022-09-27  9:54 UTC (permalink / raw)
  To: Michal Orzel; +Cc: Xen-devel, Doug Goldstein, Stefano Stabellini, Henry Wang



> On 27 Sep 2022, at 10:47, Michal Orzel <michal.orzel@amd.com> wrote:
> 
> The correct variable name is DEBIAN_FRONTEND and not DEBIAN_FRONTENT.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> ---
> CC: Henry Wang <Henry.Wang@arm.com>
> 
> Rationale for taking this patch for 4.17:
> Setting DEBIAN_FRONTEND to noninteractive menas that we need zero interaction
> while installing/upgrading the system via apt-get. It accepts the default
> answer to all the questions (using apt-get -y only works for "yes"/"no"
> prompts). With the typo not fixed, we might get stuck in CI jobs.
> The risk is very low as we perform pre-push testing using GitLab CI to make
> sure the changes will not break the pipeline.
> 
> Changes in v3:
> - new patch
> ---

Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>





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

* Re: [for-4.17,PATCH v3 01/10] automation: qemu-smoke-arm{32/64}.sh: Fix typo in DEBIAN_FRONTENT
  2022-09-27  9:47 ` [for-4.17,PATCH v3 01/10] automation: qemu-smoke-arm{32/64}.sh: Fix typo in DEBIAN_FRONTENT Michal Orzel
  2022-09-27  9:51   ` Henry Wang
  2022-09-27  9:54   ` Luca Fancellu
@ 2022-09-28  0:29   ` Stefano Stabellini
  2 siblings, 0 replies; 21+ messages in thread
From: Stefano Stabellini @ 2022-09-28  0:29 UTC (permalink / raw)
  To: Michal Orzel; +Cc: xen-devel, Doug Goldstein, Stefano Stabellini, Henry Wang

On Tue, 27 Sep 2022, Michal Orzel wrote:
> The correct variable name is DEBIAN_FRONTEND and not DEBIAN_FRONTENT.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

and committed

> ---
> CC: Henry Wang <Henry.Wang@arm.com>
> 
> Rationale for taking this patch for 4.17:
> Setting DEBIAN_FRONTEND to noninteractive menas that we need zero interaction
> while installing/upgrading the system via apt-get. It accepts the default
> answer to all the questions (using apt-get -y only works for "yes"/"no"
> prompts). With the typo not fixed, we might get stuck in CI jobs.
> The risk is very low as we perform pre-push testing using GitLab CI to make
> sure the changes will not break the pipeline.
> 
> Changes in v3:
> - new patch
> ---
>  automation/scripts/qemu-smoke-arm32.sh | 2 +-
>  automation/scripts/qemu-smoke-arm64.sh | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/automation/scripts/qemu-smoke-arm32.sh b/automation/scripts/qemu-smoke-arm32.sh
> index 530f3892fdd3..c8ae0bfb9b1c 100755
> --- a/automation/scripts/qemu-smoke-arm32.sh
> +++ b/automation/scripts/qemu-smoke-arm32.sh
> @@ -2,7 +2,7 @@
>  
>  set -ex
>  
> -export DEBIAN_FRONTENT=noninteractive
> +export DEBIAN_FRONTEND=noninteractive
>  apt-get -qy update
>  apt-get -qy install --no-install-recommends device-tree-compiler \
>                                              curl \
> diff --git a/automation/scripts/qemu-smoke-arm64.sh b/automation/scripts/qemu-smoke-arm64.sh
> index f803835779f4..5b566072f72a 100755
> --- a/automation/scripts/qemu-smoke-arm64.sh
> +++ b/automation/scripts/qemu-smoke-arm64.sh
> @@ -38,7 +38,7 @@ fi
>  "
>  fi
>  
> -export DEBIAN_FRONTENT=noninteractive
> +export DEBIAN_FRONTEND=noninteractive
>  apt-get -qy update
>  apt-get -qy install --no-install-recommends u-boot-qemu \
>                                              u-boot-tools \
> -- 
> 2.25.1
> 


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

* Re: [PATCH v3 07/10] automation: qemu-alpine-arm64: Cleanup and fixes
  2022-09-27  9:47 ` [PATCH v3 07/10] automation: qemu-alpine-arm64: Cleanup and fixes Michal Orzel
  2022-09-27  9:52   ` Luca Fancellu
@ 2022-09-28  0:29   ` Stefano Stabellini
  1 sibling, 0 replies; 21+ messages in thread
From: Stefano Stabellini @ 2022-09-28  0:29 UTC (permalink / raw)
  To: Michal Orzel; +Cc: xen-devel, Doug Goldstein, Stefano Stabellini

On Tue, 27 Sep 2022, Michal Orzel wrote:
> Perform the following cleanup:
> - rename the device tree from virt-gicv3 to virt-gicv2 as the GIC version
>   used in this test is v2,
> - use fdtput to perform modifications on the dtb,
> - use DEBIAN_FRONTEND=noninteractive to prevent interactive prompt being
>   stuck waiting for answer other than "yes",
> - fix the number of cpus in the device tree because currently we generate
>   it with a single cpu and try to run QEMU with two,
> - fix the memory size we pass when generating QEMU device tree as it does
>   not match the memory size with what we run QEMU.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

I pushed patches 2-10 to a "next" branch on my personal gitlab with the
intention of merging it back as soon as staging reopens:

https://gitlab.com/xen-project/people/sstabellini/xen



> ---
> Changes in v3:
> - s/DEBIAN_FRONTENT/DEBIAN_FRONTEND/, drop Ack
> Changes in v2:
> - none
> ---
>  automation/scripts/qemu-alpine-arm64.sh | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/automation/scripts/qemu-alpine-arm64.sh b/automation/scripts/qemu-alpine-arm64.sh
> index f4ac2d856fa0..9004c537e325 100755
> --- a/automation/scripts/qemu-alpine-arm64.sh
> +++ b/automation/scripts/qemu-alpine-arm64.sh
> @@ -2,6 +2,7 @@
>  
>  set -ex
>  
> +export DEBIAN_FRONTEND=noninteractive
>  apt-get -qy update
>  apt-get -qy install --no-install-recommends u-boot-qemu \
>                                              u-boot-tools \
> @@ -73,18 +74,17 @@ curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
>  ./binaries/qemu-system-aarch64 \
>     -machine virtualization=true \
>     -cpu cortex-a57 -machine type=virt \
> -   -m 1024 -display none \
> -   -machine dumpdtb=binaries/virt-gicv3.dtb
> +   -m 2048 -smp 2 -display none \
> +   -machine dumpdtb=binaries/virt-gicv2.dtb
> +
>  # XXX disable pl061 to avoid Linux crash
> -dtc -I dtb -O dts binaries/virt-gicv3.dtb > binaries/virt-gicv3.dts
> -sed 's/compatible = "arm,pl061.*/status = "disabled";/g' binaries/virt-gicv3.dts > binaries/virt-gicv3-edited.dts
> -dtc -I dts -O dtb binaries/virt-gicv3-edited.dts > binaries/virt-gicv3.dtb
> +fdtput binaries/virt-gicv2.dtb -p -t s /pl061@9030000 status disabled
>  
>  # ImageBuilder
>  echo 'MEMORY_START="0x40000000"
> -MEMORY_END="0x80000000"
> +MEMORY_END="0xC0000000"
>  
> -DEVICE_TREE="virt-gicv3.dtb"
> +DEVICE_TREE="virt-gicv2.dtb"
>  XEN="xen"
>  DOM0_KERNEL="Image"
>  DOM0_RAMDISK="xen-rootfs.cpio.gz"
> -- 
> 2.25.1
> 


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

* RE: [PATCH v3 05/10] automation: Add Arm containers to containerize script
  2022-09-27  9:47 ` [PATCH v3 05/10] automation: Add Arm containers to containerize script Michal Orzel
@ 2022-10-20  3:00   ` Jiamei Xie
  2022-10-20  6:59     ` Michal Orzel
  0 siblings, 1 reply; 21+ messages in thread
From: Jiamei Xie @ 2022-10-20  3:00 UTC (permalink / raw)
  To: Michal Orzel, xen-devel; +Cc: Doug Goldstein, Stefano Stabellini

Hi Michal,

> -----Original Message-----
> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> On Behalf Of
> Michal Orzel
> Sent: Tuesday, September 27, 2022 5:47 PM
> To: xen-devel@lists.xenproject.org
> Cc: Michal Orzel <michal.orzel@amd.com>; Doug Goldstein
> <cardoe@cardoe.com>; Stefano Stabellini <sstabellini@kernel.org>
> Subject: [PATCH v3 05/10] automation: Add Arm containers to containerize
> script
> 
> Script automation/scripts/containerize makes it easy to build Xen within
> predefined containers from gitlab container registry. This script is
> currently missing the helpers to select Arm containers, so populate the
> necessary entries.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
> ---
> Changes in v3:
> - none
> Changes in v2:
> - modify commit msg to reflect that we are missing helpers but in reality
>   it could be possible to use Arm containers by specifying the full path
>   to gitlab container registry. However, such usage is annoying.
> ---
>  automation/scripts/containerize | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/automation/scripts/containerize
> b/automation/scripts/containerize
> index 9d4beca4fa4b..0f4645c4cccb 100755
> --- a/automation/scripts/containerize
> +++ b/automation/scripts/containerize
> @@ -25,6 +25,7 @@ die() {
>  BASE="registry.gitlab.com/xen-project/xen"
>  case "_${CONTAINER}" in
>      _alpine) CONTAINER="${BASE}/alpine:3.12" ;;
> +    _alpine-arm64v8) CONTAINER="${BASE}/alpine:3.12-arm64v8" ;;
>      _archlinux|_arch) CONTAINER="${BASE}/archlinux:current" ;;
>      _riscv64) CONTAINER="${BASE}/archlinux:riscv64" ;;
>      _centos7) CONTAINER="${BASE}/centos:7" ;;
> @@ -35,6 +36,8 @@ case "_${CONTAINER}" in
>      _stretch|_) CONTAINER="${BASE}/debian:stretch" ;;
>      _buster-gcc-ibt) CONTAINER="${BASE}/debian:buster-gcc-ibt" ;;
>      _unstable|_) CONTAINER="${BASE}/debian:unstable" ;;
> +    _unstable-arm32-gcc) CONTAINER="${BASE}/debian:unstable-arm32-
> gcc" ;;
> +    _unstable-arm64v8) CONTAINER="${BASE}/debian:unstable-arm64v8" ;;
>      _trusty) CONTAINER="${BASE}/ubuntu:trusty" ;;
>      _xenial) CONTAINER="${BASE}/ubuntu:xenial" ;;
>      _opensuse-leap|_leap) CONTAINER="${BASE}/suse:opensuse-leap" ;;
> --
> 2.25.1

[Jiamei Xie] 
I wonder if an default container for arm can be added. For example,  if 
 "CONTAINER=arm64 automation/scripts/containerize bash", 
 set the default CONTAINER as "registry.gitlab.com/xen-project/xen/alpine:3.12-arm64v8"

Best wishes
Jiamei Xie




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

* Re: [PATCH v3 05/10] automation: Add Arm containers to containerize script
  2022-10-20  3:00   ` Jiamei Xie
@ 2022-10-20  6:59     ` Michal Orzel
  2022-10-20  7:13       ` Jiamei Xie
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Orzel @ 2022-10-20  6:59 UTC (permalink / raw)
  To: Jiamei Xie, xen-devel; +Cc: Doug Goldstein, Stefano Stabellini

Hi Jiamei,

On 20/10/2022 05:00, Jiamei Xie wrote:
> 
> 
> Hi Michal,
> 
>> -----Original Message-----
>> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> On Behalf Of
>> Michal Orzel
>> Sent: Tuesday, September 27, 2022 5:47 PM
>> To: xen-devel@lists.xenproject.org
>> Cc: Michal Orzel <michal.orzel@amd.com>; Doug Goldstein
>> <cardoe@cardoe.com>; Stefano Stabellini <sstabellini@kernel.org>
>> Subject: [PATCH v3 05/10] automation: Add Arm containers to containerize
>> script
>>
>> Script automation/scripts/containerize makes it easy to build Xen within
>> predefined containers from gitlab container registry. This script is
>> currently missing the helpers to select Arm containers, so populate the
>> necessary entries.
>>
>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
>> ---

> 
> [Jiamei Xie]
> I wonder if an default container for arm can be added. For example,  if
>  "CONTAINER=arm64 automation/scripts/containerize bash",
>  set the default CONTAINER as "registry.gitlab.com/xen-project/xen/alpine:3.12-arm64v8"
> 

It can be added doing the following:

diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index 0f4645c4cccb..b395bd359ecf 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -25,7 +25,7 @@ die() {
 BASE="registry.gitlab.com/xen-project/xen"
 case "_${CONTAINER}" in
     _alpine) CONTAINER="${BASE}/alpine:3.12" ;;
-    _alpine-arm64v8) CONTAINER="${BASE}/alpine:3.12-arm64v8" ;;
+    _alpine-arm64v8|_arm64) CONTAINER="${BASE}/alpine:3.12-arm64v8" ;;
     _archlinux|_arch) CONTAINER="${BASE}/archlinux:current" ;;
     _riscv64) CONTAINER="${BASE}/archlinux:riscv64" ;;
     _centos7) CONTAINER="${BASE}/centos:7" ;;

The question is whether it would be beneficial. After all you would still need to
type CONTAINER=arm64, whereas at the moment, you need to type CONTAINER=alpine-arm64v8.
TBH I'm not sure it is improving anything (?).

~Michal


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

* RE: [PATCH v3 05/10] automation: Add Arm containers to containerize script
  2022-10-20  6:59     ` Michal Orzel
@ 2022-10-20  7:13       ` Jiamei Xie
  2022-10-20  7:51         ` Michal Orzel
  0 siblings, 1 reply; 21+ messages in thread
From: Jiamei Xie @ 2022-10-20  7:13 UTC (permalink / raw)
  To: Michal Orzel, xen-devel; +Cc: Doug Goldstein, Stefano Stabellini

Hi Michal,

> -----Original Message-----
> From: Michal Orzel <michal.orzel@amd.com>
> Sent: Thursday, October 20, 2022 2:59 PM
> To: Jiamei Xie <Jiamei.Xie@arm.com>; xen-devel@lists.xenproject.org
> Cc: Doug Goldstein <cardoe@cardoe.com>; Stefano Stabellini
> <sstabellini@kernel.org>
> Subject: Re: [PATCH v3 05/10] automation: Add Arm containers to
> containerize script
> 
> Hi Jiamei,
> 
> On 20/10/2022 05:00, Jiamei Xie wrote:
> >
> >
> > Hi Michal,
> >
> >> -----Original Message-----
> >> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> On Behalf Of
> >> Michal Orzel
> >> Sent: Tuesday, September 27, 2022 5:47 PM
> >> To: xen-devel@lists.xenproject.org
> >> Cc: Michal Orzel <michal.orzel@amd.com>; Doug Goldstein
> >> <cardoe@cardoe.com>; Stefano Stabellini <sstabellini@kernel.org>
> >> Subject: [PATCH v3 05/10] automation: Add Arm containers to
> containerize
> >> script
> >>
> >> Script automation/scripts/containerize makes it easy to build Xen within
> >> predefined containers from gitlab container registry. This script is
> >> currently missing the helpers to select Arm containers, so populate the
> >> necessary entries.
> >>
> >> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> >> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
> >> ---
> 
> >
> > [Jiamei Xie]
> > I wonder if an default container for arm can be added. For example,  if
> >  "CONTAINER=arm64 automation/scripts/containerize bash",
> >  set the default CONTAINER as "registry.gitlab.com/xen-
> project/xen/alpine:3.12-arm64v8"
> >
> 
> It can be added doing the following:
> 
> diff --git a/automation/scripts/containerize
> b/automation/scripts/containerize
> index 0f4645c4cccb..b395bd359ecf 100755
> --- a/automation/scripts/containerize
> +++ b/automation/scripts/containerize
> @@ -25,7 +25,7 @@ die() {
>  BASE="registry.gitlab.com/xen-project/xen"
>  case "_${CONTAINER}" in
>      _alpine) CONTAINER="${BASE}/alpine:3.12" ;;
> -    _alpine-arm64v8) CONTAINER="${BASE}/alpine:3.12-arm64v8" ;;
> +    _alpine-arm64v8|_arm64) CONTAINER="${BASE}/alpine:3.12-arm64v8" ;;
>      _archlinux|_arch) CONTAINER="${BASE}/archlinux:current" ;;
>      _riscv64) CONTAINER="${BASE}/archlinux:riscv64" ;;
>      _centos7) CONTAINER="${BASE}/centos:7" ;;
> 
> The question is whether it would be beneficial. After all you would still need
> to
> type CONTAINER=arm64, whereas at the moment, you need to type
> CONTAINER=alpine-arm64v8.
> TBH I'm not sure it is improving anything (?).
> 
> ~Michal
[Jiamei Xie] 
I am not sure about this either.  I added something like below f to run it on arm64 machine.   But it  didn't take "running container for a different architecture" into consideration.

--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -18,6 +18,12 @@ die() {
     exit 1
 }

+# There are two containers that can run on aarch64, unstable and alpine.
+# Set the default container to alpine for aarch64
+if [[ $(uname -m) = "aarch64" && -z ${CONTAINER} ]]; then
+    CONTAINER="alpine"
+fi
+
 #
 # The caller is expected to override the CONTAINER environment
 # variable with the container they wish to launch.
@@ -41,6 +47,11 @@ case "_${CONTAINER}" in
     _opensuse-tumbleweed|_tumbleweed) CONTAINER="${BASE}/suse:opensuse-tumbleweed" ;;
 esac

+# Containers for aarch64 have a sufix "-arm64v8"
+if [[ $(uname -m) = "aarch64" ]]; then
+    CONTAINER="${CONTAINER}-arm64v8"
+fi
+
 # Use this variable to control whether root should be used
 case "_${CONTAINER_UID0}" in
     _1)   userarg= ;;


Best wishes
Jiamei Xie



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

* Re: [PATCH v3 05/10] automation: Add Arm containers to containerize script
  2022-10-20  7:13       ` Jiamei Xie
@ 2022-10-20  7:51         ` Michal Orzel
  2022-10-20  8:03           ` Jiamei Xie
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Orzel @ 2022-10-20  7:51 UTC (permalink / raw)
  To: Jiamei Xie, xen-devel; +Cc: Doug Goldstein, Stefano Stabellini

Hi Jiamei,

On 20/10/2022 09:13, Jiamei Xie wrote:
> 
> 
> Hi Michal,
> 
>> -----Original Message-----
>> From: Michal Orzel <michal.orzel@amd.com>
>> Sent: Thursday, October 20, 2022 2:59 PM
>> To: Jiamei Xie <Jiamei.Xie@arm.com>; xen-devel@lists.xenproject.org
>> Cc: Doug Goldstein <cardoe@cardoe.com>; Stefano Stabellini
>> <sstabellini@kernel.org>
>> Subject: Re: [PATCH v3 05/10] automation: Add Arm containers to
>> containerize script
>>
>> Hi Jiamei,
>>
>> On 20/10/2022 05:00, Jiamei Xie wrote:
>>>
>>>
>>> Hi Michal,
>>>
>>>> -----Original Message-----
>>>> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> On Behalf Of
>>>> Michal Orzel
>>>> Sent: Tuesday, September 27, 2022 5:47 PM
>>>> To: xen-devel@lists.xenproject.org
>>>> Cc: Michal Orzel <michal.orzel@amd.com>; Doug Goldstein
>>>> <cardoe@cardoe.com>; Stefano Stabellini <sstabellini@kernel.org>
>>>> Subject: [PATCH v3 05/10] automation: Add Arm containers to
>> containerize
>>>> script
>>>>
>>>> Script automation/scripts/containerize makes it easy to build Xen within
>>>> predefined containers from gitlab container registry. This script is
>>>> currently missing the helpers to select Arm containers, so populate the
>>>> necessary entries.
>>>>
>>>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>>>> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
>>>> ---
>>
>>>
>>> [Jiamei Xie]
>>> I wonder if an default container for arm can be added. For example,  if
>>>  "CONTAINER=arm64 automation/scripts/containerize bash",
>>>  set the default CONTAINER as "registry.gitlab.com/xen-
>> project/xen/alpine:3.12-arm64v8"
>>>
>>
>> It can be added doing the following:
>>
>> diff --git a/automation/scripts/containerize
>> b/automation/scripts/containerize
>> index 0f4645c4cccb..b395bd359ecf 100755
>> --- a/automation/scripts/containerize
>> +++ b/automation/scripts/containerize
>> @@ -25,7 +25,7 @@ die() {
>>  BASE="registry.gitlab.com/xen-project/xen"
>>  case "_${CONTAINER}" in
>>      _alpine) CONTAINER="${BASE}/alpine:3.12" ;;
>> -    _alpine-arm64v8) CONTAINER="${BASE}/alpine:3.12-arm64v8" ;;
>> +    _alpine-arm64v8|_arm64) CONTAINER="${BASE}/alpine:3.12-arm64v8" ;;
>>      _archlinux|_arch) CONTAINER="${BASE}/archlinux:current" ;;
>>      _riscv64) CONTAINER="${BASE}/archlinux:riscv64" ;;
>>      _centos7) CONTAINER="${BASE}/centos:7" ;;
>>
>> The question is whether it would be beneficial. After all you would still need
>> to
>> type CONTAINER=arm64, whereas at the moment, you need to type
>> CONTAINER=alpine-arm64v8.
>> TBH I'm not sure it is improving anything (?).
>>
>> ~Michal
> [Jiamei Xie]
> I am not sure about this either.  I added something like below f to run it on arm64 machine.   But it  didn't take "running container for a different architecture" into consideration.
> 
So your question is not about adding default container when selecting CONTAINER=arm64, but adding
a default one when running on arm64 platform. Right now, the default one is debian:stretch
(if you don't type CONTAINER= at all). Do I understand it right that you would like the same
behavior when running on arm64 platform (currently, it would also select debian:stretch)?
So that when executing:
./automation/scripts/containerize ...
it would automatically select alpine-arm64v8?


> --- a/automation/scripts/containerize
> +++ b/automation/scripts/containerize
> @@ -18,6 +18,12 @@ die() {
>      exit 1
>  }
> 
> +# There are two containers that can run on aarch64, unstable and alpine.
> +# Set the default container to alpine for aarch64
> +if [[ $(uname -m) = "aarch64" && -z ${CONTAINER} ]]; then
The output from `uname -m` for arm64 can be aarch64 and arm64.

> +    CONTAINER="alpine"
> +fi
> +
>  #
>  # The caller is expected to override the CONTAINER environment
>  # variable with the container they wish to launch.
> @@ -41,6 +47,11 @@ case "_${CONTAINER}" in
>      _opensuse-tumbleweed|_tumbleweed) CONTAINER="${BASE}/suse:opensuse-tumbleweed" ;;
>  esac
> 
> +# Containers for aarch64 have a sufix "-arm64v8"
> +if [[ $(uname -m) = "aarch64" ]]; then
> +    CONTAINER="${CONTAINER}-arm64v8"
> +fi
This is not needed. CONTAINER can be selected on the first check and let case/esac block
to determine the full path to container.

> +
>  # Use this variable to control whether root should be used
>  case "_${CONTAINER_UID0}" in
>      _1)   userarg= ;;
> 
> 
> Best wishes
> Jiamei Xie
> 
> 

What you are asking for can be done in a simpler way. The following is enough:

diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index 0f4645c4cccb..4e7e8bb48e3a 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -18,6 +18,11 @@ die() {
     exit 1
 }
 
+# Select default container when running on arm64 machine.
+if [ -z "${CONTAINER}" ] && uname -m | grep -qE 'aarch64|arm64'; then
+    CONTAINER="alpine-arm64v8"
+fi
+
 #
 # The caller is expected to override the CONTAINER environment
 # variable with the container they wish to launch.

~Michal


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

* RE: [PATCH v3 05/10] automation: Add Arm containers to containerize script
  2022-10-20  7:51         ` Michal Orzel
@ 2022-10-20  8:03           ` Jiamei Xie
  0 siblings, 0 replies; 21+ messages in thread
From: Jiamei Xie @ 2022-10-20  8:03 UTC (permalink / raw)
  To: Michal Orzel, xen-devel; +Cc: Doug Goldstein, Stefano Stabellini

Hi Michal,

> -----Original Message-----
> From: Michal Orzel <michal.orzel@amd.com>
> Sent: Thursday, October 20, 2022 3:52 PM
> To: Jiamei Xie <Jiamei.Xie@arm.com>; xen-devel@lists.xenproject.org
> Cc: Doug Goldstein <cardoe@cardoe.com>; Stefano Stabellini
> <sstabellini@kernel.org>
> Subject: Re: [PATCH v3 05/10] automation: Add Arm containers to
> containerize script
> 
> Hi Jiamei,
> 
> On 20/10/2022 09:13, Jiamei Xie wrote:
> >
> >
> > Hi Michal,
> >
> >> -----Original Message-----
> >> From: Michal Orzel <michal.orzel@amd.com>
> >> Sent: Thursday, October 20, 2022 2:59 PM
> >> To: Jiamei Xie <Jiamei.Xie@arm.com>; xen-devel@lists.xenproject.org
> >> Cc: Doug Goldstein <cardoe@cardoe.com>; Stefano Stabellini
> >> <sstabellini@kernel.org>
> >> Subject: Re: [PATCH v3 05/10] automation: Add Arm containers to
> >> containerize script
> >>
> >> Hi Jiamei,
> >>
> >> On 20/10/2022 05:00, Jiamei Xie wrote:
> >>>
> >>>
> >>> Hi Michal,
> >>>
> >>>> -----Original Message-----
> >>>> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> On Behalf
> Of
> >>>> Michal Orzel
> >>>> Sent: Tuesday, September 27, 2022 5:47 PM
> >>>> To: xen-devel@lists.xenproject.org
> >>>> Cc: Michal Orzel <michal.orzel@amd.com>; Doug Goldstein
> >>>> <cardoe@cardoe.com>; Stefano Stabellini <sstabellini@kernel.org>
> >>>> Subject: [PATCH v3 05/10] automation: Add Arm containers to
> >> containerize
> >>>> script
> >>>>
> >>>> Script automation/scripts/containerize makes it easy to build Xen
> within
> >>>> predefined containers from gitlab container registry. This script is
> >>>> currently missing the helpers to select Arm containers, so populate the
> >>>> necessary entries.
> >>>>
> >>>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> >>>> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
> >>>> ---
> >>
> >>>
> >>> [Jiamei Xie]
> >>> I wonder if an default container for arm can be added. For example,  if
> >>>  "CONTAINER=arm64 automation/scripts/containerize bash",
> >>>  set the default CONTAINER as "registry.gitlab.com/xen-
> >> project/xen/alpine:3.12-arm64v8"
> >>>
> >>
> >> It can be added doing the following:
> >>
> >> diff --git a/automation/scripts/containerize
> >> b/automation/scripts/containerize
> >> index 0f4645c4cccb..b395bd359ecf 100755
> >> --- a/automation/scripts/containerize
> >> +++ b/automation/scripts/containerize
> >> @@ -25,7 +25,7 @@ die() {
> >>  BASE="registry.gitlab.com/xen-project/xen"
> >>  case "_${CONTAINER}" in
> >>      _alpine) CONTAINER="${BASE}/alpine:3.12" ;;
> >> -    _alpine-arm64v8) CONTAINER="${BASE}/alpine:3.12-arm64v8" ;;
> >> +    _alpine-arm64v8|_arm64) CONTAINER="${BASE}/alpine:3.12-
> arm64v8" ;;
> >>      _archlinux|_arch) CONTAINER="${BASE}/archlinux:current" ;;
> >>      _riscv64) CONTAINER="${BASE}/archlinux:riscv64" ;;
> >>      _centos7) CONTAINER="${BASE}/centos:7" ;;
> >>
> >> The question is whether it would be beneficial. After all you would still
> need
> >> to
> >> type CONTAINER=arm64, whereas at the moment, you need to type
> >> CONTAINER=alpine-arm64v8.
> >> TBH I'm not sure it is improving anything (?).
> >>
> >> ~Michal
> > [Jiamei Xie]
> > I am not sure about this either.  I added something like below f to run it on
> arm64 machine.   But it  didn't take "running container for a different
> architecture" into consideration.
> >
> So your question is not about adding default container when selecting
> CONTAINER=arm64, but adding
> a default one when running on arm64 platform. Right now, the default one
> is debian:stretch
> (if you don't type CONTAINER= at all). Do I understand it right that you
> would like the same
> behavior when running on arm64 platform (currently, it would also select
> debian:stretch)?
> So that when executing:
> ./automation/scripts/containerize ...
> it would automatically select alpine-arm64v8?
> 
Yes, this is what I mean.
> 
> > --- a/automation/scripts/containerize
> > +++ b/automation/scripts/containerize
> > @@ -18,6 +18,12 @@ die() {
> >      exit 1
> >  }
> >
> > +# There are two containers that can run on aarch64, unstable and alpine.
> > +# Set the default container to alpine for aarch64
> > +if [[ $(uname -m) = "aarch64" && -z ${CONTAINER} ]]; then
> The output from `uname -m` for arm64 can be aarch64 and arm64.
> 
> > +    CONTAINER="alpine"
> > +fi
> > +
> >  #
> >  # The caller is expected to override the CONTAINER environment
> >  # variable with the container they wish to launch.
> > @@ -41,6 +47,11 @@ case "_${CONTAINER}" in
> >      _opensuse-tumbleweed|_tumbleweed)
> CONTAINER="${BASE}/suse:opensuse-tumbleweed" ;;
> >  esac
> >
> > +# Containers for aarch64 have a sufix "-arm64v8"
> > +if [[ $(uname -m) = "aarch64" ]]; then
> > +    CONTAINER="${CONTAINER}-arm64v8"
> > +fi
> This is not needed. CONTAINER can be selected on the first check and let
> case/esac block
> to determine the full path to container.
> 
> > +
> >  # Use this variable to control whether root should be used
> >  case "_${CONTAINER_UID0}" in
> >      _1)   userarg= ;;
> >
> >
> > Best wishes
> > Jiamei Xie
> >
> >
> 
> What you are asking for can be done in a simpler way. The following is
> enough:
> 
> diff --git a/automation/scripts/containerize
> b/automation/scripts/containerize
> index 0f4645c4cccb..4e7e8bb48e3a 100755
> --- a/automation/scripts/containerize
> +++ b/automation/scripts/containerize
> @@ -18,6 +18,11 @@ die() {
>      exit 1
>  }
> 
> +# Select default container when running on arm64 machine.
> +if [ -z "${CONTAINER}" ] && uname -m | grep -qE 'aarch64|arm64'; then
> +    CONTAINER="alpine-arm64v8"
> +fi
> +
>  #
>  # The caller is expected to override the CONTAINER environment
>  # variable with the container they wish to launch.
> 
> ~Michal
Yeah, I agree with this  implementation. 

Best wishes
Jiamei Xie



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

end of thread, other threads:[~2022-10-20  8:04 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27  9:47 [PATCH v3 00/10] GitLab CI cleanup & improvements for Arm Michal Orzel
2022-09-27  9:47 ` [for-4.17,PATCH v3 01/10] automation: qemu-smoke-arm{32/64}.sh: Fix typo in DEBIAN_FRONTENT Michal Orzel
2022-09-27  9:51   ` Henry Wang
2022-09-27  9:54   ` Luca Fancellu
2022-09-28  0:29   ` Stefano Stabellini
2022-09-27  9:47 ` [PATCH v3 02/10] automation: Add randconfig build jobs for arm64 alpine container Michal Orzel
2022-09-27  9:47 ` [PATCH v3 03/10] automation: qemu-smoke-arm64.sh: Increase RAM size Michal Orzel
2022-09-27  9:47 ` [PATCH v3 04/10] automation: Add debug versions of Arm tests Michal Orzel
2022-09-27  9:47 ` [PATCH v3 05/10] automation: Add Arm containers to containerize script Michal Orzel
2022-10-20  3:00   ` Jiamei Xie
2022-10-20  6:59     ` Michal Orzel
2022-10-20  7:13       ` Jiamei Xie
2022-10-20  7:51         ` Michal Orzel
2022-10-20  8:03           ` Jiamei Xie
2022-09-27  9:47 ` [PATCH v3 06/10] automation: qemu-smoke-arm32.sh: Modify script to use ImageBuilder Michal Orzel
2022-09-27  9:47 ` [PATCH v3 07/10] automation: qemu-alpine-arm64: Cleanup and fixes Michal Orzel
2022-09-27  9:52   ` Luca Fancellu
2022-09-28  0:29   ` Stefano Stabellini
2022-09-27  9:47 ` [PATCH v3 08/10] automation: Rename qemu-smoke-arm64.sh to qemu-smoke-dom0less-arm64.sh Michal Orzel
2022-09-27  9:47 ` [PATCH v3 09/10] automation: Rename qemu-alpine-arm64.sh to qemu-smoke-dom0-arm64.sh Michal Orzel
2022-09-27  9:47 ` [PATCH v3 10/10] automation: Rename qemu-smoke-arm32.sh to qemu-smoke-dom0-arm32.sh Michal Orzel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.