From patchwork Wed Oct 23 02:53:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Lira, Victor M" X-Patchwork-Id: 13846363 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC93AD2E008 for ; Wed, 23 Oct 2024 02:54:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.824390.1238519 (Exim 4.92) (envelope-from ) id 1t3RVi-0004gg-Ok; Wed, 23 Oct 2024 02:54:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 824390.1238519; Wed, 23 Oct 2024 02:54:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t3RVi-0004gZ-La; Wed, 23 Oct 2024 02:54:10 +0000 Received: by outflank-mailman (input) for mailman id 824390; Wed, 23 Oct 2024 02:54:09 +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 1t3RVh-0004gR-1s for xen-devel@lists.xenproject.org; Wed, 23 Oct 2024 02:54:09 +0000 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on20604.outbound.protection.outlook.com [2a01:111:f403:2405::604]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 113cc05f-90ea-11ef-a0be-8be0dac302b0; Wed, 23 Oct 2024 04:54:06 +0200 (CEST) Received: from BN0PR02CA0038.namprd02.prod.outlook.com (2603:10b6:408:e5::13) by SA1PR12MB7317.namprd12.prod.outlook.com (2603:10b6:806:2ba::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Wed, 23 Oct 2024 02:54:01 +0000 Received: from MN1PEPF0000ECDB.namprd02.prod.outlook.com (2603:10b6:408:e5:cafe::bf) by BN0PR02CA0038.outlook.office365.com (2603:10b6:408:e5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Wed, 23 Oct 2024 02:54:01 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000ECDB.mail.protection.outlook.com (10.167.242.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8093.14 via Frontend Transport; Wed, 23 Oct 2024 02:54:00 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 22 Oct 2024 21:54:00 -0500 Received: from xsjwoods50.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 22 Oct 2024 21:53:59 -0500 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: 113cc05f-90ea-11ef-a0be-8be0dac302b0 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Xmn6vsprNPQx8qmC/pIFoK4N7j5tbO8CYLCdOzXPCtVOkULdb6xJEDIfC14jw9OKX14BlcPB7FK0iMB6UiEBA9zVilqHpe0bF7kI9ERfAGwLwfDdPhapYTTKoIlUUjk9OZkN31GPjxTAHfKpQYi65NZiLIT47R1wFfDaKuOckNcIFJgZrFPUSWA8R4LU2yIwB1FTazk4n4j9r+5LYB/Op3mAQKYrzF3wOIMha9SGIgWbzm8AIp1I3MCWWcQMQcno3xID6BD41v3SenLnIKhUFGu7bb93Usok4V9KpaYNteaeR2Ul7Gll5WqRHfmffyqgFou/J4myWvQzCn74+klk6g== 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=+sGK78ck5V/PWYqHizZQ0QQoDxKmDUIh5FH+r9yUkao=; b=LT4D1blYMGEzRkzAOdn4ktUueoOywaZzfslqZodEMVK+i42v0p6A68vzxVJxQtBqZ3XZGztTtY0IyNsShJ4hSvio3o7oXKKTBSnNuVdTB2rpE88RQbDXmLjRdtygnnbMtRcEDO5GhkbP5J1qDWIYX0ibuD2w5HI4iV+agyGRfuIGss5FBEk3lu+MI+efKuR+KQCs9ztwxYynQBmiUgFOFOFgnIOa/srJN5cMh9ch0b7Na+Oq9SIpbA7rJJ1oPnFTO0TwQ4aL/UoOns96R/aDR0vLjWqBNk3uAiVoRMxBqz0q2LdQYKzGsUHYHVNMk1ZQBjlkxjaf67MXXK+OtItf8Q== 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+sGK78ck5V/PWYqHizZQ0QQoDxKmDUIh5FH+r9yUkao=; b=p0Dfjl4Vc0/JbgsD0cWc5olu2bbQ8keyRfidRa82m1esyymF14TRVSWyOSF74VZLT+AMsAKZ5Pos7RA7lrPc3eiCpADR3fjoHzWknrEJuJM6AtrmIUA2GL27XMPkqQ3mTTLzB9s2qSpcvoVST8ACd7SKAs1VixfHthl8cGLn67c= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: To: CC: Stefano Stabellini , Andrew Cooper , Victor Lira , =?utf-8?q?Marek_Marczykowski-G=C3=B3rec?= =?utf-8?q?ki?= , Doug Goldstein Subject: [RFC TEST_ARTIFACTS PATCH 1/2] artifacts: Initial commit Date: Tue, 22 Oct 2024 19:53:33 -0700 Message-ID: <21a6030f352282d822c30de4a1e7ecab9a8c0a99.1729649255.git.victorm.lira@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: victorm.lira@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECDB:EE_|SA1PR12MB7317:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e4f408c-6c20-411b-4fb0-08dcf30df298 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?q?xI8kZd21N/Np/sZrXrKWUxE6eCdRdd5?= =?utf-8?q?7ndr7h+/3hXN0DtQTmKhLSv+qDPithZ7OF/a5DptcIFaOzaFkHhjBEG8MlvgAnhON?= =?utf-8?q?/HIbmF0m3LemNskPSImNsBb4igowF8BVzL1KG99pn27JppOnvsrWzAxFu4V7aMDJu?= =?utf-8?q?yz85/ROPVTxbNJY4B1yvHQ2qDeL+f2zo5MZ4yG5vg2scg398iiIWF0ewcdkqY4K2U?= =?utf-8?q?RdExkZiJoH7fS/vOnAZIeZGKHaA6gBE/zpkTvTXFp1wcgXwEe4LQ+sb1gHZi3lRey?= =?utf-8?q?BhNvRIPrDwV1x14guQulGlzH4ObItdEuGcPqXc6SUe6spAczrW7NrGSj5Orhnro10?= =?utf-8?q?9TgBDZTHFW1qxmJKkUkARIppVhx/JdZzSBfF4yWORRx65YVRRYQps4GhgWBXjmFVV?= =?utf-8?q?ly7EqNxKAXrSNM794a0jpixKX8ay+CxAOd114lRoDFo0JlrRTdjeGz13WiMr6F84W?= =?utf-8?q?+rWK4z0WchUAnIWIWSkOJQLJ1zWc/7+GfGKjGp3FoIHy81bOskH8Kxo9Rs5IssL7f?= =?utf-8?q?Ht87VaMhFvf3sS/CAMdzsYLwob3tGT5eWGkBvoW9cfpO2jMUDYBdpKCog1gkocuBS?= =?utf-8?q?/eGj10CuAu5lYd6VFWlM5u2MyxvM6jYq7lgQKi7rkV/HA2REI1k79SIFgcIszSl6U?= =?utf-8?q?HYslkH9VUEIIPlb44jogumCJ6kLwOXS2zLiUC8Au1afDqV4PVCoc3bgOttudNpTn3?= =?utf-8?q?oIFr7WwjyirFmxbgOZgX1h1wCaNWJPMEb1T1iVWsVWU3DcEBVBt2wysqCOlz9VWBv?= =?utf-8?q?gXOqsFyKrXcLpkLWc4ErtKZEU3OqRq3tFTub+yi+fUHsc4e0/sipQiLJkvxavi3/n?= =?utf-8?q?W7RTxHWFK2QXWBKMMT4vW65VUiiLNDYN7YWbslc1V+KrvZWKCO5314PLd79kbQBHp?= =?utf-8?q?CLpUEqRCEr6vcdquIto72eYjXeB85uNi7HXtvbmxlXyk0FsRG7wjBivIJ0GG7emQD?= =?utf-8?q?5ACl+E4iIGBAG6fDM0pTS9C67VzZiEZVPT4iC9xsZZGS2Thempi/qCawjXyKfMwxA?= =?utf-8?q?8xDxsdJVVb49+jt3FQLufJbk0mcru7XvYjtB63sW+Ew0GYKg1zVGbjIWbSCqYVLzV?= =?utf-8?q?U3KInQu58BYngZVmRuuUGCPq3k89GfZOCUSuNGEXR8xT8MhCvTFtH2UeFMipBz6hv?= =?utf-8?q?nGUyVQ5ExT/LDefVoj73JrCSr4+wpGQXHFooQA+b/7eHY4Ewbf7mHZEqIVjPmEfhC?= =?utf-8?q?xHpogDxed+2VBFjnKuBN67h6N4N/fR89FCfCUKis1CMvxrqxdq8JX7QyLdMJVquhi?= =?utf-8?q?SSasOlwak3B4mxCnvAvIK9QyY69q55mRxr9jZkt1yVoBhf6lXOhbGymo=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2024 02:54:00.9335 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e4f408c-6c20-411b-4fb0-08dcf30df298 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECDB.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7317 From: Stefano Stabellini Create new repository to produce common artifacts for Xen tests Requested-by: Andrew Cooper Signed-off-by: Victor Lira --- Cc: Andrew Cooper Cc: Marek Marczykowski-Górecki Cc: Doug Goldstein Cc: Stefano Stabellini Cc: xen-devel@lists.xenproject.org --- .gitlab-ci.yml | 48 ++++++++++++++++++++ README.md | 10 ++++ binaries/.gitignore | 3 ++ images/Makefile | 20 ++++++++ images/alpine/x86_64-build.dockerfile | 25 ++++++++++ images/alpine/x86_64-rootfs.dockerfile | 4 ++ scripts/x86_64-argo-linux.sh | 63 ++++++++++++++++++++++++++ scripts/x86_64-kernel-linux.sh | 31 +++++++++++++ scripts/x86_64-rootfs-alpine.sh | 58 ++++++++++++++++++++++++ 9 files changed, 262 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 README.md create mode 100644 binaries/.gitignore create mode 100644 images/Makefile create mode 100644 images/alpine/x86_64-build.dockerfile create mode 100644 images/alpine/x86_64-rootfs.dockerfile create mode 100755 scripts/x86_64-argo-linux.sh create mode 100755 scripts/x86_64-kernel-linux.sh create mode 100755 scripts/x86_64-rootfs-alpine.sh -- 2.25.1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f2f7738 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,48 @@ +workflow: + name: "xen test artifacts" + +.artifacts: + stage: build + image: + name: registry.gitlab.com/xen-project/people/victormlira/test-artifacts/${CONTAINER} + artifacts: + name: "${CI_JOB_NAME_SLUG}" + paths: + - binaries/ + +.x86_64-artifacts: + extends: .artifacts + image: + docker: + platform: linux/amd64 + user: xenproject + variables: + CONTAINER: alpine:x86_64-build + tags: + - x86_64 + +x86_64-kernel-linux-6.6.56: + extends: .x86_64-artifacts + script: + - . scripts/x86_64-kernel-linux.sh + variables: + LINUX_VERSION: 6.6.56 + +x86_64-rootfs-alpine-3.18: + extends: .x86_64-artifacts + variables: + CONTAINER: alpine:x86_64-rootfs + image: + docker: + user: root + script: + - . scripts/x86_64-rootfs-alpine.sh + +x86_64-argo-linux-6.6.56: + extends: .x86_64-artifacts + script: + - . scripts/x86_64-argo-linux.sh + variables: + LINUX_VERSION: 6.6.56 + ARGO_SHA: "705a7a8a624b42e13e655d3042059b8a85cdf6a3" + ARGOEXEC_SHA: "d900429f6640acc6f68a3d3a4c945d7da60625d8" diff --git a/README.md b/README.md new file mode 100644 index 0000000..0d72519 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Xen Project Test Artifacts + +## Overview + +This repository is used to produce common artifacts for Xen tests. + +## + + +## diff --git a/binaries/.gitignore b/binaries/.gitignore new file mode 100644 index 0000000..95e2a2e --- /dev/null +++ b/binaries/.gitignore @@ -0,0 +1,3 @@ +# Keep this directory around to be available in CI/CD jobs. +* +!.gitignore diff --git a/images/Makefile b/images/Makefile new file mode 100644 index 0000000..41638d7 --- /dev/null +++ b/images/Makefile @@ -0,0 +1,20 @@ + +# The base of where these containers will appear +REGISTRY := registry.gitlab.com/xen-project/people/victormlira/test-artifacts +CONTAINERS = $(subst .dockerfile,,$(wildcard */*.dockerfile)) + +help: + @echo "Containers to build test artifacts." + @echo "To build one run 'make DISTRO/TAG'." + @echo "Available containers:" + @$(foreach file,$(sort $(CONTAINERS)),echo ${file};) + @echo "To push container builds, set the environment variable PUSH" + +%: %.dockerfile ## Builds containers + docker build --pull -t $(REGISTRY)/$(@D):$(@F) -f $< $(&2 echo "LINUX_VERSION must be set"; exit 1 +fi + +set -ex -o pipefail + +BUILDDIR="${PWD}" +COPYDIR="${BUILDDIR}/binaries/" + +# Prepare Linux sources +curl -fsSLO \ + https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"${LINUX_VERSION}".tar.xz +tar xJf linux-"${LINUX_VERSION}".tar.xz +cd linux-"${LINUX_VERSION}" +make ARCH=x86 defconfig +make ARCH=x86 xen.config +./scripts/config --enable BRIDGE +./scripts/config --enable IGC +./scripts/config --enable TUN +cp .config .config.orig +cat .config.orig \ + | grep 'XEN' \ + | grep '=m' \ + | sed 's/=m/=y/g' \ + >> .config +make ARCH=x86 olddefconfig +make ARCH=x86 modules_prepare + +# Build Linux kernel module for Xen Argo +cd "${BUILDDIR}" +git clone \ + --depth=1 --branch=master \ + https://github.com/OpenXT/linux-xen-argo.git +git -C "${BUILDDIR}/linux-xen-argo" switch --detach "${ARGO_SHA}" +make -C "linux-${LINUX_VERSION}" M="${BUILDDIR}/linux-xen-argo/argo-linux" \ + CFLAGS_MODULE="-Wno-error" KBUILD_MODPOST_WARN=1 +cp "linux-xen-argo/argo-linux/xen-argo.ko" "${COPYDIR}/xen-argo.ko" + +# Build Linux libargo shared library, applying fixes to build in Alpine Linux +cd "${BUILDDIR}/linux-xen-argo/libargo" +sed -i "s|AM_INIT_AUTOMAKE|AC_CONFIG_AUX_DIR(.)\nAM_INIT_AUTOMAKE|" configure.ac +sed -i "s/__SOCKADDR_COMMON (sxenargo_)/sa_family_t sxenargo_family/" src/libargo.h +sed -i "s/__SOCKADDR_COMMON_SIZE/(sizeof (unsigned short int))/" src/libargo.h +autoreconf --install +./configure --prefix="${COPYDIR}" CPPFLAGS="-I${PWD}/../argo-linux/include" +make +make install + +# Build Linux user program, modifying for xilinx argo test +cd "${BUILDDIR}" +wget "https://raw.githubusercontent.com/OpenXT/xenclient-oe/${ARGOEXEC_SHA}/\ +recipes-openxt/argo-exec/argo-exec/argo-exec.c" +sed -i "s|#include ||" argo-exec.c +sed -i "s|ret = shuffle(s, fds\[0\], fds\[1\]);|ret = shuffle(s, 0, 1);|" \ + argo-exec.c +gcc -I"${BUILDDIR}/linux-xen-argo/libargo/src" \ + -I"${BUILDDIR}/linux-xen-argo/argo-linux/include" \ + -L"${COPYDIR}/lib/" \ + -o argo-exec argo-exec.c -largo +cp argo-exec "${COPYDIR}" diff --git a/scripts/x86_64-kernel-linux.sh b/scripts/x86_64-kernel-linux.sh new file mode 100755 index 0000000..17be36b --- /dev/null +++ b/scripts/x86_64-kernel-linux.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +if test -z "${LINUX_VERSION}" +then + >&2 echo "LINUX_VERSION must be set"; exit 1 +fi + +set -ex -o pipefail + +WORKDIR="${PWD}" +COPYDIR="${WORKDIR}/binaries/" + +# Build Linux +curl -fsSLO \ + https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"${LINUX_VERSION}".tar.xz +tar xJf linux-"${LINUX_VERSION}".tar.xz +cd linux-"${LINUX_VERSION}" +make ARCH=x86 defconfig +make ARCH=x86 xen.config +./scripts/config --enable BRIDGE +./scripts/config --enable IGC +./scripts/config --enable TUN +cp .config .config.orig +cat .config.orig \ + | grep 'XEN' \ + | grep '=m' \ + | sed 's/=m/=y/g' \ + >> .config +make ARCH=x86 olddefconfig +make ARCH=x86 "-j$(nproc)" --quiet +cp arch/x86/boot/bzImage "${COPYDIR}" diff --git a/scripts/x86_64-rootfs-alpine.sh b/scripts/x86_64-rootfs-alpine.sh new file mode 100755 index 0000000..28d8e30 --- /dev/null +++ b/scripts/x86_64-rootfs-alpine.sh @@ -0,0 +1,58 @@ +WORKDIR="${PWD}" + +apk update + +# xen runtime deps +apk add musl +apk add libgcc +apk add openrc +apk add busybox +apk add sudo +apk add dbus +apk add bash +apk add python3 +apk add zlib +apk add ncurses +apk add yajl +apk add libaio +apk add xz +apk add util-linux +apk add argp-standalone +apk add libfdt +apk add glib +apk add pixman +apk add curl +apk add udev +apk add pciutils +apk add libelf + +# Xen +cd / +# Minimal ramdisk environment in case of cpio output +rc-update add udev +rc-update add udev-trigger +rc-update add udev-settle +rc-update add loopback sysinit +rc-update add bootmisc boot +rc-update add devfs sysinit +rc-update add dmesg sysinit +rc-update add hostname boot +rc-update add hwclock boot +rc-update add hwdrivers sysinit +rc-update add modules boot +rc-update add killprocs shutdown +rc-update add mount-ro shutdown +rc-update add savecache shutdown +rc-update add local default +cp -a /sbin/init /init +echo "ttyS0" >> /etc/securetty +echo "hvc0" >> /etc/securetty +echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab +echo "hvc0::respawn:/sbin/getty -L hvc0 115200 vt100" >> /etc/inittab +echo > /etc/modules +passwd -d "root" root + +# Create rootfs +cd / +tar cvzf "${WORKDIR}/binaries/initrd.tar.gz" \ + bin dev etc home init lib mnt opt root sbin usr var From patchwork Wed Oct 23 02:53:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Lira, Victor M" X-Patchwork-Id: 13846365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 964EAD2E00A for ; Wed, 23 Oct 2024 02:55:02 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.824395.1238540 (Exim 4.92) (envelope-from ) id 1t3RWK-0005Os-8P; Wed, 23 Oct 2024 02:54:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 824395.1238540; Wed, 23 Oct 2024 02:54:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t3RWK-0005Oj-4q; Wed, 23 Oct 2024 02:54:48 +0000 Received: by outflank-mailman (input) for mailman id 824395; Wed, 23 Oct 2024 02:54:47 +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 1t3RWJ-00051s-Dp for xen-devel@lists.xenproject.org; Wed, 23 Oct 2024 02:54:47 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20623.outbound.protection.outlook.com [2a01:111:f403:2414::623]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 27c64948-90ea-11ef-99a3-01e77a169b0f; Wed, 23 Oct 2024 04:54:44 +0200 (CEST) Received: from SJ0PR03CA0289.namprd03.prod.outlook.com (2603:10b6:a03:39e::24) by SJ0PR12MB8614.namprd12.prod.outlook.com (2603:10b6:a03:47d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.17; Wed, 23 Oct 2024 02:54:40 +0000 Received: from MWH0EPF000971E4.namprd02.prod.outlook.com (2603:10b6:a03:39e:cafe::4d) by SJ0PR03CA0289.outlook.office365.com (2603:10b6:a03:39e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Wed, 23 Oct 2024 02:54:40 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by MWH0EPF000971E4.mail.protection.outlook.com (10.167.243.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8093.14 via Frontend Transport; Wed, 23 Oct 2024 02:54:39 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 22 Oct 2024 21:54:21 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 22 Oct 2024 21:53:54 -0500 Received: from xsjwoods50.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 22 Oct 2024 21:53:53 -0500 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: 27c64948-90ea-11ef-99a3-01e77a169b0f ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XytwHAvdDHcr5eRiKnl1osTaOOwQ8Up/1c+apxrZcJzcFOKMOXjic5jQ6U1cDnu7Go65TYSwWzk2Se0SHuTTSgf+5VabhtHAzOU4s1CrqxBNsvDn5HP1GDW+lXXfjrgmCGIzNktIOLjUSZx88booIsEDikHC6OCoYQEUMWJpAzmwhVbMtkwJZ/wWp3qLhyMoLKZcP2avMI8FX795T7z/lDYJ8HflPJS39FJQ+MUgdsx38WH0bLmeczfsVPVqZJGFkvGqMo4BezaX2yLYHq8/AhFdPmqPhnhVOpVYesRU8FIwcuXmoSSN1tz20tpSNROmn7NWAeX0WcMr4WpcF4eG+g== 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=mF7ANZG41NOeCcW0ViemgBipnamMUigTtUgKtlTP+LU=; b=zEm6sGIny4LNy2UwaD38FRPDtKK+OfsaimFAwVOZFHIQ3QhQ+2p3OD9slhUHL3KeaWcoc4HquMhGWuzkPqMHrbsdTvWZh1rg6ehg3aW7hixRkSCF/3LdqhPsvq6lq7JgpdleYHCTIYuvzkUUfNSPXI93ejd1R4caxxp+Zz9SSygJ1AvuINK0aTheZJqC4xHFMxT4FvA6jwRuqT65gIHfmsUqXLqJfxGG2K+u64q7XPcLvV6Yz4bxQiYjmEXQwVvpawmZ6qC8M0fEOLhG7FWRdlGFsrEKq2bL4I0CfjTvGbi/kpSUAYXlsWGk1rvJEbeTHK4c1tVLqAi4bvQq6n1ZBQ== 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mF7ANZG41NOeCcW0ViemgBipnamMUigTtUgKtlTP+LU=; b=MhkDIJ7QBikIb87bSAzCfg92+VzoU90ZMzA9xMmtScg1a+kQ35rLUTqcLEp8Xuzsgb8AuZTloMwLt8F8ik1eRRRFnqQQbVz5RWoTE7GgpctJ46kp9EURaWO3FAiZFsjNXL8JzKimiuU/Lg5/JWpi8Mjh4/ZSpab3AxoO542DQw8= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: To: CC: Victor Lira , Andrew Cooper , =?utf-8?q?Marek_Marczykowski-G?= =?utf-8?q?=C3=B3recki?= , Doug Goldstein , Stefano Stabellini Subject: [RFC XEN PATCH 2/2] automation: add xilinx test (linux argo) Date: Tue, 22 Oct 2024 19:53:32 -0700 Message-ID: <17124c911858ccb2842598cd9b9b3c88c4d4dd28.1729649076.git.victorm.lira@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <21a6030f352282d822c30de4a1e7ecab9a8c0a99.1729649255.git.victorm.lira@amd.com> References: MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: victorm.lira@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E4:EE_|SJ0PR12MB8614:EE_ X-MS-Office365-Filtering-Correlation-Id: fc9ee032-614c-4728-7758-08dcf30e0993 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?q?XbFLzzlO81jDnLkFSqm5cnViRxHBd7D?= =?utf-8?q?0b/lgvnPdIlzW/HcmtagK74A45e3cw6XYT1HYrfiWDggp5t0+hOl4s696OwsnmGil?= =?utf-8?q?uoE08BWEq+EnIT5lvR7peVayaIz0DcYfMCdTW4n68GLZPUuoTZIMtZnonyndjxVz6?= =?utf-8?q?MG9NRQefxcX9KzplhogIas9EuPZnk0hMUpaQV2B7bvYDPpAwxA+AVCkOp1tVdbn0Z?= =?utf-8?q?P2SwqENCkVDtrlBB5dRtgPM22mEWnDiJ/b8a6nAy8G3j1bQRa3uwI9BdmmkQC35op?= =?utf-8?q?ysRMcNee5LfzNaal3IW5VqrYOjxV/eN/rfBi+fm+is7Mg0H6UAGkl6FtxHcoykruG?= =?utf-8?q?UEOof5y15P1p7PJPjLQXlalZB06Xe1VRgbpyTWNtxLEpbrQEcTdk2xI8jWd0QIypq?= =?utf-8?q?9pxC4Iq+uZUxrwgBou4jm9dbHDJtyS/tqF4mrRyb7evdxKvjtjzFkBCygg9+3LeJF?= =?utf-8?q?Zfg9D8IS9Npyc5KYRjTkdNakMtsuPykLwc7zAcf42+bcqhleZUIURQCrrtchvEQhJ?= =?utf-8?q?FIpl3LK5Wqp9NnrI+jlR9DIytZVQ8u+G/ZUg4TccL+yvyOrMamw6nGQ6s+ibVQcmJ?= =?utf-8?q?QCwK3I3jcOBGRR6BrgpwTyZookH+a7ph9RErF8jqnc5orL7HgpFnZYYipIz5Ud2oA?= =?utf-8?q?jc5K8jx4pqe8kZB9DEQIckSCwi1l+52ttfxcUkhQYC79070XV8sfOARsDlOBdQr9C?= =?utf-8?q?5rleYIfzx1KHPM3pPGIhw5fJkctY3UBWrnpyqX+yeHqQr18YjVkdH+F4+0sU9FgKJ?= =?utf-8?q?ItwTSD77vscn7x/Q2RviUYTI0soXtch4+SuVQLWTU78YOMnCworHpyqVf5LHp5A8/?= =?utf-8?q?nRYgsLhlQsp13Bj9/OV4/rS9q4P0TdA+0ifA4HhOHl1Z1GUghXCo3yKJE+3gINRHl?= =?utf-8?q?u/4DbiJmck1JsIHx2regtLSjbKQ/2MjKnui3MpqTAVCRzTRmklqiWXzaXAO2Z1Srj?= =?utf-8?q?iw54e3xcFFeGD+qqyMtaNLEYdpukTJiqhZ1Qgv+GZMwgfx8M/rnR1FaribWvvdvwx?= =?utf-8?q?X9YCG+La0j76pOcnuaEzjE13pDDI+C5tcSz+jrQjGo0CGOeqYyM4XIEWWpkMcbDOH?= =?utf-8?q?Pe2fTD9gRI1bf3MtznD+BbAJNcOjWf9WgRPJGVqkYg4Wazjv8YvenM/UrTYc5kYiW?= =?utf-8?q?ulGFK+KiFiX3gBYxCE2A8n/pCjj7YhaNlCbYFe7cBERtHXTMqh3s9A1tUBXY/6hVu?= =?utf-8?q?MY8Br3uVQn/2wpxTQb4QQbLh6WgMYuB0xmyohf/VXOMmILb2zVT5++RTNlKzt8XOC?= =?utf-8?q?FUATOo8nI7B+LxMeljR0HPHiNQSSqzKnyj8RHM+K9AjsApzmE0kAaOLLgw9QZuR82?= =?utf-8?q?ujmacWZca7fiqDXP8fIUKcErTIhO6UGyag=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2024 02:54:39.3643 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc9ee032-614c-4728-7758-08dcf30e0993 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000971E4.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB8614 From: Victor Lira Add x86_64 hardware test that creates a Xen Argo communication connection between two PVH domains. In the test, dom0 creates a domU and listens for messages sent by the domU through Argo. To accomplish this, build Xen with CONFIG_ARGO=y. Update the xilinx x86_64 test script to support the new test, and add "sync_console" to command line to avoid an issue with console messages being lost. Signed-off-by: Victor Lira --- Cc: Andrew Cooper Cc: Marek Marczykowski-Górecki Cc: Doug Goldstein Cc: Stefano Stabellini Cc: xen-devel@lists.xenproject.org --- automation/gitlab-ci/build.yaml | 6 ++ automation/gitlab-ci/test.yaml | 16 ++++ .../scripts/xilinx-smoke-dom0-x86_64.sh | 76 +++++++++++++------ 3 files changed, 73 insertions(+), 25 deletions(-) -- 2.25.1 diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml index c2db69ecf8..f425744f8b 100644 --- a/automation/gitlab-ci/build.yaml +++ b/automation/gitlab-ci/build.yaml @@ -340,6 +340,12 @@ alpine-3.18-gcc-debug: variables: CONTAINER: alpine:3.18 BUILD_QEMU_XEN: y + EXTRA_XEN_CONFIG: | + CONFIG_EXPERT=y + CONFIG_UNSUPPORTED=y + CONFIG_ARGO=y debian-bookworm-gcc-debug: extends: .gcc-x86-64-build-debug diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index b27c2be174..2d4709d393 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -192,6 +192,22 @@ xilinx-smoke-dom0-x86_64-gcc-debug: - *x86-64-test-needs - alpine-3.18-gcc-debug +xilinx-smoke-dom0-x86_64-gcc-debug-argo: + extends: .xilinx-x86_64 + script: + - ./automation/scripts/xilinx-smoke-dom0-x86_64.sh argo 2>&1 | tee ${LOGFILE} + needs: + - alpine-3.18-gcc-debug + - project: xen-project/people/victormlira/test-artifacts + job: x86_64-kernel-linux-6.6.56 + ref: vml-tests-separate-artifacts + - project: xen-project/people/victormlira/test-artifacts + job: x86_64-rootfs-alpine-3.18 + ref: vml-tests-separate-artifacts + - project: xen-project/people/victormlira/test-artifacts + job: x86_64-argo-linux-6.6.56 + ref: vml-tests-separate-artifacts + adl-smoke-x86-64-gcc-debug: extends: .adl-x86-64 script: diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh index 7027f083ba..f70cfdc155 100755 --- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh +++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh @@ -9,6 +9,8 @@ fatal() { exit 1 } +WORKDIR="${PWD}" + # Test parameter defaults. TEST="$1" PASS_MSG="Test passed: ${TEST}" @@ -24,9 +26,10 @@ kernel = "/boot/vmlinuz" ramdisk = "/boot/initrd-domU" extra = "root=/dev/ram0 console=hvc0" memory = 512 -vif = [ "bridge=xenbr0", ] -disk = [ ] ' +DOMU_CFG_EXTRA="" +copy_domU_files () { :; } +copy_dom0_files () { :; } # Select test variant. if [ "${TEST}" = "ping" ]; then @@ -39,6 +42,14 @@ done echo \"${DOMU_MSG}\" " DOM0_CMD=" +brctl addbr xenbr0 +brctl addif xenbr0 eth0 +ifconfig eth0 up +ifconfig xenbr0 up +ifconfig xenbr0 192.168.0.1 +# get domU console content into test log +tail -F /var/log/xen/console/guest-domU.log 2>/dev/null | sed -e \"s/^/(domU) /\" & +xl create /etc/xen/domU.cfg set +x until grep -q \"${DOMU_MSG}\" /var/log/xen/console/guest-domU.log; do sleep 1 @@ -46,6 +57,34 @@ done set -x echo \"${PASS_MSG}\" " + DOMU_CFG_EXTRA=' +vif = [ "bridge=xenbr0", ] +disk = [ ] +' +elif [ "${TEST}" = "argo" ] +then + PASS_MSG="TEST: Message from DOMU" + XEN_CMD_EXTRA="argo=1,mac-permissive=1" + DOMU_CMD=" +insmod /root/xen-argo.ko +until false +do + echo \"${PASS_MSG}\" + sleep 1 +done | argo-exec -p 28333 -d 0 -- /bin/echo +" + DOM0_CMD=" +insmod /root/xen-argo.ko +xl create /etc/xen/domU.cfg +argo-exec -l -p 28333 -- /bin/echo +" +copy_dom0_files () +{ + cp "${WORKDIR}/binaries/xen-argo.ko" "root/" + cp -ar "${WORKDIR}/binaries/lib/"* "usr/local/lib/" + cp "${WORKDIR}/binaries/argo-exec" "usr/local/bin/" +} +copy_domU_files () { copy_dom0_files; } else fatal "Unknown test: ${TEST}" fi @@ -54,18 +93,18 @@ fi mkdir -p rootfs cd rootfs tar xzf ../binaries/initrd.tar.gz -mkdir proc -mkdir run -mkdir srv -mkdir sys +mkdir proc run srv sys rm var/run echo "#!/bin/sh - +set -x +export LD_LIBRARY_PATH=/usr/local/lib +PATH=/usr/local/bin:/usr/local/sbin:\$PATH ${DOMU_CMD} " > etc/local.d/xen.start chmod +x etc/local.d/xen.start echo "rc_verbose=yes" >> etc/rc.conf sed -i -e 's/^Welcome/domU \0/' etc/issue +copy_domU_files find . | cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz cd .. rm -rf rootfs @@ -74,37 +113,24 @@ rm -rf rootfs mkdir -p rootfs cd rootfs tar xzf ../binaries/initrd.tar.gz -mkdir boot -mkdir proc -mkdir run -mkdir srv -mkdir sys +mkdir boot proc run srv sys rm var/run cp -ar ../binaries/dist/install/* . echo "#!/bin/bash - +set -x export LD_LIBRARY_PATH=/usr/local/lib bash /etc/init.d/xencommons start - -brctl addbr xenbr0 -brctl addif xenbr0 eth0 -ifconfig eth0 up -ifconfig xenbr0 up -ifconfig xenbr0 192.168.0.1 - -# get domU console content into test log -tail -F /var/log/xen/console/guest-domU.log 2>/dev/null | sed -e \"s/^/(domU) /\" & -xl create /etc/xen/domU.cfg ${DOM0_CMD} " > etc/local.d/xen.start chmod +x etc/local.d/xen.start -echo "${DOMU_CFG}" > etc/xen/domU.cfg +echo "${DOMU_CFG}${DOMU_CFG_EXTRA}" > etc/xen/domU.cfg echo "rc_verbose=yes" >> etc/rc.conf echo "XENCONSOLED_TRACE=all" >> etc/default/xencommons echo "QEMU_XEN=/bin/false" >> etc/default/xencommons mkdir -p var/log/xen/console cp ../binaries/bzImage boot/vmlinuz cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU +copy_dom0_files find . | cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz cd .. @@ -116,7 +142,7 @@ cp -f binaries/bzImage ${TFTP}/${TEST_BOARD}/vmlinuz cp -f binaries/dom0-rootfs.cpio.gz ${TFTP}/${TEST_BOARD}/initrd-dom0 echo " net_default_server=10.0.6.1 -multiboot2 (tftp)/${TEST_BOARD}/xen ${XEN_CMDLINE} +multiboot2 (tftp)/${TEST_BOARD}/xen ${XEN_CMDLINE} sync_console module2 (tftp)/${TEST_BOARD}/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen module2 (tftp)/${TEST_BOARD}/initrd-dom0 boot