From nobody Thu Nov 28 05:34:23 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=1678145619; cv=none; d=zohomail.com; s=zohoarc; b=PvuO+okDvODI97K0T+oNCt7Qneaus5q3hLJh/VsaDCpAIEgXC7PKKdZX6HzJZFQPuKVLlj5Gh+hUO7JIBlbXk+YE6Ce3vwjgFSNjs+KjrOZprSNYOvITgmaOXVgbin56uBckwW3zvpCPL2s78+0Qlr9Vvuc1ggbXRwL/SKciL0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678145619; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JGgqbLqg4QvtuTUoE11ZNgF9IZUVebyMss8bFX2W1vI=; b=hwlRbBvCWA4kaGdNvS/9WESlnsBwYkX5x6oGNgC7tys6YhsuRdWDcHrRniN6oJXEsIcOzuC8wNISxZJz2Emm9G49dQyaQvlrUk4BoodUzbh/BZg32gRDjBlTJcuxbXMzXs4ow5almzTFSuJYN5f8XNrFz2h9eZ8Ux78VxnqCcMs= 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) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1678145619866880.9967809862665; Mon, 6 Mar 2023 15:33:39 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.507155.780390 (Exim 4.92) (envelope-from ) id 1pZKKU-0005tA-N4; Mon, 06 Mar 2023 23:33:18 +0000 Received: by outflank-mailman (output) from mailman id 507155.780390; Mon, 06 Mar 2023 23:33:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pZKKU-0005t3-KL; Mon, 06 Mar 2023 23:33:18 +0000 Received: by outflank-mailman (input) for mailman id 507155; Mon, 06 Mar 2023 23:33:16 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pZKKS-0005af-L4 for xen-devel@lists.xenproject.org; Mon, 06 Mar 2023 23:33:16 +0000 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 44296f09-bc77-11ed-96b5-2f268f93b82a; Tue, 07 Mar 2023 00:33:15 +0100 (CET) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 50DAC61183; Mon, 6 Mar 2023 23:33:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13912C433D2; Mon, 6 Mar 2023 23:33:12 +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: 44296f09-bc77-11ed-96b5-2f268f93b82a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678145593; bh=M+QhWGuUbzDwVJWG4MjZlhHdrqDNz+IKRDebRuiLYvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JGUcZrP22a/1n9ksr5ZPhfmZILFtHTqoUKGsZC6tZIMTjkS60pYJIQak1TWe79JK8 xSZnSYzr0hLJycVeyiKhNsnlw0jGnuY8mgNVrp82OTy2aOewQbr8gHbi+k8K93ZR7G khQP9Yk3BHFYQ/YHv5EEdwav7zpQ2wH4rDqOyfXXfHQdEdMd297Rf+8JIWzRkqj6Br sohbWcp4SMrnaSiNW5CYuIuHo/9mtvlWwnCznInFYJfadW7CuNby1LTE0jHMhSXoPC KF2jIl7iCQo94S9sZU6L16viT5tL8vzQ5dyMSgGWr2d4YcHj3tu54cCgGqLl8eTfIS qFDt4JmrntU7w== From: Stefano Stabellini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, cardoe@cardoe.com, michal.orzel@amd.com, Stefano Stabellini Subject: [PATCH v3 1/2] automation: add Ubuntu container for Xilinx hardware tests Date: Mon, 6 Mar 2023 15:33:09 -0800 Message-Id: <20230306233310.1993693-1-sstabellini@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1678145621883100001 Content-Type: text/plain; charset="utf-8" From: Stefano Stabellini This container is only run on the controller PC (x86) to trigger the test on a connected Xilinx ZCU102 physical board. Signed-off-by: Stefano Stabellini Reviewed-by: Michal Orzel --- Changes in v3: - improve in-code comment - add reviewed-by --- .../build/ubuntu/xenial-xilinx.dockerfile | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 automation/build/ubuntu/xenial-xilinx.dockerfile diff --git a/automation/build/ubuntu/xenial-xilinx.dockerfile b/automation/= build/ubuntu/xenial-xilinx.dockerfile new file mode 100644 index 0000000000..5f70871352 --- /dev/null +++ b/automation/build/ubuntu/xenial-xilinx.dockerfile @@ -0,0 +1,25 @@ +FROM ubuntu:16.04 +LABEL maintainer.name=3D"The Xen Project " \ + maintainer.email=3D"xen-devel@lists.xenproject.org" + +ENV DEBIAN_FRONTEND=3Dnoninteractive +ENV USER root + +RUN mkdir /build +WORKDIR /build + +# board bringup depends +RUN apt-get update && \ + apt-get --quiet --yes install \ + snmp \ + snmp-mibs-downloader \ + u-boot-tools \ + device-tree-compiler \ + cpio \ + git \ + gzip \ + file \ + && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/* --=20 2.25.1 From nobody Thu Nov 28 05:34:23 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=1678145613; cv=none; d=zohomail.com; s=zohoarc; b=eiKm6JbtYZBA0gk4GqGtkd8p//Waowse9ZHkbcw3qKo9kTY+G4E/VDIFSMCCFp56OBpJ0D9nDfD2WFSjr53SjjTqheMoB2pXnEoutS0Jq+36I1jWOxOnOmUzuQO+n9Lm3VmbfHt7F2g3xLpuQPdfusEY6sROhaxVZ5OoINR+QpM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678145613; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5hUuaxrpzk8cXSJxQL4UAmMAErbx0W3MzHQeInY5niU=; b=hMIpoDtBvRHglbBAw8Qd48ucIM86tOPDdN8gQwfmXHhuzioq0UbgZ4uVamlnFxcbjOOAsduzFgWB2g9JREvRb32o8DPlXuRu6y/oy4sokexI2onfQBf9n1apJIbd5oE0/bH0jeXcN3UFZhp50j3Kpd5RuoeUVVAoOsZKXvoSPUg= 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) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1678145613224895.1536986474189; Mon, 6 Mar 2023 15:33:33 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.507157.780400 (Exim 4.92) (envelope-from ) id 1pZKKX-0006AP-45; Mon, 06 Mar 2023 23:33:21 +0000 Received: by outflank-mailman (output) from mailman id 507157.780400; Mon, 06 Mar 2023 23:33:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pZKKX-0006AA-0d; Mon, 06 Mar 2023 23:33:21 +0000 Received: by outflank-mailman (input) for mailman id 507157; Mon, 06 Mar 2023 23:33:20 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pZKKW-00069I-68 for xen-devel@lists.xenproject.org; Mon, 06 Mar 2023 23:33:20 +0000 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 44ed0765-bc77-11ed-a550-8520e6686977; Tue, 07 Mar 2023 00:33:17 +0100 (CET) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 064B9B811C6; Mon, 6 Mar 2023 23:33:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14934C4339B; Mon, 6 Mar 2023 23:33:13 +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: 44ed0765-bc77-11ed-a550-8520e6686977 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678145594; bh=uhzeii5n7Qy0ZyMfDNous4nsNcRWOwJZPRNM3k7M6uo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BA+31gx73s6hcDPRyQxLt+ODJdtzH4VusuOrN+MNmupVkbVvMB4SNLniUvl81z6bX wcxU5hxYdUgmmiMjYK9jJFcy9gHYmskSmOp7H893G0wy4cdQNtOdm7Jh8gTMM7qnIK tskmvRX1h6bBDNBdn5rXMgPy0vanj+KsJ/XO4DEUkgfyhSwKq5bzMS3SblzIIxL6lU nQkXw2jQdNIbGKRu8D8L/OJizfUmaqLIzljJa1iK46n8jjk2yFmfwoBnVkZeDwh6QF qqOp/8+gC9qvYQc5oM5tl1kF1WzkOIRxh+ZoHnYsmFuE9vlnibQ0AKuaJImk0Dp3cq 7SkSMdQ1dIOEg== From: Stefano Stabellini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, cardoe@cardoe.com, michal.orzel@amd.com, Stefano Stabellini Subject: [PATCH v3 2/2] automation: introduce a dom0less test run on Xilinx hardware Date: Mon, 6 Mar 2023 15:33:10 -0800 Message-Id: <20230306233310.1993693-2-sstabellini@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1678145613914100002 Content-Type: text/plain; charset="utf-8" From: Stefano Stabellini The test prepares dom0 and domU binaries and boot artifacts, similarly to the existing QEMU test. (TBD: share preparation steps with the regular QEMU tests.) However, instead of running the test inside QEMU as usual, it copies the binaries to the tftp server root, triggers a Xilinx ZCU102 board reboot, and connects to the real serial of the board. For now and due to its novelty, allow_failure on the Xilinx hardware test, and only run the job on protected branches with XILINX_JOBS set to true (the "master" and "staging" on gitlab.com/xen-project/xen qualify). Signed-off-by: Stefano Stabellini Reviewed-by: Michal Orzel --- Changes in v3: - use a template to make it easier to create other xilinx jobs - export dtbs as artifacts - use 0x7ff00000 as MEMORY_END - rename mpsoc.dtb to mpsoc_smmu.dtb - add dtuart=3Dserial0 to XEN_CMD - stop the board after usage to save power Changes in v2: - only execute the xilinx job on protected branches with XILINX_JOBS set to true --- automation/gitlab-ci/test.yaml | 26 ++++ .../scripts/xilinx-smoke-dom0less-arm64.sh | 122 ++++++++++++++++++ 2 files changed, 148 insertions(+) create mode 100755 automation/scripts/xilinx-smoke-dom0less-arm64.sh diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index 1c5f400b68..61491cf2d6 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -67,6 +67,24 @@ tags: - x86_64 =20 +.xilinx-arm64: + extends: .test-jobs-common + variables: + CONTAINER: ubuntu:xenial-xilinx + LOGFILE: qemu-smoke-xilinx.log + artifacts: + paths: + - smoke.serial + - '*.log' + - '*.dtb' + when: always + allow_failure: true + only: + variables: + - $XILINX_JOBS =3D=3D "true" && $CI_COMMIT_REF_PROTECTED =3D=3D "tru= e" + tags: + - xilinx + # Test jobs build-each-commit-gcc: extends: .test-jobs-common @@ -85,6 +103,14 @@ build-each-commit-gcc: tags: - x86_64 =20 +xilinx-smoke-dom0less-arm64-gcc: + extends: .xilinx-arm64 + script: + - ./automation/scripts/xilinx-smoke-dom0less-arm64.sh 2>&1 | tee ${LOG= FILE} + needs: + - *arm64-test-needs + - alpine-3.12-gcc-arm64 + qemu-smoke-dom0-arm64-gcc: extends: .qemu-arm64 script: diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation= /scripts/xilinx-smoke-dom0less-arm64.sh new file mode 100755 index 0000000000..82158ab7ea --- /dev/null +++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh @@ -0,0 +1,122 @@ +#!/bin/bash + +set -ex + +test_variant=3D$1 + +if [ -z "${test_variant}" ]; then + passed=3D"ping test passed" + domU_check=3D" +until ifconfig eth0 192.168.0.2 &> /dev/null && ping -c 10 192.168.0.1; do + sleep 30 +done +echo \"${passed}\" +" +fi + +# DomU +mkdir -p rootfs +cd rootfs +tar xzf ../binaries/initrd.tar.gz +mkdir proc +mkdir run +mkdir srv +mkdir sys +rm var/run +echo "#!/bin/sh + +${domU_check} +/bin/sh" > etc/local.d/xen.start +chmod +x etc/local.d/xen.start +echo "rc_verbose=3Dyes" >> etc/rc.conf +find . | cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz +cd .. +rm -rf rootfs + +# DOM0 rootfs +mkdir -p rootfs +cd rootfs +tar xzf ../binaries/initrd.tar.gz +mkdir proc +mkdir run +mkdir srv +mkdir sys +rm var/run +cp -ar ../binaries/dist/install/* . + +echo "#!/bin/bash + +export LD_LIBRARY_PATH=3D/usr/local/lib +bash /etc/init.d/xencommons start + +/usr/local/lib/xen/bin/init-dom0less + +brctl addbr xenbr0 +brctl addif xenbr0 eth0 +ifconfig eth0 up +ifconfig xenbr0 up +ifconfig xenbr0 192.168.0.1 + +xl network-attach 1 type=3Dvif +${dom0_check} +" > etc/local.d/xen.start +chmod +x etc/local.d/xen.start +echo "rc_verbose=3Dyes" >> etc/rc.conf +find . | cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz +cd .. + + +TFTP=3D/scratch/gitlab-runner/tftp +START=3D`pwd` + +# ImageBuilder +echo 'MEMORY_START=3D"0" +MEMORY_END=3D"0x7ff00000" + +DEVICE_TREE=3D"mpsoc_smmu.dtb" +XEN=3D"xen" +DOM0_KERNEL=3D"Image" +DOM0_RAMDISK=3D"dom0-rootfs.cpio.gz" +XEN_CMD=3D"console=3Ddtuart dtuart=3Dserial0 dom0_mem=3D1024M" + +NUM_DOMUS=3D1 +DOMU_KERNEL[0]=3D"Image" +DOMU_RAMDISK[0]=3D"domU-rootfs.cpio.gz" +DOMU_MEM[0]=3D"1024" + +LOAD_CMD=3D"tftpb" +UBOOT_SOURCE=3D"boot.source" +UBOOT_SCRIPT=3D"boot.scr"' > $TFTP/config + +cp -f binaries/xen $TFTP/ +cp -f binaries/Image $TFTP/ +cp -f binaries/dom0-rootfs.cpio.gz $TFTP/ +cp -f binaries/domU-rootfs.cpio.gz $TFTP/ +# export dtb to artifacts +cp $TFTP/mpsoc_smmu.dtb . + +rm -rf imagebuilder +git clone https://gitlab.com/ViryaOS/imagebuilder +bash imagebuilder/scripts/uboot-script-gen -t tftp -d $TFTP/ -c $TFTP/conf= ig + +# restart the board +cd /scratch/gitlab-runner +bash zcu102.sh 2 +sleep 5 +bash zcu102.sh 1 +sleep 5 +cd $START + +# connect to serial +set +e +stty -F /dev/ttyUSB0 115200 +timeout -k 1 120 nohup sh -c "cat /dev/ttyUSB0 | tee smoke.serial" + +# stop the board +cd /scratch/gitlab-runner +bash zcu102.sh 2 +cd $START + +set -e +(grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" sm= oke.serial) || exit 1 +exit 0 --=20 2.25.1