Skip to contentSkip to conversation

Add {adl,zen3p}-pvshim-* tests

PATCH In review Andrew Cooper 3 participants 11 messages Oct 21, 2024 – Oct 22, 2024

lore
Share & tools
lore
#0 lore raw

cover Add {adl,zen3p}-pvshim-* tests

The main patch is patch 3. Patches 1 and 2 are cleanup to qubes-x86-64.sh.

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1505518838
https://cirrus-ci.com/build/4673310460477440

Andrew Cooper (3):
CI: Minor cleanup to qubes-x86-64.sh
CI: Rework domU_config generation in qubes-x86-64.sh
CI: Add {adl,zen3p}-pvshim-* tests

 automation/gitlab-ci/test.yaml     |  16 ++++
 automation/scripts/qubes-x86-64.sh | 138 ++++++++++++++++-------------
 2 files changed, 92 insertions(+), 62 deletions(-)
Signature · 1 line
2.39.5
#1 lore raw

PATCH 1/3 CI: Minor cleanup to qubes-x86-64.sh

* List all the test_variants and summerise what's going on
* Use case rather than an if/else chain for $test_variant
* Fix indentation inside the case block

No functional change.

---
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Daniel P. Smith <[email protected]>
CC: Anthony PERARD <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Doug Goldstein <[email protected]>

---
 automation/scripts/qubes-x86-64.sh | 84 ++++++++++++++++++------------
 1 file changed, 50 insertions(+), 34 deletions(-)
automation/scripts/qubes-x86-64.sh +50 -34
index bfa60c912a64..306304e9219f 100755
@@ -2,6 +2,13 @@
 
 set -ex
 
+# One of:
+#  - ""             PV dom0,  PVH domU
+#  - dom0pvh        PVH dom0, PVH domU
+#  - dom0pvh-hvm    PVH dom0, HVM domU
+#  - pci-hvm        PV dom0,  HVM domU + PCI Passthrough
+#  - pci-pv         PV dom0,  PV domU + PCI Passthrough
+#  - s3             PV dom0,  S3 suspend/resume
 test_variant=$1
 
 ### defaults
@@ -19,17 +26,18 @@ vif = [ "bridge=xenbr0", ]
 disk = [ ]
 '
 
-### test: smoke test & smoke test PVH & smoke test HVM
-if [ -z "${test_variant}" ] || [ "${test_variant}" = "dom0pvh" ] || [ "${test_variant}" = "dom0pvh-hvm" ]; then
-    passed="ping test passed"
-    domU_check="
+case "${test_variant}" in
+    ### test: smoke test & smoke test PVH & smoke test HVM
+    ""|"dom0pvh"|"dom0pvh-hvm")
+        passed="ping test passed"
+        domU_check="
 ifconfig eth0 192.168.0.2
 until ping -c 10 192.168.0.1; do
     sleep 1
 done
 echo \"${passed}\"
 "
-    dom0_check="
+        dom0_check="
 set +x
 until grep -q \"${passed}\" /var/log/xen/console/guest-domU.log; do
     sleep 1
@@ -37,12 +45,12 @@ done
 set -x
 echo \"${passed}\"
 "
-if [ "${test_variant}" = "dom0pvh" ] || [ "${test_variant}" = "dom0pvh-hvm" ]; then
-    extra_xen_opts="dom0=pvh"
-fi
+        if [ "${test_variant}" = "dom0pvh" ] || [ "${test_variant}" = "dom0pvh-hvm" ]; then
+            extra_xen_opts="dom0=pvh"
+        fi
 
-if [ "${test_variant}" = "dom0pvh-hvm" ]; then
-    domU_config='
+        if [ "${test_variant}" = "dom0pvh-hvm" ]; then
+            domU_config='
 type = "hvm"
 name = "domU"
 kernel = "/boot/vmlinuz"
@@ -52,17 +60,18 @@ memory = 512
 vif = [ "bridge=xenbr0", ]
 disk = [ ]
 '
-fi
-
-### test: S3
-elif [ "${test_variant}" = "s3" ]; then
-    passed="suspend test passed"
-    wait_and_wakeup="started, suspending"
-    domU_check="
+        fi
+        ;;
+
+    ### test: S3
+    "s3")
+        passed="suspend test passed"
+        wait_and_wakeup="started, suspending"
+        domU_check="
 ifconfig eth0 192.168.0.2
 echo domU started
 "
-    dom0_check="
+        dom0_check="
 until grep 'domU started' /var/log/xen/console/guest-domU.log; do
     sleep 1
 done
