From patchwork Tue Mar 4 22:24:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 870129 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:178f:b0:38f:210b:807b with SMTP id e15csp492822wrg; Tue, 4 Mar 2025 14:26:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXUSRLzi0G/kNS8oJmGHQXAERDreZFeYwIcajEMSL5xcCNPCFwTqiaPkkDZcniYrPZGBcp4mA==@linaro.org X-Google-Smtp-Source: AGHT+IGEsluBXwKaMHkyPwkDlYckah6YSqwtzpBK5YcKYyFgKUtZ/9rUvrmTxPbrU4wLIWTthP6N X-Received: by 2002:a05:620a:6a04:b0:7c3:d316:1d8e with SMTP id af79cd13be357-7c3d8ed8f4dmr168848085a.53.1741127213151; Tue, 04 Mar 2025 14:26:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741127213; cv=none; d=google.com; s=arc-20240605; b=QehohWIC3DzH0p/NzrEKTm/R1LxRYymk456atyGTWJfpN7UpqMRhUqty9GgYo5ZRPS CDyyPEB8YY5c7u+8Ql9HSMwqW/wKRvlk0qQcP35GCOfP79Z9Eu15BNSfc1IJY9CQ87eK ZIer3qT1ONMO5BU1QP/8mKjKusurvRsSiXo3+V9OW5teBkqFOF110eh82/zb7SkbEmo1 Lo1Og2dVFCIMdJ2OBSqp+jeqbLYP7Q80ChiuNCtlz8eMT+rgsQjnL0DSg1vYPxwWzcRC MIU0JkYiDVwSgwI4L5gFTYcRsQrkRkFZA0G8fAXUL9TtXpWfUaebRaJq9VWzmqgg4V5O D1zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=axgWtiOkGGmP9jd5CQ2re9gHdvRfWCbPTPi2wsUSA58=; fh=6Bzz00MUAZSz1sM9FDoE/jB6E9D8TQzH70NWpntkZX8=; b=NaNnjCXi5iEzMQLCYQ/b3cvyZpRCjnMZsjtv6DkcTJ9APDvcqI6e2DYUDVH3LTuV8d E3om3YOltAk3wH6uYJA3F2rM0sHFJUPZtVXbgUsj8TffKogIcL8kJJyLIXUv9V+H6vDz fugn05BCl26vl6/rVAyamPXTjmjkrlxTgeBNqItMRDrwt7hvAtg+/hexS7NbWkG7vduI I6c4SLuopXZelOv5jttTJXKleJSNHrmFmWFYZZcbT87kCL17viP9uuVs5cj8jm7S/lut g9a+44h7wQQSPOcilaS1/qZhZcGF5pu4tE2iRQbSfBySJtj+UvASIYRwE8svgi1jyH+L DFzQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dhnGWLLQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c3bae179fasi509849785a.559.2025.03.04.14.26.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Mar 2025 14:26:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dhnGWLLQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tpaiN-0006Wc-9B; Tue, 04 Mar 2025 17:26:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tpagz-0005NB-Hu for qemu-devel@nongnu.org; Tue, 04 Mar 2025 17:24:49 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpagx-0006UR-0E for qemu-devel@nongnu.org; Tue, 04 Mar 2025 17:24:49 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5e4f88ea298so7976110a12.2 for ; Tue, 04 Mar 2025 14:24:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741127085; x=1741731885; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=axgWtiOkGGmP9jd5CQ2re9gHdvRfWCbPTPi2wsUSA58=; b=dhnGWLLQbGIzOxQrOw83CLA2CcSX5avf3XWN9UQJbDgGiE7A9w2RMCoAySV0j7VfuD gZaO5MrHCscIWneOVPRE2U5CD6GkxmFRZ0153AAiylmogYv3MOKI4D006txsXgIWEPgr W+qlgOp/5XRqZq8eicrv1zXdIX/Dd5Uz+uYVxjoekBtXwdMqcR2QrmlAj9IJ40esgM+Z X1qVk6KBujWmCkxDVeO4temALdlxuISaRu7KVBERxVX4LNmmH2pBGk40WvpLZoX2q4qm BlFXYk7PSuPZw1RkkdQNHynWcJfOESkWHY0lolJjkdf01zflRhFVJdVadhqWLvrr96w1 fNwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741127085; x=1741731885; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=axgWtiOkGGmP9jd5CQ2re9gHdvRfWCbPTPi2wsUSA58=; b=ejDKwtFKstL7GG3BS7KOiLwlaLNJ1pEQCrYVpxgDljo89TXWyRKE4csJupy8QZV/Pt h9RX5nkh70Qk4vmncJ1wzjTXoZ/0M/3X8Fp68oPeB+esy7mQtPkQNS3MeLMvhTSGeIQg tdKw87WP6w8IJQiOaBxFq9Z18bqu1ogfYOn34Df9WktF6tjXfVzVjdgQEu7wTQIL9mUU BWPN5Ss2CPHXsnscRiQARRslDVPZ028N04Aq8EWbPueIwy57z+2SBaZ+c8ku9JOCC1rh xw9a0XtcMdrk1xHG8ICJWl123djhpTMHpfOg6wC6VCb4hQqux2dLeg2d58syNsoydDiE /inA== X-Gm-Message-State: AOJu0YwbQZPE4CUfzgr7x7JQHbVaTcnfL6lHXvEgb8oOZZl85mi+Ugu8 JVeh3iGpFG3ImLT8tnVxff71H/pwdHUTS/FGQnOXhMPTt6mUnCyTSrficlqi3nE= X-Gm-Gg: ASbGncvRSVqWoNDnDYHvfhPBhBnwLYrEl2nt/rPh2Eff7iIekYL2+epFVVqWBxp9dWz bEd+A/4l7pmU4JwslKGZfxGNxFnYldIv1C6y++avUOwnYEV9eEt6M8KzMGvwFHppTSHxlSJAldU KuYR42P/Iwixn8u4I0l3lSb5/o4xv21olvhtCqROP5p59Fz2mcw6+Awx/uRfqFg3esYUsjEVgPL YJx8wa9oKx49caXucCvyYTr9YfNwFIjFR76qoDySVlFRSle6xjR/Ym8TicTMBgNpS4PeEkaJbbp LFoLB9WPGFE+cG1F1VunxOoQewLSdxCfSV9WAd0P6SS0pEE= X-Received: by 2002:a05:6402:1e8c:b0:5d9:fc81:e197 with SMTP id 4fb4d7f45d1cf-5e59f3c2304mr608100a12.8.1741127085220; Tue, 04 Mar 2025 14:24:45 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5e4c3b6cfdcsm8831363a12.29.2025.03.04.14.24.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Mar 2025 14:24:41 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 7D9585FBC3; Tue, 4 Mar 2025 22:24:39 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Li-Wen Hsu , Peter Maydell , Laurent Vivier , qemu-arm@nongnu.org, Alexandre Iooss , Paolo Bonzini , Richard Henderson , Riku Voipio , Warner Losh , Brian Cain , Mahmoud Mandour , Kyle Evans , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Ed Maste , Pierrick Bouvier , =?utf-8?q?Marc-Andr=C3=A9_L?= =?utf-8?q?ureau?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth Subject: [PATCH v2 01/32] tests/functional: move aarch64 GPU test into own file Date: Tue, 4 Mar 2025 22:24:08 +0000 Message-Id: <20250304222439.2035603-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250304222439.2035603-1-alex.bennee@linaro.org> References: <20250304222439.2035603-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x533.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org I want to expand the number of tests to cover a wide range of configurations. That starts with splitting off from the normal virt test from which it doesn't really share much code. We can also reduce the timeout of the original virt test now it is now longer burdened with testing the GPU. Signed-off-by: Alex Bennée Message-Id: <20250219150009.1662688-2-alex.bennee@linaro.org> Reviewed-by: Thomas Huth --- v2 - drop unused logging import - inheriting LinuxKernelTest for wait_for_console_pattern - lower the virt timeout to 360, use 480 for gpu test --- tests/functional/meson.build | 4 +- tests/functional/test_aarch64_virt.py | 71 ----------------- tests/functional/test_aarch64_virt_gpu.py | 94 +++++++++++++++++++++++ 3 files changed, 97 insertions(+), 72 deletions(-) create mode 100755 tests/functional/test_aarch64_virt_gpu.py diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 3fd2652c07..4b492135e0 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -18,7 +18,8 @@ test_timeouts = { 'aarch64_sbsaref_alpine' : 1200, 'aarch64_sbsaref_freebsd' : 720, 'aarch64_tuxrun' : 240, - 'aarch64_virt' : 720, + 'aarch64_virt' : 360, + 'aarch64_virt_gpu' : 480, 'acpi_bits' : 420, 'arm_aspeed_palmetto' : 120, 'arm_aspeed_romulus' : 120, @@ -81,6 +82,7 @@ tests_aarch64_system_thorough = [ 'aarch64_tcg_plugins', 'aarch64_tuxrun', 'aarch64_virt', + 'aarch64_virt_gpu', 'aarch64_xen', 'aarch64_xlnx_versal', 'multiprocess', diff --git a/tests/functional/test_aarch64_virt.py b/tests/functional/test_aarch64_virt.py index 95f5ce8b4c..884aad7af6 100755 --- a/tests/functional/test_aarch64_virt.py +++ b/tests/functional/test_aarch64_virt.py @@ -134,77 +134,6 @@ def test_aarch64_virt_gicv2(self): self.common_aarch64_virt("virt,gic-version=2") - ASSET_VIRT_GPU_KERNEL = Asset( - 'https://fileserver.linaro.org/s/ce5jXBFinPxtEdx/' - 'download?path=%2F&files=' - 'Image', - '89e5099d26166204cc5ca4bb6d1a11b92c217e1f82ec67e3ba363d09157462f6') - - ASSET_VIRT_GPU_ROOTFS = Asset( - 'https://fileserver.linaro.org/s/ce5jXBFinPxtEdx/' - 'download?path=%2F&files=' - 'rootfs.ext4.zstd', - '792da7573f5dc2913ddb7c638151d4a6b2d028a4cb2afb38add513c1924bdad4') - - @skipIfMissingCommands('zstd') - def test_aarch64_virt_with_gpu(self): - # This tests boots with a buildroot test image that contains - # vkmark and other GPU exercising tools. We run a headless - # weston that nevertheless still exercises the virtio-gpu - # backend. - - self.set_machine('virt') - self.require_accelerator("tcg") - - kernel_path = self.ASSET_VIRT_GPU_KERNEL.fetch() - image_path = self.uncompress(self.ASSET_VIRT_GPU_ROOTFS, format="zstd") - - self.vm.set_console() - kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + - 'console=ttyAMA0 root=/dev/vda') - - self.vm.add_args("-accel", "tcg") - self.vm.add_args("-cpu", "neoverse-v1,pauth-impdef=on") - self.vm.add_args("-machine", "virt,gic-version=max", - '-kernel', kernel_path, - '-append', kernel_command_line) - self.vm.add_args("-smp", "2", "-m", "2048") - self.vm.add_args("-device", - "virtio-gpu-gl-pci,hostmem=4G,blob=on,venus=on") - self.vm.add_args("-display", "egl-headless") - self.vm.add_args("-display", "dbus,gl=on") - self.vm.add_args("-device", "virtio-blk-device,drive=hd0") - self.vm.add_args("-blockdev", - "driver=raw,file.driver=file," - "node-name=hd0,read-only=on," - f"file.filename={image_path}") - self.vm.add_args("-snapshot") - - try: - self.vm.launch() - except VMLaunchFailure as excp: - if "old virglrenderer, blob resources unsupported" in excp.output: - self.skipTest("No blob support for virtio-gpu") - elif "old virglrenderer, venus unsupported" in excp.output: - self.skipTest("No venus support for virtio-gpu") - elif "egl: no drm render node available" in excp.output: - self.skipTest("Can't access host DRM render node") - elif "'type' does not accept value 'egl-headless'" in excp.output: - self.skipTest("egl-headless support is not available") - else: - self.log.info(f"unhandled launch failure: {excp.output}") - raise excp - - self.wait_for_console_pattern('buildroot login:') - exec_command(self, 'root') - exec_command(self, 'export XDG_RUNTIME_DIR=/tmp') - exec_command_and_wait_for_pattern(self, - "weston -B headless " - "--renderer gl " - "--shell kiosk " - "-- vkmark -b:duration=1.0", - "vkmark Score") - if __name__ == '__main__': QemuSystemTest.main() diff --git a/tests/functional/test_aarch64_virt_gpu.py b/tests/functional/test_aarch64_virt_gpu.py new file mode 100755 index 0000000000..616e6ed656 --- /dev/null +++ b/tests/functional/test_aarch64_virt_gpu.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python3 +# +# Functional tests for the various graphics modes we can support. +# +# Copyright (c) 2024, 2025 Linaro Ltd. +# +# Author: +# Alex Bennée +# +# SPDX-License-Identifier: GPL-2.0-or-later + +from qemu.machine.machine import VMLaunchFailure + +from qemu_test import QemuSystemTest, Asset +from qemu_test import exec_command, exec_command_and_wait_for_pattern +from qemu_test import skipIfMissingCommands + +from qemu_test.linuxkernel import LinuxKernelTest + +class Aarch64VirtGPUMachine(LinuxKernelTest): + + ASSET_VIRT_GPU_KERNEL = Asset( + 'https://fileserver.linaro.org/s/ce5jXBFinPxtEdx/' + 'download?path=%2F&files=' + 'Image', + '89e5099d26166204cc5ca4bb6d1a11b92c217e1f82ec67e3ba363d09157462f6') + + ASSET_VIRT_GPU_ROOTFS = Asset( + 'https://fileserver.linaro.org/s/ce5jXBFinPxtEdx/' + 'download?path=%2F&files=' + 'rootfs.ext4.zstd', + '792da7573f5dc2913ddb7c638151d4a6b2d028a4cb2afb38add513c1924bdad4') + + @skipIfMissingCommands('zstd') + def test_aarch64_virt_with_vulkan_gpu(self): + # This tests boots with a buildroot test image that contains + # vkmark and other GPU exercising tools. We run a headless + # weston that nevertheless still exercises the virtio-gpu + # backend. + + self.set_machine('virt') + self.require_accelerator("tcg") + + kernel_path = self.ASSET_VIRT_GPU_KERNEL.fetch() + image_path = self.uncompress(self.ASSET_VIRT_GPU_ROOTFS, format="zstd") + + self.vm.set_console() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'console=ttyAMA0 root=/dev/vda') + + self.vm.add_args("-accel", "tcg") + self.vm.add_args("-cpu", "neoverse-v1,pauth-impdef=on") + self.vm.add_args("-machine", "virt,gic-version=max", + '-kernel', kernel_path, + '-append', kernel_command_line) + self.vm.add_args("-smp", "2", "-m", "2048") + self.vm.add_args("-device", + "virtio-gpu-gl-pci,hostmem=4G,blob=on,venus=on") + self.vm.add_args("-display", "egl-headless") + self.vm.add_args("-display", "dbus,gl=on") + self.vm.add_args("-device", "virtio-blk-device,drive=hd0") + self.vm.add_args("-blockdev", + "driver=raw,file.driver=file," + "node-name=hd0,read-only=on," + f"file.filename={image_path}") + self.vm.add_args("-snapshot") + + try: + self.vm.launch() + except VMLaunchFailure as excp: + if "old virglrenderer, blob resources unsupported" in excp.output: + self.skipTest("No blob support for virtio-gpu") + elif "old virglrenderer, venus unsupported" in excp.output: + self.skipTest("No venus support for virtio-gpu") + elif "egl: no drm render node available" in excp.output: + self.skipTest("Can't access host DRM render node") + elif "'type' does not accept value 'egl-headless'" in excp.output: + self.skipTest("egl-headless support is not available") + else: + self.log.info(f"unhandled launch failure: {excp.output}") + raise excp + + self.wait_for_console_pattern('buildroot login:') + exec_command(self, 'root') + exec_command(self, 'export XDG_RUNTIME_DIR=/tmp') + exec_command_and_wait_for_pattern(self, + "weston -B headless " + "--renderer gl " + "--shell kiosk " + "-- vkmark -b:duration=1.0", + "vkmark Score") + +if __name__ == '__main__': + QemuSystemTest.main()