[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 22/23] automation: Add arm64 hardware/control split test


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Thu, 6 Mar 2025 17:03:42 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vdj/omG7aNG4QUYzbT1Q3RmuRPZYorhXrmyOwRld3kU=; b=cpMn+kSeB9+M0IsBJrx6sVW8bOwXaMiij4oXA3igekbu70Hr2x1mkKjEBPOICUOrDrmlxX2hMT75ZJyFSAz07vSgbOF8bwgLUwr3nF8DlK95LjJHY/Y76BKke0deoM/n0R+mP+cz0rzOKuhBVpfZuau8pJb+5KZLFg0sK0CC4NVCP4mA8qH2UvbQB5XIJh2SPBX30KVQ7RJFBVwNAYkAWjEsnQayJZYwCgsEXXeKMcgW0xR42H/LChm3sKkqeXS6135AUJo7rSKZhpUXxKUBrTMFCKQbgTTtj6JbMmPLdCjF53ylJYYdxLWAAV+19NhihdChOHCw/b+JOmH7NgxKMg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WUJDn5lI44BO4YdC/pW+R01M4NmMhS/tYq2hixFw7wGBpHGGcPjcFdPWOzeCxF82IRnI4y+xQfr6hG8Nmi2K93flr3wIREfN19hyTugNs8YDm3t2DHq8MXBj2KyF9g7KcFBxSL5ejaxRJW7UpKhJiqTB4MQ5hfIAci2Wsp9r36KFE7Wuv0H2X41VTx7072bJOLBIPKohYQX8x8YOBN5qWn41JUjnIIm2zMLSTbUiUnMfET0hJsL5EshDBqFe608XLBoLNXaP3OxHuFhRtYn0o1DaNTZG0eYBO0n2DdxsLX0if4q45Cmtz7FK9QAgUh6v8qSgqWSDeQnuUAmwOVjl2A==
  • Cc: Jason Andryuk <jason.andryuk@xxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 06 Mar 2025 22:41:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Use dom0less to create a hardware+xenstore domain, a control domain,
and a regular domU.

Create a domU-rootfs that does not run the xen scripts, but does have
the xen tools installed.  The domU also uses a console on ttyAMA0
instead of hvc0.

We need to increate dom0less test memory or ImageBuilder fails with:
Error, not enough memory to load all binaries

Use C xenstored so hardware/xenstore can grant map control's xenstore
grant.

Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
Initially, I tried to put xl list into control.  That executes before
dom0 runs init-dom0less, and it hangs.  I expected it to recover after
init-dom0less introduces it, but it does not.  That needs further
investigation.
---
 automation/gitlab-ci/test.yaml                |  8 +++
 .../scripts/qemu-smoke-dom0less-arm64.sh      | 67 ++++++++++++++++---
 2 files changed, 66 insertions(+), 9 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 9530e36e9a..a7f7fbb4bc 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -403,6 +403,14 @@ qemu-smoke-dom0less-arm64-gcc-debug-gicv3:
     - *arm64-test-needs
     - alpine-3.18-gcc-debug-arm64
 
+qemu-smoke-dom0less-arm64-gcc-debug-hwdom-control:
+  extends: .qemu-arm64
+  script:
+    - ./automation/scripts/qemu-smoke-dom0less-arm64.sh hwdom-control 2>&1 | 
tee ${LOGFILE}
+  needs:
+    - *arm64-test-needs
+    - alpine-3.18-gcc-debug-arm64
+
 qemu-smoke-dom0less-arm64-gcc-debug-staticmem:
   extends: .qemu-arm64
   script:
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh 
b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 439e07c90f..39614720a4 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -78,6 +78,12 @@ if [[ "${test_variant}" == "gicv3" ]]; then
     domU_check="echo \"${passed}\""
 fi
 
+if [[ "${test_variant}" == "hwdom-control" ]]; then
+    gic_version=3
+    passed="hardware xenstore"
+    dom0_check="xl list --verbose"
+fi
+
 # 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
 ./binaries/qemu-system-aarch64 \
