From patchwork Fri Jun 20 17:27:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 898384 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f54:0:b0:3a4:ee3f:8f15 with SMTP id cm20csp1561290wrb; Fri, 20 Jun 2025 15:23:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWX9ba0W70jyEl0aMarPcNhbq+Dbw7LTsFOY1h3gjwDVV4w/Vj7kihL18AKi0/PYlV10wZT6w==@linaro.org X-Google-Smtp-Source: AGHT+IEcraMH4Avwt5pr1Id9b8CjFgW+YLhl5YCbbQ0j5EDT0cgYAXXQkuiGE48UaVF/C6+F3+3R X-Received: by 2002:a05:6214:3215:b0:6e8:ddf6:d11e with SMTP id 6a1803df08f44-6fd0a51c380mr84137826d6.21.1750458183641; Fri, 20 Jun 2025 15:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750458183; cv=none; d=google.com; s=arc-20240605; b=aSNgSbnk7uiRNs07Xmb2opyth/yR83tLxsMEFT2GlOSPNb2Dawbjw66h/WqBXOP+nJ dJFvQKsqKSEuB+N9Xn2p1alJuGWp0msYB4ThnpDy2HT4xUczHctewV3lVRz3Q2TdB9Rx d04KQunfBBxZ8aKESoiClBcf5wu5LGjYPOIFBJIvnVyk1s+NqWi2oX7QWGotNU8Y6bcQ 35NOdBytHeT4qMb8jN8pWbmuQxXLtPGrhg791E9DDxXo/mjVRGfI4Yl6aAYtQsz3zqz6 /2hIkXZrfLMKQVNnKuXDu8Q50IvBU5MgsjzmtdAF0klM81R3+Tf6m8jH0tZ4smgN+WJ/ AG9w== 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=e45gg72CykCmOosOOuFqCWiWAfKi8lpY1H7Ol6ibhsw=; fh=AyzBWpdZKvTUKIe2KsNBcRb7uNXo8uS2i+VtImaSwe4=; b=UbHPVe4KNWLPRGsa7UJj0mktmCCbomf+p9cp4xLJ0pdKcfsFYS0TXqD4SjUhMBmlTL QJfR24a49Jvw8ntEzijFk6LCp7K7ejRBbEUZGkSuCZOflPf7i3tfYdx+wU8kV1XjJWQV U4mTkDJNcnpj9GENKwGGNcILNqKNgd9hV8GzQYty+mvO/oqPQcH7Ch25CWhOPv6bVbKc 37iqki91L4JAhfLCJ0AWELTp1wx8SDP8zGBFt/XzgvTTWZGX3/SC3d8bBbgU+vEW9RbH nP9PNyo0wU/EJxqV3qwznNflwIlPfHv/UenNU44ER7yiQ0dOWBI2yY5VCiqP8uSnuM23 txVg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WCINInI6; 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 6a1803df08f44-6fd0943ae24si28696536d6.103.2025.06.20.15.23.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jun 2025 15:23:03 -0700 (PDT) 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=WCINInI6; 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 1uSk4a-0000yT-1C; Fri, 20 Jun 2025 18:19:00 -0400 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 1uSfch-000855-Lj for qemu-devel@nongnu.org; Fri, 20 Jun 2025 13:33:55 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uSfcf-0006gm-MY for qemu-devel@nongnu.org; Fri, 20 Jun 2025 13:33:55 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-450dd065828so15685975e9.2 for ; Fri, 20 Jun 2025 10:33:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750440832; x=1751045632; 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=e45gg72CykCmOosOOuFqCWiWAfKi8lpY1H7Ol6ibhsw=; b=WCINInI6f0JMe9QcFQ90lHA2L2mOlAQAthSU/7zu4rfPP+Q62TGwInCP/N6PlKeZBc 4s2gOG9aHreuk/KaJMZbkcx+NjHqLP3EUde2bO+Kfxz4UftTawLaLpvLj6mm1opeeZeX pcqJe979eGx1WTVNC/kzu9yCdiM/8V4Wm6atDOeNSxzTaO/dVQYuS+l8xe1xQPcKkteu pRHu5AzZPqQ+aEC7hQHZ5tt0YJ4A2wNHkLwJKiPLEfWCmG3s79xi5vik6hrg7h6Qf82z 7uwF3DxwpDt2SU215GC/BhQTsNjJDk8yjEf29X2Y1GCXakHg0dR0AMJe05Y3z12FJCxr xoWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750440832; x=1751045632; 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=e45gg72CykCmOosOOuFqCWiWAfKi8lpY1H7Ol6ibhsw=; b=vIEfuqZWLLYfLR3tKn6yuPLLAju8Pssk6Ug3+DFvP+KbvEXZzYdsweSLLW696Jlg9j Bv5Coys7xY0xAIS6v3d6LjNk7zg7TjF2FRRQz3vpUYOBr5D9qL5TP4ZDxLyDxZCRwjAb Gt97qfPgEPdq5f42OHIJVUpXIhWUjgyYNEvkQnjIOGaUDoLsRDDFS6pt0GxUdw4XCVQ7 kmxMnN+znVt6Unc2SVniJeZaP0aX2bUaRKlqhu7oveB3p5Pdy5l1FBEywT2mlZld5cuc X/EyTi2P+pD2f7pWaP3VdpXj5/VNu+CqU0oqlcMJ+hPkTo0iZKrs3kFBmQmLDMNUnAOg cGtg== X-Gm-Message-State: AOJu0Yy/bK6/c9O3aWYxLNVo3uW+A0JIjs1cCDhyZm9ayuBQ5lojSScF 4q5b7WCEy0gus3RS2CFR45teswwfJ0rVaUOnbbU7Xa4Pg6iNEtY4gxWe1O/DjZKfoFUmWy+enYP cvHnPE6jCZg== X-Gm-Gg: ASbGncsskvoPCLnGe/9Y4D+iiTVKnTUmNYw6teBHOGMEjCTlAzhCRfLBHJg44LM/Odj f5BCpfQCYA0ux/9dyXTA6NlLN2p2U9AX7jk+PaA+0Xfnfya3l0/V/vVtt3BtLW0HCRKCOXMUUKh akf3EtHOIU+qDFnPaV6iOu/ymWTKh+mDjR0d0pNtzezZpr6v5YQJOqJx3TYB8kA7ZE+xII0NrKf u7BLcIXpIyjFDHj7ebbrESqxuNA6BOcw0YE2eHnPvOGuIlhSPuJfGn9dV+hHiaC3dyTN1TNOP/N FvkEEmJOuJ6JW68AwVeI6vk4i1MVw+uyKLJDk1Ubzg8Zex1MjVolxbdVXiyG6AQ8WYMfIA1jn5T aAhnFLOPC/6RC6dNLBvTKfrL/tV5/wphX+xkuMuqzvtImFZK1FsHp3z/1 X-Received: by 2002:a05:600c:8b2a:b0:43d:9d5:474d with SMTP id 5b1f17b1804b1-45364790383mr41752405e9.0.1750440831662; Fri, 20 Jun 2025 10:33:51 -0700 (PDT) Received: from localhost.localdomain (101.red-95-127-63.dynamicip.rima-tde.net. [95.127.63.101]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-453646fd6e4sm31090095e9.23.2025.06.20.10.33.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jun 2025 10:33:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alexander Graf , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Peter Maydell , Julian Armistead , Cameron Esfahani , Mark Burton , Thomas Huth , "Edgar E. Iglesias" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [RFC PATCH RESEND 42/42] tests/functional: Test Aarch64 virt machine with split-accelerator Date: Fri, 20 Jun 2025 19:27:50 +0200 Message-ID: <20250620172751.94231-43-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250620172751.94231-1-philmd@linaro.org> References: <20250620172751.94231-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 Signed-off-by: Philippe Mathieu-Daudé --- tests/functional/meson.build | 1 + tests/functional/test_aarch64_virt_split.py | 69 +++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 tests/functional/test_aarch64_virt_split.py diff --git a/tests/functional/meson.build b/tests/functional/meson.build index e9f19d54a27..20d18eb8f5d 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -98,6 +98,7 @@ tests_aarch64_system_thorough = [ 'aarch64_tuxrun', 'aarch64_virt', 'aarch64_virt_gpu', + 'aarch64_virt_split', 'aarch64_xen', 'aarch64_xlnx_versal', 'multiprocess', diff --git a/tests/functional/test_aarch64_virt_split.py b/tests/functional/test_aarch64_virt_split.py new file mode 100644 index 00000000000..840ffe2f732 --- /dev/null +++ b/tests/functional/test_aarch64_virt_split.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 +# +# Copyright (c) 2024 Linaro Ltd. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os +import re + +from qemu_test import QemuSystemTest, Asset +from qemu_test import exec_command, wait_for_console_pattern +from qemu_test import exec_command_and_wait_for_pattern + +def test_nested_guest(test_instance): + + # TODO: + # - kvm-unit-tests + # - boot KVM guest + pass + +def get_accel_transitions(vm): + hmp = vm.cmd('human-monitor-command', command_line='info accel') + for line in hmp.split('\r\n'): + match = re.search(r'Transitions: (\d+)', line) + if match is not None: + return int(match[1]) + return 0 + + +class Aarch64VirtSplit(QemuSystemTest): + + ASSET_KERNEL = Asset( + ('https://fileserver.linaro.org/s/Jao8KCct246QFy2/' + 'download/Image-6.14.5+initramfs_with_kvm_unit_tests.xz'), + '9cc074434b41bce61f0534381dd6912ca6f33524077b02b5f4062a5e696d1b30') + + def test_aarch64_virt_split(self): + self.set_machine('virt') + self.require_accelerator('split') + + self.vm.set_console() + + kernel = self.uncompress(self.ASSET_KERNEL) + + self.vm.add_args('-accel', 'split') + self.vm.add_args('-cpu', 'host') + self.vm.add_args('-m', '2G') + self.vm.add_args('-M', 'virtualization=on,' + 'gic-version=max') + self.vm.add_args('-kernel', kernel) + self.vm.add_args('-netdev', 'user,id=net0') + self.vm.add_args('-append', 'console=ttyAMA0 ' + 'kvm-arm.mode=nvhe') + + self.vm.launch() + wait_for_console_pattern(self, "CPU: All CPU(s) started at EL2") + wait_for_console_pattern(self, "kvm [1]: Hyp nVHE mode initialized") + wait_for_console_pattern(self, 'Welcome to Buildroot', + failure_message='Synchronous Exception at') + exec_command_and_wait_for_pattern(self, 'root', '#') + + self.assertGreater(get_accel_transitions(self.vm), 13, + "Not enough accel transitions") + + test_nested_guest(self) + + +if __name__ == '__main__': + QemuSystemTest.main()