@@ -79,19 +88,20 @@ xl dmesg | grep 'Finishing wakeup from ACPI S3 state' || exit 1
 ping -c 10 192.168.0.2 || exit 1
 echo \"${passed}\"
 "
+        ;;
 
-### test: pci-pv, pci-hvm
-elif [ "${test_variant}" = "pci-pv" ] || [ "${test_variant}" = "pci-hvm" ]; then
+    ### test: pci-pv, pci-hvm
+    "pci-pv"|"pci-hvm")
 
-    if [ -z "$PCIDEV" ]; then
-        echo "Please set 'PCIDEV' variable with BDF of test network adapter" >&2
-        echo "Optionally set also 'PCIDEV_INTR' to 'MSI' or 'MSI-X'" >&2
-        exit 1
-    fi
+        if [ -z "$PCIDEV" ]; then
+            echo "Please set 'PCIDEV' variable with BDF of test network adapter" >&2
+            echo "Optionally set also 'PCIDEV_INTR' to 'MSI' or 'MSI-X'" >&2
+            exit 1
+        fi
 
-    passed="pci test passed"
+        passed="pci test passed"
 
-    domU_config='
+        domU_config='
 type = "'${test_variant#pci-}'"
 name = "domU"
 kernel = "/boot/vmlinuz"
@@ -104,7 +114,7 @@ pci = [ "'$PCIDEV',seize=1" ]
 on_reboot = "destroy"
 '
 
-    domU_check="
+        domU_check="
 set -x -e
 interface=eth0
 ip link set \"\$interface\" up
@@ -115,22 +125,28 @@ echo domU started
 pcidevice=\$(basename \$(readlink /sys/class/net/\$interface/device))
 lspci -vs \$pcidevice
 "
-    if [ -n "$PCIDEV_INTR" ]; then
-        domU_check="$domU_check
+        if [ -n "$PCIDEV_INTR" ]; then
+            domU_check="$domU_check
 lspci -vs \$pcidevice | fgrep '$PCIDEV_INTR: Enable+'
 "
-    fi
-    domU_check="$domU_check
+        fi
+        domU_check="$domU_check
 echo \"${passed}\"
 "
 
-    dom0_check="
+        dom0_check="
 tail -F /var/log/xen/qemu-dm-domU.log &
 until grep -q \"^domU Welcome to Alpine Linux\" /var/log/xen/console/guest-domU.log; do
     sleep 1
 done
 "
-fi
+        ;;
+
+    *)
+        echo "Unrecognised test_variant '${test_variant}'" >&2
+        exit 1
+        ;;
+esac
 
 # DomU
 mkdir -p rootfs
Signature · 1 line
2.39.5
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] CI: Minor cleanup to qubes-x86-64.sh

Quoted 7 lines · Andrew Cooper

* List all the test_variants and summerise what's going on
* Use case rather than an if/else chain for $test_variant
* Fix indentation inside the case block

No functional change.

Quoted 175 lines

---
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Daniel P. Smith <[email protected]>
CC: Anthony PERARD <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Doug Goldstein <[email protected]>

---
 automation/scripts/qubes-x86-64.sh | 84 ++++++++++++++++++------------
 1 file changed, 50 insertions(+), 34 deletions(-)
automation/scripts/qubes-x86-64.sh +50 -34
index bfa60c912a64..306304e9219f 100755
@@ -2,6 +2,13 @@
 
 set -ex
 
+# One of:
+#  - ""             PV dom0,  PVH domU
+#  - dom0pvh        PVH dom0, PVH domU
+#  - dom0pvh-hvm    PVH dom0, HVM domU
+#  - pci-hvm        PV dom0,  HVM domU + PCI Passthrough
+#  - pci-pv         PV dom0,  PV domU + PCI Passthrough
+#  - s3             PV dom0,  S3 suspend/resume
 test_variant=$1
 
 ### defaults
@@ -19,17 +26,18 @@ vif = [ "bridge=xenbr0", ]
 disk = [ ]
 '
 
-### test: smoke test & smoke test PVH & smoke test HVM
-if [ -z "${test_variant}" ] || [ "${test_variant}" = "dom0pvh" ] || [ "${test_variant}" = "dom0pvh-hvm" ]; then
-    passed="ping test passed"
-    domU_check="
+case "${test_variant}" in
+    ### test: smoke test & smoke test PVH & smoke test HVM
+    ""|"dom0pvh"|"dom0pvh-hvm")
+        passed="ping test passed"
+        domU_check="
 ifconfig eth0 192.168.0.2
 until ping -c 10 192.168.0.1; do
     sleep 1
 done
 echo \"${passed}\"
 "
-    dom0_check="
+        dom0_check="
 set +x
 until grep -q \"${passed}\" /var/log/xen/console/guest-domU.log; do
     sleep 1