@@ -114,7 +120,7 @@ cd initrd
 find . | cpio --create --format='newc' | gzip > ../binaries/initrd
 cd ..
 
-# DOM0 rootfs
+# DOM0/DOMU rootfs with Xen tools
 mkdir -p rootfs
 cd rootfs
 tar xzf ../binaries/initrd.tar.gz
@@ -125,6 +131,31 @@ mkdir sys
 rm var/run
 cp -ar ../binaries/dist/install/* .
 
+echo "rc_verbose=yes" >> etc/rc.conf
+
+# Create a domU variant
+if [ "$test_variant" = "hwdom-control" ] ; then
+       echo "domU" > etc/hostname
+       sed -i 's/hvc0/ttyAMA0/g' etc/inittab
+
+       echo "#!/bin/bash
+
+       export LD_LIBRARY_PATH=/usr/local/lib
+
+       ${domCTL_check}
+       " > etc/local.d/xen.start
+       chmod +x etc/local.d/xen.start
+
+       find . | cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
+       # Restore hwdom console
+       sed -i 's/ttyAMA0/hvc0/g' etc/inittab
+
+       # For dom0 - must use xenstored for grant mapping
+       sed -i '/^#XENSTORED=/a XENSTORED=/usr/local/sbin/xenstored' \
+               etc/default/xencommons
+fi
+
+echo "dom0" > etc/hostname
 echo "#!/bin/bash
 
 export LD_LIBRARY_PATH=/usr/local/lib
@@ -142,27 +173,45 @@ xl network-attach 1 type=vif
 ${dom0_check}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-echo "rc_verbose=yes" >> etc/rc.conf
 find . | cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz
 cd ..
 
+if [ "$test_variant" != "hwdom-control" ] ; then
+       IB_DOM0='DOM0_KERNEL="Image"
+DOM0_RAMDISK="dom0-rootfs.cpio.gz"'
+       IB_XEN_CMD='XEN_CMD="console=dtuart dom0_mem=512M 
console_timestamps=boot"'
+       IB_DOMU_EXTRA="DOMU_KERNEL[1]='Image'
+DOMU_RAMDISK[1]='initrd'
+DOMU_MEM[1]='256'"
+else
+       IB_DOM0=''
+       IB_XEN_CMD='XEN_CMD="console=dtuart console_timestamps=boot"'
+       IB_DOMU_EXTRA="DOMU_KERNEL[1]='Image'
+DOMU_RAMDISK[1]='dom0-rootfs.cpio.gz'
+DOMU_MEM[1]='700'
+DOMU_CAPS[1]='hardware|xenstore'
+DOMU_CMD[1]='console=hvc0 earlycon=xen earlyprintk=xen clk_ignore_unused'
+DOMU_KERNEL[2]='Image'
+DOMU_RAMDISK[2]='domU-rootfs.cpio.gz'
+DOMU_MEM[2]='700'
+DOMU_CAPS[2]='control'
+DOMU_ENHANCED[2]=1
+NUM_DOMUS=3"
+fi
 # ImageBuilder
 echo "MEMORY_START='0x40000000'
-MEMORY_END='0x50000000'
+MEMORY_END='0x80000000'
 
 DEVICE_TREE='virt.dtb'
 XEN='xen'
-DOM0_KERNEL='Image'
-DOM0_RAMDISK='dom0-rootfs.cpio.gz'
-XEN_CMD='console=dtuart dom0_mem=512M console_timestamps=boot'
+$IB_XEN_CMD
+$IB_DOM0
 
 NUM_DOMUS=1
 DOMU_KERNEL[0]='Image'
 DOMU_RAMDISK[0]='initrd'
 DOMU_MEM[0]='256'
-DOMU_KERNEL[1]='Image'
-DOMU_RAMDISK[1]='initrd'
-DOMU_MEM[1]='256'
+$IB_DOMU_EXTRA
 
 LOAD_CMD='tftpb'
 UBOOT_SOURCE='boot.source'
-- 
2.48.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.