From nobody Thu Apr 25 01:12:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1605586929; cv=none; d=zohomail.com; s=zohoarc; b=lYAao86FN0UTOFD9HcjNQp4cLNC61PxtUoZVSTUlrJDEnlreaCwBk9iQbBaIrFvir6zxwk7gGCWFYZtCR65fmQ1MQZuyuipsW9dHoZwZAF0tfcnR0dlYRdgQw+CPuw570YezIWVapW7m0AA2JBMvIP1NZ3CQbsDkdaVVjhCQZMI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605586929; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=1d3whHfHsGpKF0pKismTTt5YJsbF+pzzF1bY3CoZfss=; b=gZpICYkKQArRUb8rnvamUiSMV46SwIDJ+/5EbuKXsXtzROJ8PeM+tuYm44JTsi+KJwSDT+YWD9/SwnB5Q1rS3vkbZIGjLst4b6UMAS7m9fU6ZE2Keye1SeqccTiB8UPOh6CYK9M3r2o1dfCSQ+3HNpxcps6YhS6QyGFT21G5i70= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1605586929730531.9066420900947; Mon, 16 Nov 2020 20:22:09 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.28708.57773 (Exim 4.92) (envelope-from ) id 1kesUl-0007WS-6i; Tue, 17 Nov 2020 04:21:31 +0000 Received: by outflank-mailman (output) from mailman id 28708.57773; Tue, 17 Nov 2020 04:21:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kesUl-0007WL-3o; Tue, 17 Nov 2020 04:21:31 +0000 Received: by outflank-mailman (input) for mailman id 28708; Tue, 17 Nov 2020 04:21:30 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kesUk-0007Vy-3q for xen-devel@lists.xenproject.org; Tue, 17 Nov 2020 04:21:30 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a08ecfa7-b961-4c59-9628-4cf2717f7e06; Tue, 17 Nov 2020 04:21:29 +0000 (UTC) Received: from sstabellini-ThinkPad-T480s.hsd1.ca.comcast.net (c-24-130-65-46.hsd1.ca.comcast.net [24.130.65.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 683C4205F4; Tue, 17 Nov 2020 04:21:28 +0000 (UTC) Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kesUk-0007Vy-3q for xen-devel@lists.xenproject.org; Tue, 17 Nov 2020 04:21:30 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a08ecfa7-b961-4c59-9628-4cf2717f7e06; Tue, 17 Nov 2020 04:21:29 +0000 (UTC) Received: from sstabellini-ThinkPad-T480s.hsd1.ca.comcast.net (c-24-130-65-46.hsd1.ca.comcast.net [24.130.65.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 683C4205F4; Tue, 17 Nov 2020 04:21:28 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a08ecfa7-b961-4c59-9628-4cf2717f7e06 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605586888; bh=/lcIGplqn6odufkVeXSQ/3A4o3V3IGNc2rmyv6gS60M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tSZUd3BHwRJJ6C987+NAT4qrC6/kRq/4+Jlas9lBBMa05nBQf7RSTB98hFuIOlq1g xmcyTJCVHi4PrEEgrfP6d+IAerJAStMKJ+SABEtMdXWXDT9chx5aTRbjC1zeJdBYkv 2jia4l4cgtIQhXa+CTAcVnI2mXZDi2OWzb9tb7OE= From: Stefano Stabellini To: andrew.cooper3@citrix.com, cardoe@cardoe.com, wl@xen.org Cc: sstabellini@kernel.org, xen-devel@lists.xenproject.org, Stefano Stabellini Subject: [PATCH v2 1/2] automation: add a QEMU aarch64 smoke test Date: Mon, 16 Nov 2020 20:21:26 -0800 Message-Id: <20201117042127.30981-1-sstabellini@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ZohoMail-DKIM: pass (identity @kernel.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use QEMU to start Xen (just the hypervisor) up until it stops because there is no dom0 kernel to boot. It is based on the existing build job unstable-arm64v8. Also use make -j$(nproc) to build Xen. Signed-off-by: Stefano Stabellini Acked-by: Wei Liu --- Changes in v2: - fix x86_32 build --- automation/gitlab-ci/test.yaml | 22 ++++++++++++++++++ automation/scripts/build | 6 ++--- automation/scripts/qemu-smoke-arm64.sh | 32 ++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 3 deletions(-) create mode 100755 automation/scripts/qemu-smoke-arm64.sh diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index 793feafe8b..35346e3f6e 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -22,6 +22,28 @@ build-each-commit-gcc: - /^coverity-tested\/.*/ - /^stable-.*/ =20 +qemu-smoke-arm64-gcc: + stage: test + image: registry.gitlab.com/xen-project/xen/${CONTAINER} + variables: + CONTAINER: debian:unstable-arm64v8 + script: + - ./automation/scripts/qemu-smoke-arm64.sh 2>&1 | tee qemu-smoke-arm64= .log + dependencies: + - debian-unstable-gcc-arm64 + artifacts: + paths: + - smoke.serial + - '*.log' + when: always + tags: + - arm64 + except: + - master + - smoke + - /^coverity-tested\/.*/ + - /^stable-.*/ + qemu-smoke-x86-64-gcc: stage: test image: registry.gitlab.com/xen-project/xen/${CONTAINER} diff --git a/automation/scripts/build b/automation/scripts/build index 0cd0f3971d..7038e5eb50 100755 --- a/automation/scripts/build +++ b/automation/scripts/build @@ -10,9 +10,9 @@ cc-ver() =20 # random config or default config if [[ "${RANDCONFIG}" =3D=3D "y" ]]; then - make -C xen KCONFIG_ALLCONFIG=3Dtools/kconfig/allrandom.config randcon= fig + make -j$(nproc) -C xen KCONFIG_ALLCONFIG=3Dtools/kconfig/allrandom.con= fig randconfig else - make -C xen defconfig + make -j$(nproc) -C xen defconfig fi =20 # build up our configure options @@ -45,7 +45,7 @@ make -j$(nproc) dist # Extract artifacts to avoid getting rewritten by customised builds cp xen/.config xen-config mkdir binaries -if [[ "${XEN_TARGET_ARCH}" =3D=3D "x86_64" ]]; then +if [[ "${XEN_TARGET_ARCH}" !=3D "x86_32" ]]; then cp xen/xen binaries/xen fi =20 diff --git a/automation/scripts/qemu-smoke-arm64.sh b/automation/scripts/qe= mu-smoke-arm64.sh new file mode 100755 index 0000000000..a7efbf8b6f --- /dev/null +++ b/automation/scripts/qemu-smoke-arm64.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -ex + +# Install QEMU +export DEBIAN_FRONTENT=3Dnoninteractive +apt-get -qy update +apt-get -qy install --no-install-recommends qemu-system-aarch64 \ + u-boot-qemu + +# XXX Silly workaround to get the following QEMU command to work +cp /usr/share/qemu/pvh.bin /usr/share/qemu/efi-virtio.rom +qemu-system-aarch64 \ + -machine virtualization=3Dtrue \ + -cpu cortex-a57 -machine type=3Dvirt \ + -m 512 -display none \ + -machine dumpdtb=3Dbinaries/virt-gicv3.dtb + +rm -f smoke.serial +set +e +echo " booti 0x49000000 - 0x44000000" | timeout -k 1 30 qemu-system-aarch= 64 \ + -machine virtualization=3Dtrue \ + -cpu cortex-a57 -machine type=3Dvirt \ + -m 512 -monitor none -serial stdio \ + -no-reboot \ + -device loader,file=3Dbinaries/virt-gicv3.dtb,force-raw=3Don,addr=3D0x= 44000000 \ + -device loader,file=3Dbinaries/xen,force-raw=3Don,addr=3D0x49000000 \ + -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& tee smoke.serial + +set -e +grep -q 'LOADING DOMAIN 0' smoke.serial || exit 1 +exit 0 --=20 2.17.1 From nobody Thu Apr 25 01:12:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1605586928; cv=none; d=zohomail.com; s=zohoarc; b=Byu/FLg7eq3cWovlb0NRA9ZB/cwFLJtnLDYMlPI76xY1gC12dS9oKJrJPFVAcnkS+km04hoKyHlYlUvYhlusPeED781/53Q81aMPo17fqiKzZJTsTm5TTcUyh4xjCmJHkLCvj06xsALhuzuG38d9U+PjfCRj+ntuaE66IvAnrIg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605586928; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=WGTdWkZyTZXSXC+Ov7ZUy47W1J0sAtE/OkiGUqjxY54=; b=Q+X7qNcn8JeQp30/KtmlcffEbTVFRoYDKxkMEcNnu6cslbxxrg5Zl9hgr+0idOsZ96ajpCvgPAILBQMGIPBiHhkT6isP1iElt+Dd4yN42h9lVqYsuVUceyWDXyQLB8EwCNx6K4ARl3aAPNSYbdKJJrZB4JXSiE0gDCxEo24Y0UY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 160558692865482.32374426580077; Mon, 16 Nov 2020 20:22:08 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.28709.57786 (Exim 4.92) (envelope-from ) id 1kesUm-0007YC-FZ; Tue, 17 Nov 2020 04:21:32 +0000 Received: by outflank-mailman (output) from mailman id 28709.57786; Tue, 17 Nov 2020 04:21:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kesUm-0007Y4-Bv; Tue, 17 Nov 2020 04:21:32 +0000 Received: by outflank-mailman (input) for mailman id 28709; Tue, 17 Nov 2020 04:21:30 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kesUk-0007W8-M9 for xen-devel@lists.xenproject.org; Tue, 17 Nov 2020 04:21:30 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 96c13b98-123a-4a68-8ad9-0390c52b829a; Tue, 17 Nov 2020 04:21:29 +0000 (UTC) Received: from sstabellini-ThinkPad-T480s.hsd1.ca.comcast.net (c-24-130-65-46.hsd1.ca.comcast.net [24.130.65.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DD45920897; Tue, 17 Nov 2020 04:21:28 +0000 (UTC) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kesUk-0007W8-M9 for xen-devel@lists.xenproject.org; Tue, 17 Nov 2020 04:21:30 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 96c13b98-123a-4a68-8ad9-0390c52b829a; Tue, 17 Nov 2020 04:21:29 +0000 (UTC) Received: from sstabellini-ThinkPad-T480s.hsd1.ca.comcast.net (c-24-130-65-46.hsd1.ca.comcast.net [24.130.65.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DD45920897; Tue, 17 Nov 2020 04:21:28 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 96c13b98-123a-4a68-8ad9-0390c52b829a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605586889; bh=B3voGS66tFjvS6XbYFLKdnIC8vjICDXfAp5+13pxSzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V359CSiav7KiGxu3f+el+28ZVnKG224S9/u0E4hxdkqEh6dadyvvX72q8lFGWmspO UGNnON1suFtQrUZW94/pAyskPNqfhj7Ytex0g8ABzcE8G0hg/3yl1VHuBBh/cnJ3kZ Q3bCbVvwq4RT5ywj8MwRuc9/r5EllnK1rvJeT0hE= From: Stefano Stabellini To: andrew.cooper3@citrix.com, cardoe@cardoe.com, wl@xen.org Cc: sstabellini@kernel.org, xen-devel@lists.xenproject.org, Stefano Stabellini Subject: [PATCH v2 2/2] automation: add dom0less to the QEMU aarch64 smoke test Date: Mon, 16 Nov 2020 20:21:27 -0800 Message-Id: <20201117042127.30981-2-sstabellini@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ZohoMail-DKIM: pass (identity @kernel.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add a trivial dom0less test: - fetch the Debian arm64 kernel and use it ad dom0/U kernel - use busybox-static to create a trivial dom0/U ramdisk - use ImageBuilder to generate the uboot boot script automatically - install and use u-boot from the Debian package to start the test - binaries are loaded from uboot via tftp Signed-off-by: Stefano Stabellini Acked-by: Wei Liu --- Changes in v2: - use the Debian kernel for testing --- automation/scripts/qemu-smoke-arm64.sh | 80 +++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 7 deletions(-) diff --git a/automation/scripts/qemu-smoke-arm64.sh b/automation/scripts/qe= mu-smoke-arm64.sh index a7efbf8b6f..41f570fff8 100755 --- a/automation/scripts/qemu-smoke-arm64.sh +++ b/automation/scripts/qemu-smoke-arm64.sh @@ -6,27 +6,93 @@ set -ex export DEBIAN_FRONTENT=3Dnoninteractive apt-get -qy update apt-get -qy install --no-install-recommends qemu-system-aarch64 \ - u-boot-qemu + u-boot-qemu \ + u-boot-tools \ + device-tree-compiler \ + busybox-static \ + cpio + +apt-get download linux-image-5.9.0-2-arm64 +dpkg -i --ignore-depends=3Dinitramfs-tools ./linux-image-5.9.0-2-arm64_5.9= .6-1_arm64.deb || true +rm ./linux-image-5.9.0-2-arm64_5.9.6-1_arm64.deb +cp /boot/vmlinuz-5.9.0-2-arm64 ./binaries/Image =20 # XXX Silly workaround to get the following QEMU command to work cp /usr/share/qemu/pvh.bin /usr/share/qemu/efi-virtio.rom qemu-system-aarch64 \ -machine virtualization=3Dtrue \ -cpu cortex-a57 -machine type=3Dvirt \ - -m 512 -display none \ + -m 1024 -display none \ -machine dumpdtb=3Dbinaries/virt-gicv3.dtb +# XXX disable pl061 to avoid Linux crash +dtc -I dtb -O dts binaries/virt-gicv3.dtb > binaries/virt-gicv3.dts +sed 's/compatible =3D "arm,pl061.*/status =3D "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 + + +# Busybox Dom0 +mkdir -p initrd +mkdir -p initrd/bin +mkdir -p initrd/sbin +mkdir -p initrd/etc +mkdir -p initrd/dev +mkdir -p initrd/proc +mkdir -p initrd/sys +mkdir -p initrd/lib +mkdir -p initrd/var +mkdir -p initrd/mnt +cp /bin/busybox initrd/bin/busybox +initrd/bin/busybox --install initrd/bin +echo "#!/bin/sh + +mount -t proc proc /proc +mount -t sysfs sysfs /sys +mount -t devtmpfs devtmpfs /dev +/bin/sh" > initrd/init +chmod +x initrd/init +cd initrd +find . | cpio --create --format=3D'newc' | gzip > ../binaries/initrd +cd .. + + +# ImageBuilder +echo 'MEMORY_START=3D"0x40000000" +MEMORY_END=3D"0x80000000" =20 +DEVICE_TREE=3D"virt-gicv3.dtb" +XEN=3D"xen" +DOM0_KERNEL=3D"Image" +DOM0_RAMDISK=3D"initrd" +XEN_CMD=3D"console=3Ddtuart dom0_mem=3D512M" + +NUM_DOMUS=3D1 +DOMU_KERNEL[0]=3D"Image" +DOMU_RAMDISK[0]=3D"initrd" +DOMU_MEM[0]=3D"256" + +LOAD_CMD=3D"tftpb" +UBOOT_SOURCE=3D"boot.source" +UBOOT_SCRIPT=3D"boot.scr"' > binaries/config +rm -rf imagebuilder +git clone https://gitlab.com/ViryaOS/imagebuilder +bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binarie= s/config + + +# Run the test rm -f smoke.serial set +e -echo " booti 0x49000000 - 0x44000000" | timeout -k 1 30 qemu-system-aarch= 64 \ +echo " virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \ +timeout -k 1 240 \ +qemu-system-aarch64 \ -machine virtualization=3Dtrue \ -cpu cortex-a57 -machine type=3Dvirt \ - -m 512 -monitor none -serial stdio \ + -m 1024 -monitor none -serial stdio \ + -smp 2 \ -no-reboot \ - -device loader,file=3Dbinaries/virt-gicv3.dtb,force-raw=3Don,addr=3D0x= 44000000 \ - -device loader,file=3Dbinaries/xen,force-raw=3Don,addr=3D0x49000000 \ + -device virtio-net-pci,netdev=3Dn0 \ + -netdev user,id=3Dn0,tftp=3Dbinaries \ -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& tee smoke.serial =20 set -e -grep -q 'LOADING DOMAIN 0' smoke.serial || exit 1 +(grep -q "^BusyBox" smoke.serial && grep -q "DOM1: BusyBox" smoke.serial) = || exit 1 exit 0 --=20 2.17.1