@@ -37,12 +45,12 @@ done
 set -x
 echo \"${passed}\"
 "
-if [ "${test_variant}" = "dom0pvh" ] || [ "${test_variant}" = "dom0pvh-hvm" ]; then
-    extra_xen_opts="dom0=pvh"
-fi
+        if [ "${test_variant}" = "dom0pvh" ] || [ "${test_variant}" = "dom0pvh-hvm" ]; then
+            extra_xen_opts="dom0=pvh"
+        fi
 
-if [ "${test_variant}" = "dom0pvh-hvm" ]; then
-    domU_config='
+        if [ "${test_variant}" = "dom0pvh-hvm" ]; then
+            domU_config='
 type = "hvm"
 name = "domU"
 kernel = "/boot/vmlinuz"
@@ -52,17 +60,18 @@ memory = 512
 vif = [ "bridge=xenbr0", ]
 disk = [ ]
 '
-fi
-
-### test: S3
-elif [ "${test_variant}" = "s3" ]; then
-    passed="suspend test passed"
-    wait_and_wakeup="started, suspending"
-    domU_check="
+        fi
+        ;;
+
+    ### test: S3
+    "s3")
+        passed="suspend test passed"
+        wait_and_wakeup="started, suspending"
+        domU_check="
 ifconfig eth0 192.168.0.2
 echo domU started
 "
-    dom0_check="
+        dom0_check="
 until grep 'domU started' /var/log/xen/console/guest-domU.log; do
     sleep 1
 done
@@ -79,19 +88,20 @@ xl dmesg | grep 'Finishing wakeup from ACPI S3 state' || exit 1
 ping -c 10 192.168.0.2 || exit 1
 echo \"${passed}\"
 "
+        ;;
 
-### test: pci-pv, pci-hvm
-elif [ "${test_variant}" = "pci-pv" ] || [ "${test_variant}" = "pci-hvm" ]; then
+    ### test: pci-pv, pci-hvm
+    "pci-pv"|"pci-hvm")
 
-    if [ -z "$PCIDEV" ]; then
-        echo "Please set 'PCIDEV' variable with BDF of test network adapter" >&2
-        echo "Optionally set also 'PCIDEV_INTR' to 'MSI' or 'MSI-X'" >&2
-        exit 1
-    fi
+        if [ -z "$PCIDEV" ]; then
+            echo "Please set 'PCIDEV' variable with BDF of test network adapter" >&2
+            echo "Optionally set also 'PCIDEV_INTR' to 'MSI' or 'MSI-X'" >&2
+            exit 1
+        fi
 
-    passed="pci test passed"
+        passed="pci test passed"
 
-    domU_config='
+        domU_config='
 type = "'${test_variant#pci-}'"
 name = "domU"
 kernel = "/boot/vmlinuz"
@@ -104,7 +114,7 @@ pci = [ "'$PCIDEV',seize=1" ]
 on_reboot = "destroy"
 '
 
-    domU_check="
+        domU_check="
 set -x -e
 interface=eth0
 ip link set \"\$interface\" up
@@ -115,22 +125,28 @@ echo domU started
 pcidevice=\$(basename \$(readlink /sys/class/net/\$interface/device))
 lspci -vs \$pcidevice
 "
-    if [ -n "$PCIDEV_INTR" ]; then
-        domU_check="$domU_check
+        if [ -n "$PCIDEV_INTR" ]; then
+            domU_check="$domU_check
 lspci -vs \$pcidevice | fgrep '$PCIDEV_INTR: Enable+'
 "
-    fi
-    domU_check="$domU_check
+        fi
+        domU_check="$domU_check
 echo \"${passed}\"
 "
 
-    dom0_check="
+        dom0_check="
 tail -F /var/log/xen/qemu-dm-domU.log &
 until grep -q \"^domU Welcome to Alpine Linux\" /var/log/xen/console/guest-domU.log; do
     sleep 1
 done
 "
-fi
+        ;;
+
+    *)
+        echo "Unrecognised test_variant '${test_variant}'" >&2
+        exit 1
+        ;;
+esac
 
 # DomU
 mkdir -p rootfs
Signature · 1 line
2.39.5
#3 lore raw

PATCH 2/3 CI: Rework domU_config generation in qubes-x86-64.sh

In reply to Andrew Cooper

Right now, various blocks rewrite domU_config= as a whole, even though it is largely the same.

* dom0pvh-hvm does nothing but change the domain type to hvm
* *-pci sets the domain type, clears vif=[], appends earlyprintk=xen to the cmdline, and adds some PCI config.

