From nobody Sat Nov 15 09:31:56 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752897622; cv=none; d=zohomail.com; s=zohoarc; b=GhchJPwmsH0Rys2h3Z+lI2YIjh+1sBUoC/h9YVrvikcAV9/BVNFMX2Yn2FEG0EtFM0iza6tAWllChraoTP+gnywcmdD+HK8y+x0QWBBpWP5MF/i5tt3oWdPJVMJDRr/kbaxGvbEjUO7CI366iqqhqR3BY6k/8M6KWn4dWAOLsxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752897622; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=i9sy/GkKxEpvogxAbQ/BlWtpttvEFz3MkYKybtI+dz8=; b=F6Xi3OKDB7fVk5gmOM04WywoNDQ4eErXFs7H7+h6PebKZPbULnGCqCBQiXVyhLLeabsQ/IR5f/XIfcSSiG3HlyOC1UfTG5Bp7TmEzkzTrN+yA+sj+Pw96wsaUdnqQ0Q+oWFTGDuYxM7dE+eJQzsybqxfNUU6JWWhPNriIRNRqR4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752897622785815.0622540197409; Fri, 18 Jul 2025 21:00:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ucyj1-000482-5z; Fri, 18 Jul 2025 23:59:03 -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 1ucyit-0003zk-J1 for qemu-devel@nongnu.org; Fri, 18 Jul 2025 23:58:57 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ucyio-00071d-QZ for qemu-devel@nongnu.org; Fri, 18 Jul 2025 23:58:54 -0400 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-3139027b825so2203538a91.0 for ; Fri, 18 Jul 2025 20:58:49 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b3f2ff88cf8sm1961819a12.49.2025.07.18.20.58.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jul 2025 20:58:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752897529; x=1753502329; 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=i9sy/GkKxEpvogxAbQ/BlWtpttvEFz3MkYKybtI+dz8=; b=hKWCakLnPjS58o4dUckOMieEzDE2kEtfRmm4J/bRxn9hIG11/QYObeEQgP6ZSfVXzE dB+4DuSoo6JqIEJg5p8vFWBqyrB0shi6D3+RR+wmebvIShi6HQSkaTR46aPpLpTVJlcW U8P75Z76mppRZg2fwvb4MjBbRYcm9tGGvUn65yUz3rJCYz2B2GvT1C0kVcF14P7WznIM UZLvuxndn4M1UkqKu7P02LMQ8m9zuPdT+JX2nFfc0Z4n/z7dbFCCZtMJjaACztEqwTub V+lepnuvIwQphveI/H2T6wSI/5H+H/rxm3pMwNCfa9NGmvrVjtLz7LgVX66dpjLZq7u+ 4J4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752897529; x=1753502329; 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=i9sy/GkKxEpvogxAbQ/BlWtpttvEFz3MkYKybtI+dz8=; b=qzhWzf3XpF2XWzt4M2+P4Uj9SxBWrfpG2UAzq6hCCqPAFH5ktI7d3Ali+ZjLEF2hV+ FmmSL1zSqIxjypOXiKT3icQg+oLgCKykxJg4n3LkcxkuyNZa7SspDUSR8j1FiGxnqTLN Ta4nbiuAc2MILwmAS5NrvP20wJaY/laZ414+UCVuUmsikHVf0GmnM/lFubY8/Szk9Zxy d81/IueBkRzHdlSwxUuc/dYI0O2jVJgJDx2HdIQs+pjZN38xF//eXtDwq4N1hpJYx5Wd Ti2vBDFzXpd0CPsG2bTENVtakO8usxRgPYkPtN1cCNingY8ATAQACDKgHvSm8hx4FM7z EFyw== X-Gm-Message-State: AOJu0YwHMq1382acLjDVEPx3GO8Hi+UFBg5upGOUloMVpW5MudPEHXyb CBkoxEpLvoP9d020NcluH5tjyWUsvnZxy0Vwp38c81KHGftHsKC4Gd8cUExYrrxevSWNCBs8pO6 remCmZWg= X-Gm-Gg: ASbGncsZ62sGblqzme4qzlgvo7PfiIzWOccYSbrUrgLIjvvGtYU9eaxaawwTF3gZKUu 8mR4U8TaK+3cocyMzXKJZz8TNGAMq2nqcUxOTOemfwaUeKGX9kkx8b/gJdnIiz13yQzJl/ovK3c JUDz0CMCmzJJQ2Cgib2bsvWkeK3MUdX1d3UQqT1jcJfMlr7ktXHWceQsv+LdbhLL63kriZEkmK4 U07RLKhWS8QT4w/qM1gMdQQ0kiPeb/YTt5e5XNznY7x9Ei9+d/SFuUDeW735LhqfkjBl4WBCUEl 19Do6uS05cCCbzeW2RPMnElaEFOFmNE2T+1O61d43ZyybevXoqN4I70HLAdcl2Aw5iJQZ+IGPMg qpaAQruGGh4wHCji6JRU/uX2XRuGoOqsL X-Google-Smtp-Source: AGHT+IGiXq8suzeZY2Gbl4zSLPsU4W8ayUC9ZDlyL7V+8Em5vBVJq2C2jL8BMVdcm5qXkHeq6XVxOw== X-Received: by 2002:a17:90b:514d:b0:311:b413:f5e1 with SMTP id 98e67ed59e1d1-31c9f45b1admr16462512a91.32.1752897528951; Fri, 18 Jul 2025 20:58:48 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: jean-philippe@linaro.org, richard.henderson@linaro.org, Leif Lindholm , Peter Maydell , Mathieu Poirier , gustavo.romero@linaro.org, qemu-arm@nongnu.org, Radoslaw Biernacki , Pierrick Bouvier Subject: [PATCH v2 1/2] tests/functional/test_aarch64_device_passthrough: update image Date: Fri, 18 Jul 2025 20:58:37 -0700 Message-ID: <20250719035838.2284029-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250719035838.2284029-1-pierrick.bouvier@linaro.org> References: <20250719035838.2284029-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1032.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752897624036116600 Content-Type: text/plain; charset="utf-8" TF-A needs to be patched to enable support for FEAT_TCR2 and FEAT_SCTLR2. This new image contains updated firmware. Signed-off-by: Pierrick Bouvier --- .../test_aarch64_device_passthrough.py | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tests/functional/test_aarch64_device_passthrough.py b/tests/fu= nctional/test_aarch64_device_passthrough.py index 1f3f158a9ff..17437784bbe 100755 --- a/tests/functional/test_aarch64_device_passthrough.py +++ b/tests/functional/test_aarch64_device_passthrough.py @@ -9,7 +9,7 @@ # # SPDX-License-Identifier: GPL-2.0-or-later =20 -import os +from os.path import join =20 from qemu_test import QemuSystemTest, Asset from qemu_test import exec_command, wait_for_console_pattern @@ -77,15 +77,16 @@ =20 class Aarch64DevicePassthrough(QemuSystemTest): =20 - # https://github.com/pbo-linaro/qemu-linux-stack + # https://github.com/pbo-linaro/qemu-linux-stack/tree/device_passthrou= gh + # $ ./build.sh && ./archive_artifacts.sh out.tar.xz # # Linux kernel is compiled with defconfig + # IOMMUFD + VFIO_DEVICE_CDEV + ARM_SMMU_V3_IOMMUFD # https://docs.kernel.org/driver-api/vfio.html#vfio-device-cde ASSET_DEVICE_PASSTHROUGH_STACK =3D Asset( - ('https://fileserver.linaro.org/s/fx5DXxBYme8dw2G/' - 'download/device_passthrough.tar.xz'), - '812750b664d61c2986f2b149939ae28cafbd60d53e9c7e4b16e97143845e196d= ') + ('https://github.com/pbo-linaro/qemu-linux-stack/' + 'releases/download/build/device_passthrough-c3fb84a.tar.xz'), + '15ac2b02bed0c0ea8e3e007de0bcfdaf6fd51c1ba98213f841dc7d01d6f72f04= ') =20 # This tests the device passthrough implementation, by booting a VM # supporting it with two nvme disks attached, and launching a nested VM @@ -96,16 +97,16 @@ def test_aarch64_device_passthrough(self): =20 self.vm.set_console() =20 - stack_path_tar_gz =3D self.ASSET_DEVICE_PASSTHROUGH_STACK.fetch() - self.archive_extract(stack_path_tar_gz, format=3D"tar") + stack_path_tar =3D self.ASSET_DEVICE_PASSTHROUGH_STACK.fetch() + self.archive_extract(stack_path_tar, format=3D"tar") =20 stack =3D self.scratch_file('out') - kernel =3D os.path.join(stack, 'Image.gz') - rootfs_host =3D os.path.join(stack, 'host.ext4') - disk_vfio =3D os.path.join(stack, 'disk_vfio') - disk_iommufd =3D os.path.join(stack, 'disk_iommufd') - guest_cmd =3D os.path.join(stack, 'guest.sh') - nested_guest_cmd =3D os.path.join(stack, 'nested_guest.sh') + kernel =3D join(stack, 'Image.gz') + rootfs_host =3D join(stack, 'host.ext4') + disk_vfio =3D join(stack, 'disk_vfio') + disk_iommufd =3D join(stack, 'disk_iommufd') + guest_cmd =3D join(stack, 'guest.sh') + nested_guest_cmd =3D join(stack, 'nested_guest.sh') # we generate two random disks with open(disk_vfio, "wb") as d: d.write(randbytes(512)) with open(disk_iommufd, "wb") as d: d.write(randbytes(1024)) --=20 2.47.2 From nobody Sat Nov 15 09:31:56 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1752897618; cv=none; d=zohomail.com; s=zohoarc; b=cVCV2jfNnR6rqSxa99chQimmKpaVXmF1lMSzpR2MXpAS8k+iQdKYcgjARdgBK/Rd3NyYqpzkrcTiNbTpC/O/n3fr8zpRHKOwu7J1qn3tNYclUlQAEi7eEU3uFdNvlSyDWJHImqcFl2JYMePF3x0IJavdMS+ayUKt8PQecXGj3pU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752897618; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gmpYkkW2T5351sW+n25nvUIMoB840GbkMt5lsg8Dg+I=; b=JWktA5kk0mdPGFT1tX3LnjpWA8bnFU+XCi5pMk2reB/Lfshww6U1fU5qRiw268cjJH7XGkrC1laSIamMzgosYNvg7wHKVPqGPUNRSpyV0RK7bp+toZimVlNt7iy4oeZmDapjC0p+cJ5nBhVF2rF+FnVUotijO8xryPqyuKNOaNU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752897618949219.49740131499084; Fri, 18 Jul 2025 21:00:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ucyj2-0004CX-HM; Fri, 18 Jul 2025 23:59:04 -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 1ucyiv-00040T-Hz for qemu-devel@nongnu.org; Fri, 18 Jul 2025 23:58:58 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0: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 1ucyir-00071o-4A for qemu-devel@nongnu.org; Fri, 18 Jul 2025 23:58:56 -0400 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-b3be5c0eb99so2070103a12.1 for ; Fri, 18 Jul 2025 20:58:50 -0700 (PDT) Received: from pc.. ([38.41.223.211]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b3f2ff88cf8sm1961819a12.49.2025.07.18.20.58.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jul 2025 20:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752897530; x=1753502330; 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=gmpYkkW2T5351sW+n25nvUIMoB840GbkMt5lsg8Dg+I=; b=pa4jJLWzSDFeAdZ2Q3MMa1xe//7mg71k3DBDwG+QmmpJm0Rhc4lSrWqjpELCp3D869 xJ0BcD1da5lb4MfIJ/7CN9iLwY6Pjlu3U28AGy60vngN/v8Ua1mQ5fG7XMqd1xL8eLcq 41jFyaYjGoBTtg3+hxUJtr+J330hlr+iAbl5DfdnUhhzUCsbRLoaZNDXRF45nUlkwLAt vYYGGPAw62E8ulRkyUfspHIsg91np8HnzgsT7JKW14ELvAYQVBh0gRZg39LepXR/y69Q F8/xwel2YpRasqHDGwUFhNPspHDWvgJwjNVJ5n0+CH+q4Qct5eirBjvZp5IcSkDpPvKk +HTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752897530; x=1753502330; 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=gmpYkkW2T5351sW+n25nvUIMoB840GbkMt5lsg8Dg+I=; b=lxBmVldB+FwQPYZat8jyg5I8JDbvTc4kNDLZZ33uy6en9SceuXCxMRI24WaGPg/9lt wqWm3jzluOvwrJ9tEp4sk+O9d/e1heamjEVVHyNQk7OYIOAaSzktu+RH2CJ0WeiCNu8X BFkbEKguvslo+CFZh0pSWQm52GFfMPMh3nY9xKcBGSlJtCS4Zz5o7A+4UBJI+D4h2sDe M4ztYk4IXAckRgP6fWes4IvIiiAcRh2NSJE1IjG2rw/gbVOknpnuUtF3LN6g3KKWrPqQ 8Ko9H41ZCaMtI/s5l/UzbArj/bePZkvr6OTJFuIUfDWhqx3Zs6LlzZrJ4TGyVE2eoj5g FZSQ== X-Gm-Message-State: AOJu0YwWhbjTKyzrkd1T0vveqPT/D80FYSYW3DeH/Gmr9EmJCjNyxd6S JiEqW150OCAfaPacgtgMpgAWiUfa8QCUxCJYR1o8ulMUT6C1i9Chlpr/3gAL02PcS+tcJ0El7oT FUmTa+HM= X-Gm-Gg: ASbGnctnX8UOWCBRFpRpWoA++qFzRu61JIweJfeHq0UjGL3ijuJ+r/kpfmYbDLx+m2Q W9KS7p7U+bTiSuv09cZNPrEZwJj1t2zD2eQhKGy7xTXvO6nW91cCvN53GWGAI82grleutfQtRll cM74yrxyJgFUN+fG7z9OKvnw+6tYwGHh+7DBpCsgFhv4zMzelG+YOtmGcRgZYxFvEWxYNPF5VTc ijTqgxDPX4oZ1KiS3Rs8uiU1eKgoAji8wS1oa/xuJQ1f6BLYMym27FQjI+P80h49x1H4gK4EIHh 1zNb3aSfuJu5HplHOa4RgSlR0/gDIPvDZCQUM4HNDwsLm7JnOcdH8QHu98HQPDIanZ0h9qhWdMB i5Q4zndZuCWJZW8hRpOieoVXVmqPCJnp4 X-Google-Smtp-Source: AGHT+IG5oh21h0Yhw10XI865taJjirmgYKGcY4ctD0zqNP1PLlkrkqBSZ7KNhLRzoP5UQZBNSC6onA== X-Received: by 2002:a05:6a20:6a22:b0:225:7617:66ff with SMTP id adf61e73a8af0-2391c962646mr8480562637.20.1752897529837; Fri, 18 Jul 2025 20:58:49 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: jean-philippe@linaro.org, richard.henderson@linaro.org, Leif Lindholm , Peter Maydell , Mathieu Poirier , gustavo.romero@linaro.org, qemu-arm@nongnu.org, Radoslaw Biernacki , Pierrick Bouvier Subject: [PATCH v2 2/2] tests/functional/test_aarch64_rme: update image Date: Fri, 18 Jul 2025 20:58:38 -0700 Message-ID: <20250719035838.2284029-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250719035838.2284029-1-pierrick.bouvier@linaro.org> References: <20250719035838.2284029-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pg1-x533.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1752897620444116600 Content-Type: text/plain; charset="utf-8" TF-A needs to be patched to enable support for FEAT_TCR2 and FEAT_SCTLR2. This new image contains updated firmware. Signed-off-by: Pierrick Bouvier --- tests/functional/test_aarch64_rme_sbsaref.py | 64 ++++++++------- tests/functional/test_aarch64_rme_virt.py | 85 +++++++------------- 2 files changed, 66 insertions(+), 83 deletions(-) diff --git a/tests/functional/test_aarch64_rme_sbsaref.py b/tests/functiona= l/test_aarch64_rme_sbsaref.py index 746770e776d..cd6390b548a 100755 --- a/tests/functional/test_aarch64_rme_sbsaref.py +++ b/tests/functional/test_aarch64_rme_sbsaref.py @@ -10,21 +10,23 @@ # SPDX-License-Identifier: GPL-2.0-or-later =20 import os +from os.path import join +import shutil =20 from qemu_test import QemuSystemTest, Asset, wait_for_console_pattern from qemu_test import exec_command_and_wait_for_pattern -from test_aarch64_rme_virt import test_realms_guest =20 =20 class Aarch64RMESbsaRefMachine(QemuSystemTest): =20 - # Stack is built with OP-TEE build environment from those instructions: + # Stack is inspired from: # https://linaro.atlassian.net/wiki/spaces/QEMU/pages/29051027459/ - # https://github.com/pbo-linaro/qemu-rme-stack + # https://github.com/pbo-linaro/qemu-linux-stack/tree/rme_sbsa_release + # ./build.sh && ./archive_artifacts.sh out.tar.xz ASSET_RME_STACK_SBSA =3D Asset( - ('https://fileserver.linaro.org/s/KJyeBxL82mz2r7F/' - 'download/rme-stack-op-tee-4.2.0-cca-v4-sbsa.tar.gz'), - 'dd9ab28ec869bdf3b5376116cb3689103b43433fd5c4bca0f4a8d8b3c104999e= ') + ('https://github.com/pbo-linaro/qemu-linux-stack/' + 'releases/download/build/rme_sbsa_release-a7f02cf.tar.xz'), + '27d8400b11befb828d6db0cab97e7ae102d0992c928d3dfbf38b24b6cf6c324c= ') =20 # This tests the FEAT_RME cpu implementation, by booting a VM supporti= ng it, # and launching a nested VM using it. @@ -35,35 +37,41 @@ def test_aarch64_rme_sbsaref(self): =20 self.vm.set_console() =20 - stack_path_tar_gz =3D self.ASSET_RME_STACK_SBSA.fetch() - self.archive_extract(stack_path_tar_gz, format=3D"tar") + stack_path_tar =3D self.ASSET_RME_STACK_SBSA.fetch() + self.archive_extract(stack_path_tar, format=3D"tar") =20 - rme_stack =3D self.scratch_file('rme-stack-op-tee-4.2.0-cca-v4-sbs= a') - pflash0 =3D os.path.join(rme_stack, 'images', 'SBSA_FLASH0.fd') - pflash1 =3D os.path.join(rme_stack, 'images', 'SBSA_FLASH1.fd') - virtual =3D os.path.join(rme_stack, 'images', 'disks', 'virtual') - drive =3D os.path.join(rme_stack, 'out-br', 'images', 'rootfs.ext4= ') + rme_stack =3D self.scratch_file('.') + pflash0 =3D join(rme_stack, 'out', 'SBSA_FLASH0.fd') + pflash1 =3D join(rme_stack, 'out', 'SBSA_FLASH1.fd') + rootfs =3D join(rme_stack, 'out', 'host.ext4') =20 - self.vm.add_args('-cpu', 'max,x-rme=3Don,pauth-impdef=3Don') + efi =3D join(rme_stack, 'out', 'EFI') + os.mkdir(efi) + shutil.copyfile(join(rme_stack, 'out', 'Image'), join(efi, 'Image'= )) + with open(join(efi, 'startup.nsh'), 'w') as startup: + startup.write('fs0:Image nokaslr root=3D/dev/vda rw init=3D/in= it --' + ' /host/out/lkvm run --realm' + ' -m 256m' + ' --restricted_mem' + ' --kernel /host/out/Image' + ' --disk /host/out/guest.ext4' + ' --params "root=3D/dev/vda rw init=3D/init"') + + self.vm.add_args('-cpu', 'max,x-rme=3Don') + self.vm.add_args('-smp', '2') self.vm.add_args('-m', '2G') self.vm.add_args('-M', 'sbsa-ref') self.vm.add_args('-drive', f'file=3D{pflash0},format=3Draw,if=3Dpf= lash') self.vm.add_args('-drive', f'file=3D{pflash1},format=3Draw,if=3Dpf= lash') - self.vm.add_args('-drive', f'file=3Dfat:rw:{virtual},format=3Draw') - self.vm.add_args('-drive', f'format=3Draw,if=3Dnone,file=3D{drive}= ,id=3Dhd0') - self.vm.add_args('-device', 'virtio-blk-pci,drive=3Dhd0') - self.vm.add_args('-device', 'virtio-9p-pci,fsdev=3Dshr0,mount_tag= =3Dshr0') - self.vm.add_args('-fsdev', f'local,security_model=3Dnone,path=3D{r= me_stack},id=3Dshr0') - self.vm.add_args('-device', 'virtio-net-pci,netdev=3Dnet0') - self.vm.add_args('-netdev', 'user,id=3Dnet0') - + self.vm.add_args('-drive', f'file=3Dfat:rw:{efi},format=3Draw') + self.vm.add_args('-drive', f'format=3Draw,file=3D{rootfs},if=3Dvir= tio') + self.vm.add_args('-virtfs', + f'local,path=3D{rme_stack}/,mount_tag=3Dhost,' + 'security_model=3Dmapped,readonly=3Doff') self.vm.launch() - # Wait for host VM boot to complete. - wait_for_console_pattern(self, 'Welcome to Buildroot', - failure_message=3D'Synchronous Exception = at') - exec_command_and_wait_for_pattern(self, 'root', '#') - - test_realms_guest(self) + # Wait for host and guest VM boot to complete. + wait_for_console_pattern(self, 'root@guest', + failure_message=3D'Kernel panic') =20 if __name__ =3D=3D '__main__': QemuSystemTest.main() diff --git a/tests/functional/test_aarch64_rme_virt.py b/tests/functional/t= est_aarch64_rme_virt.py index 8452d27928f..bb603aaa26c 100755 --- a/tests/functional/test_aarch64_rme_virt.py +++ b/tests/functional/test_aarch64_rme_virt.py @@ -9,50 +9,22 @@ # # SPDX-License-Identifier: GPL-2.0-or-later =20 -import os +from os.path import join =20 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 =20 -def test_realms_guest(test_rme_instance): - - # Boot the (nested) guest VM - exec_command(test_rme_instance, - 'qemu-system-aarch64 -M virt,gic-version=3D3 ' - '-cpu host -enable-kvm -m 512M ' - '-M confidential-guest-support=3Drme0 ' - '-object rme-guest,id=3Drme0 ' - '-device virtio-net-pci,netdev=3Dnet0,romfile=3D ' - '-netdev user,id=3Dnet0 ' - '-kernel /mnt/out/bin/Image ' - '-initrd /mnt/out-br/images/rootfs.cpio ' - '-serial stdio') - # Detect Realm activation during (nested) guest boot. - wait_for_console_pattern(test_rme_instance, - 'SMC_RMI_REALM_ACTIVATE') - # Wait for (nested) guest boot to complete. - wait_for_console_pattern(test_rme_instance, - 'Welcome to Buildroot') - exec_command_and_wait_for_pattern(test_rme_instance, 'root', '#') - # query (nested) guest cca report - exec_command(test_rme_instance, 'cca-workload-attestation report') - wait_for_console_pattern(test_rme_instance, - '"cca-platform-hash-algo-id": "sha-256"') - wait_for_console_pattern(test_rme_instance, - '"cca-realm-hash-algo-id": "sha-512"') - wait_for_console_pattern(test_rme_instance, - '"cca-realm-public-key-hash-algo-id": "sha-25= 6"') - class Aarch64RMEVirtMachine(QemuSystemTest): =20 - # Stack is built with OP-TEE build environment from those instructions: + # Stack is inspired from: # https://linaro.atlassian.net/wiki/spaces/QEMU/pages/29051027459/ - # https://github.com/pbo-linaro/qemu-rme-stack + # https://github.com/pbo-linaro/qemu-linux-stack/tree/rme_release + # ./build.sh && ./archive_artifacts.sh out.tar.xz ASSET_RME_STACK_VIRT =3D Asset( - ('https://fileserver.linaro.org/s/iaRsNDJp2CXHMSJ/' - 'download/rme-stack-op-tee-4.2.0-cca-v4-qemu_v8.tar.gz'), - '1851adc232b094384d8b879b9a2cfff07ef3d6205032b85e9b3a4a9ae6b0b7ad= ') + ('https://github.com/pbo-linaro/qemu-linux-stack/' + 'releases/download/build/rme_release-86101e5.tar.xz'), + 'e42fef8439badb52a071ac446fc33cff4cb7d61314c7a28fdbe61a11e1faad3a= ') =20 # This tests the FEAT_RME cpu implementation, by booting a VM supporti= ng it, # and launching a nested VM using it. @@ -63,15 +35,16 @@ def test_aarch64_rme_virt(self): =20 self.vm.set_console() =20 - stack_path_tar_gz =3D self.ASSET_RME_STACK_VIRT.fetch() - self.archive_extract(stack_path_tar_gz, format=3D"tar") + stack_path_tar =3D self.ASSET_RME_STACK_VIRT.fetch() + self.archive_extract(stack_path_tar, format=3D"tar") =20 - rme_stack =3D self.scratch_file('rme-stack-op-tee-4.2.0-cca-v4-qem= u_v8') - kernel =3D os.path.join(rme_stack, 'out', 'bin', 'Image') - bios =3D os.path.join(rme_stack, 'out', 'bin', 'flash.bin') - drive =3D os.path.join(rme_stack, 'out-br', 'images', 'rootfs.ext4= ') + rme_stack =3D self.scratch_file('.') + kernel =3D join(rme_stack, 'out', 'Image') + bios =3D join(rme_stack, 'out', 'flash.bin') + rootfs =3D join(rme_stack, 'out', 'host.ext4') =20 - self.vm.add_args('-cpu', 'max,x-rme=3Don,pauth-impdef=3Don') + self.vm.add_args('-cpu', 'max,x-rme=3Don') + self.vm.add_args('-smp', '2') self.vm.add_args('-m', '2G') self.vm.add_args('-M', 'virt,acpi=3Doff,' 'virtualization=3Don,' @@ -79,23 +52,25 @@ def test_aarch64_rme_virt(self): 'gic-version=3D3') self.vm.add_args('-bios', bios) self.vm.add_args('-kernel', kernel) - self.vm.add_args('-drive', f'format=3Draw,if=3Dnone,file=3D{drive}= ,id=3Dhd0') - self.vm.add_args('-device', 'virtio-blk-pci,drive=3Dhd0') - self.vm.add_args('-device', 'virtio-9p-device,fsdev=3Dshr0,mount_t= ag=3Dshr0') - self.vm.add_args('-fsdev', f'local,security_model=3Dnone,path=3D{r= me_stack},id=3Dshr0') - self.vm.add_args('-device', 'virtio-net-pci,netdev=3Dnet0') - self.vm.add_args('-netdev', 'user,id=3Dnet0') + self.vm.add_args('-drive', f'format=3Draw,file=3D{rootfs},if=3Dvir= tio') + self.vm.add_args('-virtfs', + f'local,path=3D{rme_stack}/,mount_tag=3Dhost,' + 'security_model=3Dmapped,readonly=3Doff') # We need to add nokaslr to avoid triggering this sporadic bug: # https://gitlab.com/qemu-project/qemu/-/issues/2823 - self.vm.add_args('-append', 'root=3D/dev/vda nokaslr') + self.vm.add_args('-append', + 'nokaslr root=3D/dev/vda rw init=3D/init --' + ' /host/out/lkvm run --realm' + ' -m 256m' + ' --restricted_mem' + ' --kernel /host/out/Image' + ' --disk /host/out/guest.ext4' + ' --params "root=3D/dev/vda rw init=3D/init"') =20 self.vm.launch() - # Wait for host VM boot to complete. - wait_for_console_pattern(self, 'Welcome to Buildroot', - failure_message=3D'Synchronous Exception = at') - exec_command_and_wait_for_pattern(self, 'root', '#') - - test_realms_guest(self) + # Wait for host and guest VM boot to complete. + wait_for_console_pattern(self, 'root@guest', + failure_message=3D'Kernel panic') =20 if __name__ =3D=3D '__main__': QemuSystemTest.main() --=20 2.47.2