From nobody Fri Dec 19 17:36:25 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1710179181; cv=none; d=zohomail.com; s=zohoarc; b=nG8ks5bCl8huByrRoPWiXJUM9Q7tusK4oLMA1lNI3cXwRbXnO0o0Umqnc59ysPCgkazSphzmNBWcvATZaZniROu6CMjHrzecSWOutXaqtjAsykQxsbbiZcs/ZTcSAxFYXiB5NqBO7dWG2yfXwA/2ermjXECPkeD+6Bk+KsyFSeQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710179181; 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=cJYmS7//KWqwEUzntf/7pcjsXnd3DRaeR+mHw8GRlas=; b=A91LkSo0pfBouEr/yBth2gFF8cgjFVuGoE/DOwFRHPLt2pN5KHqRtBlJB45WUOl+ExLmpgfEnWYOAWLhGCb0Ld57F8OD038XB05U0dlVFlu5JAcHWCQWaCyOg0Y0nPNpqnoXhZdf+AfJUtbm0gf/L3iI9sufH5bdEID/Sl/d5tY= 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 1710179181668493.98120043361155; Mon, 11 Mar 2024 10:46:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjfr-0006In-6Z; Mon, 11 Mar 2024 13:42:55 -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 1rjjfn-0005zZ-Mm; Mon, 11 Mar 2024 13:42:51 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rjjfl-0007W9-Qd; Mon, 11 Mar 2024 13:42:51 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6e5eb3dd2f8so3336585b3a.2; Mon, 11 Mar 2024 10:42:47 -0700 (PDT) Received: from wheely.local0.net ([118.208.155.46]) by smtp.gmail.com with ESMTPSA id a18-20020a62d412000000b006e67b4d7b74sm4593187pfh.197.2024.03.11.10.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 10:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710178966; x=1710783766; 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=cJYmS7//KWqwEUzntf/7pcjsXnd3DRaeR+mHw8GRlas=; b=XLgJLyZTgLL3dJgOO0vZ6LZKegh2SUg2zr4VZjCWUV1C3gPqfhy8YjzoO7ZvdEcaHl gRIDaQSLY9oK1KOdlf+LvCRyYWu8/kqivhYhK8ji0pH5GB2H6rPe6pvFBeaApEL8d+YP MM0baCr3HDSRaEWIif7FF7gu0a9ShYi69pcn/b8gQgDwanlS3uxKOpjdGr7T//bZVqn8 389DgGM0PHQyL7OJRdn4R/bD0R2ChczL8hfmqzx1T9YsHjiiNFzmVjxYoUKaLvr7SI/2 5TKX8tag50VVvNMMxuVWoSl7Id1AHUGo60MwsrOuB+pVWPCJ0gIk3BdPkSLwmQcqXZXj m7cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710178966; x=1710783766; 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=cJYmS7//KWqwEUzntf/7pcjsXnd3DRaeR+mHw8GRlas=; b=jLKWkqMdeGrfkbTsO6Xy7fGqJCpvw/EkIDNCiuGYMWJbs2/BqqtCzDVLqdCyrxHYMd kt/gQPzy1FUX/NfBRicdJHxzuvSbS4jGhqxsaApPk75q+WqOHsDynyuMobmLuxAdjF2j 0lmzfmNizdJH/MdL8R7qQBXyCdIIPlIuI98lywZGKr/VyV7D3Af5AJRHWzECWGpA87z8 YVzQUMK+TLmt8LyfIgePraiC9tuoVxe8YaOnggx7E493yi9kps/XW/STj8/af7WbcyaF dsylE2RacaM3ctmXspH68EhlSyDXsr10xD54355tRsfL9ycIVNowLK4Zm8Ke7ex4WCWz 5LFA== X-Forwarded-Encrypted: i=1; AJvYcCW7Rd11U9KSUYNHacGk9GTcNR9ZLcSBXJRCJkgyqBjOolaOSgGMXef1LAdL5iqgbJ035O/uHSsG2hInVi6X3g0B2rG7 X-Gm-Message-State: AOJu0YzelVHyzd/d+IXBGI0QkfYAKPKBNfHwy6qIs8Z5WxZBjIbqr9Nf 30iFQvfUMT4o9uQ7u4PdST078cl6CqCo50yx7Fmkov6aZlUAFCTXoIyvbHKZaYo= X-Google-Smtp-Source: AGHT+IEuu6OMiP1EpBRtnn7qfNBbuxCvPVJwjj8e5BkI/v/tyS+D/utoINnLeC5mM6WfM1e9siMTPA== X-Received: by 2002:a05:6a20:3553:b0:1a1:82fc:94e2 with SMTP id f19-20020a056a20355300b001a182fc94e2mr3627211pze.44.1710178965704; Mon, 11 Mar 2024 10:42:45 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Pavel Dovgalyuk , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , John Snow , Cleber Rosa , Wainer dos Santos Moschetta , Beraldo Leal , Michael Tokarev , qemu-ppc@nongnu.org Subject: [PATCH v4 24/24] tests/avocado: replay_linux.py add ppc64 pseries test Date: Tue, 12 Mar 2024 03:40:26 +1000 Message-ID: <20240311174026.2177152-25-npiggin@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240311174026.2177152-1-npiggin@gmail.com> References: <20240311174026.2177152-1-npiggin@gmail.com> 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::42d; envelope-from=npiggin@gmail.com; helo=mail-pf1-x42d.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 @gmail.com) X-ZM-MESSAGEID: 1710179183223100003 Content-Type: text/plain; charset="utf-8" Add a ppc64 pseries test. IO in SLOF is very slow when running in record-replay modes, so this this uses guestfish to extract the kernel and initrd and boot them directly. Cc: qemu-ppc@nongnu.org Signed-off-by: Nicholas Piggin --- The test takes about double the length of time of aarch64 and x86 tests (800s to 400s) for some reason. Not profiled it yet. tests/avocado/replay_linux.py | 78 ++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/tests/avocado/replay_linux.py b/tests/avocado/replay_linux.py index c0e50bb52b..1c11e48043 100644 --- a/tests/avocado/replay_linux.py +++ b/tests/avocado/replay_linux.py @@ -11,8 +11,9 @@ import os import logging import time +import subprocess =20 -from avocado import skipUnless +from avocado import skipIf, skipUnless from avocado_qemu import BUILD_DIR from avocado.utils import cloudinit from avocado.utils import network @@ -55,11 +56,14 @@ def vm_add_disk(self, vm, path, id, device): '%s,drive=3Ddisk%s-rr%s' % (device, id, bus_string)) =20 def vm_add_cdrom(self, vm, path, id, device): + vm.add_args('-device', + '%s,drive=3Ddisk%s' % (device, id)) vm.add_args('-drive', 'file=3D%s,id=3Ddisk%s,if=3Dnone,media=3Dcdr= om' % (path, id)) =20 def launch_and_wait(self, record, args, shift): self.require_netdev('user') vm =3D self.get_vm() + vm.add_args('-s') vm.add_args('-smp', '1') vm.add_args('-m', '1024') vm.add_args('-netdev', 'user,id=3Dvnet,hostfwd=3D:127.0.0.1:0-:22', @@ -207,3 +211,75 @@ def test_virt_gicv3(self): self.run_rr(shift=3D3, args=3D(*self.get_common_args(), "-machine", "virt,gic-version=3D3")) + +# ppc64 pseries test. +# +# This machine tends to fail replay and hang very close to the end of the +# trace, with missing events, which is still an open issue. +# +# spapr-scsi IO driven by SLOF/grub is extremely slow in record/replay mod= e, +# so jump through some hoops to boot the kernel directly. With this, the t= est +# runs in about 5 minutes (modulo hang), which suggests other machines may +# have similar issues and could benefit from bypassing bootloaders. +# +ppc_deps =3D ["guestfish"] # dependent tools needed in the test setup/box. + +def which(tool): + """ looks up the full path for @tool, returns None if not found + or if @tool does not have executable permissions. + """ + paths=3Dos.getenv('PATH') + for p in paths.split(os.path.pathsep): + p =3D os.path.join(p, tool) + if os.path.exists(p) and os.access(p, os.X_OK): + return p + return None + +def ppc_missing_deps(): + """ returns True if any of the test dependent tools are absent. + """ + for dep in ppc_deps: + if which(dep) is None: + return True + return False + +class ReplayLinuxPPC64(ReplayLinux): + """ + :avocado: tags=3Darch:ppc64 + :avocado: tags=3Daccel:tcg + """ + + hdd =3D 'virtio-blk-pci' + cd =3D 'scsi-cd' + bus =3D None + + def setUp(self): + super().setUp() + + if not ppc_missing_deps(): + # kernel, initramfs, and kernel cmdline are all taken by hand = from + # the Fedora image. + self.kernel=3D"vmlinuz-5.3.7-301.fc31.ppc64le" + self.initramfs=3D"initramfs-5.3.7-301.fc31.ppc64le.img" + cmd =3D "guestfish --ro -a %s run " ": mount /dev/sda2 / " ": = copy-out /boot/%s %s " ": copy-out /boot/%s %s " % (self.boot_path, self.ke= rnel, self.workdir, self.initramfs, self.workdir) + subprocess.run(cmd.split()) + + @skipIf(ppc_missing_deps(), 'dependencies (%s) not installed' % ','.jo= in(ppc_deps)) + def test_pseries(self): + """ + :avocado: tags=3Dmachine:pseries + """ + kernel=3Dos.path.normpath(os.path.join(self.workdir, self.kernel)) + initramfs=3Dos.path.normpath(os.path.join(self.workdir, self.initr= amfs)) + cmdline=3D"root=3DUUID=3D8a409ee6-3cb3-4b06-a266-39e2dae3e5fa ro n= o_timer_check net.fnames=3D0 console=3Dtty1 console=3DttyS0,115200n8" + self.run_rr(shift=3D3, args=3D("-device", "spapr-vscsi", + "-machine", "x-vof=3Don", + "-kernel", kernel, + "-initrd", initramfs, + "-append", cmdline)) + + # minimise the number of tests run by default because they are slow + # SLOF block IO is extremely slow when going through the blkreplay dri= ver + @skipUnless(os.getenv('SPEED') =3D=3D 'slow', 'runtime limited') + def test_pseries_slof(self): + self.run_rr(shift=3D3, args=3D("-device", "spapr-vscsi")) --=20 2.42.0