Refactor this to be domU_type (defaults to pvh), domU_vif (defaults to xenbr0), and domU_extra_cfg (defaults to empty) and use these variables to build domU_config= once.

Of note, the default domU_config= now sets cmdline=, and extra= is intended for inclusion via domU_extra_cfg as necessary.

No practical change.

---
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Daniel P. Smith <[email protected]>
CC: Anthony PERARD <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Doug Goldstein <[email protected]>

---
 automation/scripts/qubes-x86-64.sh | 50 +++++++++++++-----------------
 1 file changed, 21 insertions(+), 29 deletions(-)
automation/scripts/qubes-x86-64.sh +21 -29
index 306304e9219f..4b6311efffa8 100755
@@ -15,16 +15,9 @@ test_variant=$1
 extra_xen_opts=
 wait_and_wakeup=
 timeout=120
-domU_config='
-type = "pvh"
-name = "domU"
-kernel = "/boot/vmlinuz"
-ramdisk = "/boot/initrd-domU"
-extra = "root=/dev/ram0 console=hvc0"
-memory = 512
-vif = [ "bridge=xenbr0", ]
-disk = [ ]
-'
+domU_type="pvh"
+domU_vif="'bridge=xenbr0',"
+domU_extra_cfg=
 
 case "${test_variant}" in
     ### test: smoke test & smoke test PVH & smoke test HVM
@@ -50,16 +43,7 @@ echo \"${passed}\"
         fi
 
         if [ "${test_variant}" = "dom0pvh-hvm" ]; then
-            domU_config='
-type = "hvm"
-name = "domU"
-kernel = "/boot/vmlinuz"
-ramdisk = "/boot/initrd-domU"
-extra = "root=/dev/ram0 console=hvc0"
-memory = 512
-vif = [ "bridge=xenbr0", ]
-disk = [ ]
-'
+            domU_type="hvm"
         fi
         ;;
 
@@ -101,15 +85,11 @@ echo \"${passed}\"
 
         passed="pci test passed"
 
-        domU_config='
-type = "'${test_variant#pci-}'"
-name = "domU"
-kernel = "/boot/vmlinuz"
-ramdisk = "/boot/initrd-domU"
-extra = "root=/dev/ram0 console=hvc0 earlyprintk=xen"
-memory = 512
-vif = [ ]
-disk = [ ]
+        domU_type="${test_variant#pci-}"
+        domU_vif=""
+
+        domU_extra_config='
+extra = "earlyprintk=xen"
 pci = [ "'$PCIDEV',seize=1" ]
 on_reboot = "destroy"
 '
@@ -148,6 +128,18 @@ done
         ;;
 esac
 
+domU_config="
+type = '${domU_type}'
+name = 'domU'
+kernel = '/boot/vmlinuz'
+ramdisk = '/boot/initrd-domU'
+cmdline = 'root=/dev/ram0 console=hvc0'
+memory = 512
+vif = [ ${domU_vif} ]
+disk = [ ]
+$domU_extra_config
+"
+
 # DomU
 mkdir -p rootfs
 cd rootfs
Signature · 1 line
2.39.5
Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] CI: Rework domU_config generation in qubes-x86-64.sh

Quoted 11 lines · Andrew Cooper

Right now, various blocks rewrite domU_config= as a whole, even though it is largely the same.

* dom0pvh-hvm does nothing but change the domain type to hvm
* *-pci sets the domain type, clears vif=[], appends earlyprintk=xen to the cmdline, and adds some PCI config.

Refactor this to be domU_type (defaults to pvh), domU_vif (defaults to xenbr0), and domU_extra_cfg (defaults to empty) and use these variables to build domU_config= once.

Quoted 6 lines

Of note, the default domU_config= now sets cmdline=, and extra= is intended for inclusion via domU_extra_cfg as necessary.

No practical change.

Quoted 96 lines

---
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Daniel P. Smith <[email protected]>
CC: Anthony PERARD <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Doug Goldstein <[email protected]>

---
 automation/scripts/qubes-x86-64.sh | 50 +++++++++++++-----------------
 1 file changed, 21 insertions(+), 29 deletions(-)
automation/scripts/qubes-x86-64.sh +21 -29
index 306304e9219f..4b6311efffa8 100755
@@ -15,16 +15,9 @@ test_variant=$1
 extra_xen_opts=
 wait_and_wakeup=
 timeout=120
-domU_config='
-type = "pvh"
-name = "domU"
-kernel = "/boot/vmlinuz"
-ramdisk = "/boot/initrd-domU"
-extra = "root=/dev/ram0 console=hvc0"
-memory = 512
-vif = [ "bridge=xenbr0", ]
-disk = [ ]
-'
+domU_type="pvh"
+domU_vif="'bridge=xenbr0',"
+domU_extra_cfg=
 
 case "${test_variant}" in
     ### test: smoke test & smoke test PVH & smoke test HVM
@@ -50,16 +43,7 @@ echo \"${passed}\"
         fi
 
         if [ "${test_variant}" = "dom0pvh-hvm" ]; then
-            domU_config='
-type = "hvm"
-name = "domU"
-kernel = "/boot/vmlinuz"
-ramdisk = "/boot/initrd-domU"
-extra = "root=/dev/ram0 console=hvc0"
-memory = 512
-vif = [ "bridge=xenbr0", ]
-disk = [ ]
-'
+            domU_type="hvm"
         fi
         ;;
 
@@ -101,15 +85,11 @@ echo \"${passed}\"
 
         passed="pci test passed"
 
-        domU_config='
-type = "'${test_variant#pci-}'"
-name = "domU"
-kernel = "/boot/vmlinuz"
-ramdisk = "/boot/initrd-domU"
-extra = "root=/dev/ram0 console=hvc0 earlyprintk=xen"
-memory = 512
-vif = [ ]
-disk = [ ]
+        domU_type="${test_variant#pci-}"
+        domU_vif=""
+
+        domU_extra_config='
+extra = "earlyprintk=xen"
 pci = [ "'$PCIDEV',seize=1" ]
 on_reboot = "destroy"
 '
@@ -148,6 +128,18 @@ done
         ;;
 esac
 
+domU_config="
+type = '${domU_type}'
+name = 'domU'
+kernel = '/boot/vmlinuz'
+ramdisk = '/boot/initrd-domU'
+cmdline = 'root=/dev/ram0 console=hvc0'
+memory = 512
+vif = [ ${domU_vif} ]
+disk = [ ]
+$domU_extra_config
+"
+
 # DomU
 mkdir -p rootfs
 cd rootfs
Signature · 1 line
2.39.5
#5 lore raw

PATCH 3/3 CI: Add {adl,zen3p}-pvshim-* tests

In reply to Andrew Cooper

GitlabCI has no testing of Xen's PVH entrypoint. Fix this.

---
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Daniel P. Smith <[email protected]>
CC: Anthony PERARD <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Doug Goldstein <[email protected]>

OSSTest (which is disappearing imminently) found a pvshim bug in the hyperlaunch series, and I found a second shortly after while trying to take more of the series.

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1505518838

---
 automation/gitlab-ci/test.yaml     | 16 ++++++++++++++++
 automation/scripts/qubes-x86-64.sh | 10 ++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
automation/gitlab-ci/test.yaml +16 -0
index b27c2be17487..e76a37bef32d 100644
@@ -240,6 +240,14 @@ adl-pci-hvm-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+adl-pvshim-x86-64-gcc-debug:
+  extends: .adl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pvshim 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 zen3p-smoke-x86-64-gcc-debug:
   extends: .zen3p-x86-64
   script:
@@ -272,6 +280,14 @@ zen3p-pci-hvm-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+zen3p-pvshim-x86-64-gcc-debug:
+  extends: .zen3p-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pvshim 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 qemu-smoke-dom0-arm64-gcc:
   extends: .qemu-arm64
   script:
automation/scripts/qubes-x86-64.sh +8 -2
index 4b6311efffa8..ace494b938d8 100755
@@ -8,6 +8,7 @@ set -ex
 #  - dom0pvh-hvm    PVH dom0, HVM domU
 #  - pci-hvm        PV dom0,  HVM domU + PCI Passthrough
 #  - pci-pv         PV dom0,  PV domU + PCI Passthrough
+#  - pvshim         PV dom0,  PVSHIM domU
 #  - s3             PV dom0,  S3 suspend/resume
 test_variant=$1
 
@@ -20,8 +21,8 @@ domU_vif="'bridge=xenbr0',"
 domU_extra_cfg=
 
 case "${test_variant}" in
-    ### test: smoke test & smoke test PVH & smoke test HVM
-    ""|"dom0pvh"|"dom0pvh-hvm")
+    ### test: smoke test & smoke test PVH & smoke test HVM & smoke test PVSHIM
+    ""|"dom0pvh"|"dom0pvh-hvm"|"pvshim")
         passed="ping test passed"
         domU_check="
 ifconfig eth0 192.168.0.2
@@ -44,6 +45,11 @@ echo \"${passed}\"
 
         if [ "${test_variant}" = "dom0pvh-hvm" ]; then
             domU_type="hvm"
+        elif [ "${test_variant}" = "pvshim" ]; then
+            domU_type="pv"
+            domU_extra_cfg='
+pvshim = 1
+'
         fi
         ;;
 
Signature · 1 line
2.39.5
#6 lore raw

Re: [PATCH 3/3] CI: Add {adl,zen3p}-pvshim-* tests

Quoted 80 lines · Andrew Cooper

GitlabCI has no testing of Xen's PVH entrypoint. Fix this.

---
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Daniel P. Smith <[email protected]>
CC: Anthony PERARD <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Doug Goldstein <[email protected]>

OSSTest (which is disappearing imminently) found a pvshim bug in the hyperlaunch series, and I found a second shortly after while trying to take more of the series.

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1505518838

---
 automation/gitlab-ci/test.yaml     | 16 ++++++++++++++++
 automation/scripts/qubes-x86-64.sh | 10 ++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
automation/gitlab-ci/test.yaml +16 -0
index b27c2be17487..e76a37bef32d 100644
@@ -240,6 +240,14 @@ adl-pci-hvm-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+adl-pvshim-x86-64-gcc-debug:
+  extends: .adl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pvshim 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 zen3p-smoke-x86-64-gcc-debug:
   extends: .zen3p-x86-64
   script:
@@ -272,6 +280,14 @@ zen3p-pci-hvm-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+zen3p-pvshim-x86-64-gcc-debug:
+  extends: .zen3p-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pvshim 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 qemu-smoke-dom0-arm64-gcc:
   extends: .qemu-arm64
   script:
automation/scripts/qubes-x86-64.sh +3 -2
index 4b6311efffa8..ace494b938d8 100755
@@ -8,6 +8,7 @@ set -ex
 #  - dom0pvh-hvm    PVH dom0, HVM domU
 #  - pci-hvm        PV dom0,  HVM domU + PCI Passthrough
 #  - pci-pv         PV dom0,  PV domU + PCI Passthrough
+#  - pvshim         PV dom0,  PVSHIM domU
 #  - s3             PV dom0,  S3 suspend/resume
 test_variant=$1
 
@@ -20,8 +21,8 @@ domU_vif="'bridge=xenbr0',"
 domU_extra_cfg=
 
 case "${test_variant}" in
-    ### test: smoke test & smoke test PVH & smoke test HVM
-    ""|"dom0pvh"|"dom0pvh-hvm")
+    ### test: smoke test & smoke test PVH & smoke test HVM & smoke test PVSHIM
+    ""|"dom0pvh"|"dom0pvh-hvm"|"pvshim")
         passed="ping test passed"
         domU_check="
 ifconfig eth0 192.168.0.2
@@ -44,6 +45,11 @@ echo \"${passed}\"
 

automation/scripts/qubes-x86-64.sh echo \"${passed}\" · line 55

Quoted 10 lines
automation/scripts/qubes-x86-64.sh +5 -0
         if [ "${test_variant}" = "dom0pvh-hvm" ]; then
             domU_type="hvm"
+        elif [ "${test_variant}" = "pvshim" ]; then
+            domU_type="pv"
+            domU_extra_cfg='
+pvshim = 1
+'
         fi
         ;;
 

Bah - serves me right for some last minute refactoring.  The domain type should be pvh for pvshim=1 to work.

New pipeline:
https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1505540810

~Andrew

#7 lore raw

Re: [PATCH 3/3] CI: Add {adl,zen3p}-pvshim-* tests

Quoted 94 lines · Andrew Cooper
Quoted 80 lines · Andrew Cooper

GitlabCI has no testing of Xen's PVH entrypoint. Fix this.

---
CC: Marek Marczykowski-Górecki <[email protected]>
CC: Daniel P. Smith <[email protected]>
CC: Anthony PERARD <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Doug Goldstein <[email protected]>

OSSTest (which is disappearing imminently) found a pvshim bug in the hyperlaunch series, and I found a second shortly after while trying to take more of the series.

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1505518838

---
 automation/gitlab-ci/test.yaml     | 16 ++++++++++++++++
 automation/scripts/qubes-x86-64.sh | 10 ++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
automation/gitlab-ci/test.yaml +16 -0
index b27c2be17487..e76a37bef32d 100644
@@ -240,6 +240,14 @@ adl-pci-hvm-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+adl-pvshim-x86-64-gcc-debug:
+  extends: .adl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pvshim 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 zen3p-smoke-x86-64-gcc-debug:
   extends: .zen3p-x86-64
   script:
@@ -272,6 +280,14 @@ zen3p-pci-hvm-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+zen3p-pvshim-x86-64-gcc-debug:
+  extends: .zen3p-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pvshim 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 qemu-smoke-dom0-arm64-gcc:
   extends: .qemu-arm64
   script:
automation/scripts/qubes-x86-64.sh +3 -2
index 4b6311efffa8..ace494b938d8 100755
@@ -8,6 +8,7 @@ set -ex
 #  - dom0pvh-hvm    PVH dom0, HVM domU
 #  - pci-hvm        PV dom0,  HVM domU + PCI Passthrough
 #  - pci-pv         PV dom0,  PV domU + PCI Passthrough
+#  - pvshim         PV dom0,  PVSHIM domU
 #  - s3             PV dom0,  S3 suspend/resume
 test_variant=$1
 
@@ -20,8 +21,8 @@ domU_vif="'bridge=xenbr0',"
 domU_extra_cfg=
 
 case "${test_variant}" in
-    ### test: smoke test & smoke test PVH & smoke test HVM
-    ""|"dom0pvh"|"dom0pvh-hvm")
+    ### test: smoke test & smoke test PVH & smoke test HVM & smoke test PVSHIM
+    ""|"dom0pvh"|"dom0pvh-hvm"|"pvshim")
         passed="ping test passed"
         domU_check="
 ifconfig eth0 192.168.0.2
@@ -44,6 +45,11 @@ echo \"${passed}\"
 

automation/scripts/qubes-x86-64.sh echo \"${passed}\" · line 55

Quoted 10 lines
automation/scripts/qubes-x86-64.sh +5 -0
         if [ "${test_variant}" = "dom0pvh-hvm" ]; then
             domU_type="hvm"
+        elif [ "${test_variant}" = "pvshim" ]; then
+            domU_type="pv"
+            domU_extra_cfg='
+pvshim = 1
+'
         fi
         ;;
 

Bah - serves me right for some last minute refactoring.  The domain type should be pvh for pvshim=1 to work.

Quoted 2 lines

New pipeline:
https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1505540810

And from the same bit of refactoring, a mismatch between domU_extra_{cfg,config}.  Consolidated on the latter.

https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/8143613752

~Andrew

#8 lore raw

Re: [PATCH 3/3] CI: Add {adl,zen3p}-pvshim-* tests

Quoted 10 lines · Andrew Cooper
Quoted 5 lines

Bah - serves me right for some last minute refactoring.  The domain type should be pvh for pvshim=1 to work.

New pipeline:
https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1505540810

And from the same bit of refactoring, a mismatch between domU_extra_{cfg,config}.  Consolidated on the latter.

https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/8143613752

I reviewed the commit c80e9241209cc9ed7f66c3f45275f837ddafc21c from your branch instead. See below.

Quoted 58 lines
automation/gitlab-ci/test.yaml +16 -0
index b27c2be174..e76a37bef3 100644
@@ -240,6 +240,14 @@ adl-pci-hvm-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+adl-pvshim-x86-64-gcc-debug:
+  extends: .adl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pvshim 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 zen3p-smoke-x86-64-gcc-debug:
   extends: .zen3p-x86-64
   script:
@@ -272,6 +280,14 @@ zen3p-pci-hvm-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+zen3p-pvshim-x86-64-gcc-debug:
+  extends: .zen3p-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pvshim 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.18-gcc-debug
+
 qemu-smoke-dom0-arm64-gcc:
   extends: .qemu-arm64
   script:
automation/scripts/qubes-x86-64.sh +3 -2
index 76fbafac84..95090eb12c 100755
@@ -8,6 +8,7 @@ set -ex
 #  - dom0pvh-hvm    PVH dom0, HVM domU
 #  - pci-hvm        PV dom0,  HVM domU + PCI Passthrough
 #  - pci-pv         PV dom0,  PV domU + PCI Passthrough
+#  - pvshim         PV dom0,  PVSHIM domU
 #  - s3             PV dom0,  S3 suspend/resume
 test_variant=$1
 
@@ -20,8 +21,8 @@ domU_vif="'bridge=xenbr0',"
 domU_extra_config=
 
 case "${test_variant}" in
-    ### test: smoke test & smoke test PVH & smoke test HVM
-    ""|"dom0pvh"|"dom0pvh-hvm")
+    ### test: smoke test & smoke test PVH & smoke test HVM & smoke test PVSHIM
+    ""|"dom0pvh"|"dom0pvh-hvm"|"pvshim")
         passed="ping test passed"
         domU_check="
 ifconfig eth0 192.168.0.2

automation/scripts/qubes-x86-64.sh echo \"${passed}\" · line 49

Quoted 5 lines
automation/scripts/qubes-x86-64.sh +2 -0
@@ -44,6 +45,11 @@ echo \"${passed}\"
 
         if [ "${test_variant}" = "dom0pvh-hvm" ]; then
             domU_type="hvm"
+        elif [ "${test_variant}" = "pvshim" ]; then
+            domU_type="pvh"

This is not necessary since PVH is already the default. In theory, it is harmless, but it caused me to do a double-take because I initially thought I was missing something, given that PVH is expected to be the default at this point.

automation/scripts/qubes-x86-64.sh echo \"${passed}\" · line 52

Quoted 3 lines
automation/scripts/qubes-x86-64.sh +3 -0
+            domU_extra_config='
+pvshim = 1
+'

Is there a reason this cannot be:

domU_extra_config='pvshim = 1'

?

These are just minor cosmetics.

Quoted 3 lines
automation/scripts/qubes-x86-64.sh +0 -0
         fi
         ;;
 
#9 lore raw

Re: [PATCH 3/3] CI: Add {adl,zen3p}-pvshim-* tests

Quoted 7 lines · Stefano Stabellini
Quoted 6 lines · Andrew Cooper
automation/scripts/qubes-x86-64.sh +0 -0
index 76fbafac84..95090eb12c 100755
@@ -44,6 +45,11 @@ echo \"${passed}\"
 
Quoted 8 lines

automation/scripts/qubes-x86-64.sh echo \"${passed}\"

Quoted 4 lines
automation/scripts/qubes-x86-64.sh +2 -0
         if [ "${test_variant}" = "dom0pvh-hvm" ]; then
             domU_type="hvm"
+        elif [ "${test_variant}" = "pvshim" ]; then
+            domU_type="pvh"

This is not necessary since PVH is already the default. In theory, it is harmless, but it caused me to do a double-take because I initially thought I was missing something, given that PVH is expected to be the default at this point.

That was more fallout of refactoring.

My first attempt (which worked) involved writing a whole domU_config= block, and then I decided that was a bad thing.

Selecting PVShim without also forcing type to PVH is a little fragile if anyone changes the domU_type default.  I think it's cleaner to keep both together, even if it happens to be re-selecting the default.

Quoted 10 lines

automation/scripts/qubes-x86-64.sh echo \"${passed}\" · line 52

Quoted 3 lines
automation/scripts/qubes-x86-64.sh +3 -0
+            domU_extra_config='
+pvshim = 1
+'

Is there a reason this cannot be:

domU_extra_config='pvshim = 1'

?

These are just minor cosmetics.

Again, refactoring from before pulling out domU_type.

I'm not fussed - I can shrink this to one line.

~Andrew

#10 lore raw

Re: [PATCH 3/3] CI: Add {adl,zen3p}-pvshim-* tests

Quoted 17 lines · Andrew Cooper
Quoted 7 lines · Stefano Stabellini
Quoted 6 lines · Andrew Cooper
automation/scripts/qubes-x86-64.sh +0 -0
index 76fbafac84..95090eb12c 100755
@@ -44,6 +45,11 @@ echo \"${passed}\"
 
Quoted 8 lines

automation/scripts/qubes-x86-64.sh echo \"${passed}\"

Quoted 4 lines
automation/scripts/qubes-x86-64.sh +2 -0
         if [ "${test_variant}" = "dom0pvh-hvm" ]; then
             domU_type="hvm"
+        elif [ "${test_variant}" = "pvshim" ]; then
+            domU_type="pvh"

This is not necessary since PVH is already the default. In theory, it is harmless, but it caused me to do a double-take because I initially thought I was missing something, given that PVH is expected to be the default at this point.

Quoted 8 lines

That was more fallout of refactoring.

My first attempt (which worked) involved writing a whole domU_config= block, and then I decided that was a bad thing.

Selecting PVShim without also forcing type to PVH is a little fragile if anyone changes the domU_type default.  I think it's cleaner to keep both together, even if it happens to be re-selecting the default.

IMO it's okay to leave re-setting the default here explicitly.

Quoted 7 lines
Quoted 7 lines

automation/scripts/qubes-x86-64.sh echo \"${passed}\" · line 52

Quoted 3 lines
automation/scripts/qubes-x86-64.sh +3 -0
+            domU_extra_config='
+pvshim = 1
+'

Is there a reason this cannot be:

domU_extra_config='pvshim = 1'

Quoted 7 lines
Quoted 3 lines

?

These are just minor cosmetics.

Again, refactoring from before pulling out domU_type.

I'm not fussed - I can shrink this to one line.

Either is fine for me. The short one is more readable now, while the long one is easier to extend in the future.

Anyway, for the series (c80e9241209cc9ed7f66c3f45275f837ddafc21c and previous two):

Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab