From nobody Tue Feb 10 03:39:32 2026 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1576844285; cv=none; d=zohomail.com; s=zohoarc; b=J4dcpwJZ+fZWFwBgwoGUaiGRTduYJ3RFbEvjP2LEGSwLjNViSRlv3Ic4teWTZZgJ5MjpB6Me56e3L7nqE+2kCZvANSoOS/de2Lql5ZRuwMfs29Kq0mihxCigmTgJfwEom5tPx8NtWcmbTqt9wpJwtS05cZxDSUAyciRkrH91FGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576844285; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0hbLzhNEhCkMRqzYtd3EEZ7EkJxE7ghYQ9NzTVxAhLY=; b=Wiwf9otIh7oAovEpe3OinXkeOkh6JLI5KgFMcMkBjU0mgp2k5NGTYD5NHanMYChJrKwk5sBhFAfcMWMHJV+kvukj2KShhI3VAYdYNid1aPw6fZWRaGEaberNie8aO2ZycqiJMU3cx88qybLlw3zSQFHRn1XqSyVNDI9MAC+rOag= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576844285084768.832281280218; Fri, 20 Dec 2019 04:18:05 -0800 (PST) Received: from localhost ([::1]:54234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiHEI-0004Va-R6 for importer@patchew.org; Fri, 20 Dec 2019 07:18:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54274) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiH1s-00051x-JR for qemu-devel@nongnu.org; Fri, 20 Dec 2019 07:05:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iiH1o-0008Px-Iw for qemu-devel@nongnu.org; Fri, 20 Dec 2019 07:05:11 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:41086) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iiH1o-0008Mv-0o for qemu-devel@nongnu.org; Fri, 20 Dec 2019 07:05:08 -0500 Received: by mail-wr1-x431.google.com with SMTP id c9so9181934wrw.8 for ; Fri, 20 Dec 2019 04:05:07 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s128sm9713941wme.39.2019.12.20.04.04.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2019 04:04:53 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AF5D61FFA5; Fri, 20 Dec 2019 12:04:40 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0hbLzhNEhCkMRqzYtd3EEZ7EkJxE7ghYQ9NzTVxAhLY=; b=A4H6UdB2S/92fnWU47nEN9m9Bh7bPxF+RJJFgzvQ4fOYUptOB8ZpYYtR+DmKDQm47l iCMacMxkIhA3qGQiS0J154sHigRiXYwQSI3IgjloX8DCq0ZxnL6Dquh6j2t+t7/vSlkC siLoqhVr1KUINloRsgyCwzzhkVq9ldeHXO/J86PFms6wsBcQ9Zj38QUTCkGgR3u64S4i vN7c+AG6ET+xD6ChpMJB2xhJQxHEs8A7xEfin/iNCt1ulKetW1KwoWAJWhwht9z++vAh wxReIq7I7KnF24EvL/S8/46wHa+pff5kumdlN1Y4b1yG8pTl4H8lEkZMfDqjzsz4bkAR hcZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0hbLzhNEhCkMRqzYtd3EEZ7EkJxE7ghYQ9NzTVxAhLY=; b=GxC8bHC++ShKF+KerpLBQcRQvmNkkrS7AIRaorNpqXB+e8kxE8DQZk7FWerE/k/LqP 3jGTgxefdUi/LjAMlmF4JzdDeGgLvQPlsyMP+wwGh/lhtVqXrfsXjNamibpe5dMquViq d8t9o/D6v94kCAkOqghqzqT2C1Vo9G2qGkbcvElMVu9LYaaq90jyNOcbuYXXupoM3b16 WV/HUAIKtJwV3Bdf4YVCxSPyuIpoxsoEFYJQTH4NvTk1gdzVFS8fxE6Slm9h/bQIevLY dDiwme/Njknbu/HQsbv5Vx9EeHV7qVRbTY8QpL2SaCt7ZpOt8CQY4B+pBj+RIee2K7cR og5g== X-Gm-Message-State: APjAAAWug4kwx70D1ZD5ltvEuH0a7JDyKJ8DmYUC8gcX57cx8s8n6LwG qZCoAd1s3lCto2gbZJRks1y2Cg== X-Google-Smtp-Source: APXvYqxGJ1T4j1mvQjmf99AqecCv0QI1ym7PpPewJNJazc81ar+W1Ju9bk3vCVDz9g2E7iU1Zb37QQ== X-Received: by 2002:a5d:4651:: with SMTP id j17mr15576168wrs.237.1576843505701; Fri, 20 Dec 2019 04:05:05 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v4 17/21] tests/tcg/aarch64: add a gdbstub testcase for SVE registers Date: Fri, 20 Dec 2019 12:04:34 +0000 Message-Id: <20191220120438.16114-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191220120438.16114-1-alex.bennee@linaro.org> References: <20191220120438.16114-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::431 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: damien.hedde@greensocs.com, Peter Maydell , luis.machado@linaro.org, "open list:ARM TCG CPUs" , alan.hayward@arm.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We don't plumb this in yet as there are complications involved with binutils and cross-architectiure debugging but it is one step closer. Example: ./tests/guest-debug/run-test.py \ --qemu ./aarch64-linux-user/qemu-aarch64 \ --qargs "-cpu max" \ --bin ./tests/tcg/aarch64-linux-user/hello \ --test ~/lsrc/qemu.git/tests/tcg/aarch64/gdbstub/test-sve.py \ --gdb /home/alex/src/tools/binutils-gdb.git/install/bin/gdb Signed-off-by: Alex Benn=C3=A9e --- tests/.gitignore | 1 + tests/tcg/aarch64/gdbstub/test-sve.py | 75 +++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 tests/tcg/aarch64/gdbstub/test-sve.py diff --git a/tests/.gitignore b/tests/.gitignore index f9c01708812..8cc428b58bb 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -10,6 +10,7 @@ qht-bench rcutorture test-* !test-*.c +!test-*.py !docker/test-* test-qapi-commands.[ch] include/test-qapi-commands-sub-module.[ch] diff --git a/tests/tcg/aarch64/gdbstub/test-sve.py b/tests/tcg/aarch64/gdbs= tub/test-sve.py new file mode 100644 index 00000000000..11bc96fc06d --- /dev/null +++ b/tests/tcg/aarch64/gdbstub/test-sve.py @@ -0,0 +1,75 @@ +from __future__ import print_function +# +# Test the SVE registers are visable and changeable via gdbstub +# +# This is launched via tests/guest-debug/run-test.py +# + +import gdb + +MAGIC =3D 0xDEADBEEF + +failcount =3D 0 + +def report(cond, msg): + "Report success/fail of test" + if cond: + print ("PASS: %s" % (msg)) + else: + print ("FAIL: %s" % (msg)) + global failcount + failcount +=3D 1 + +def run_test(): + "Run through the tests one by one" + + gdb.execute("info registers") + report(True, "info registers") + + gdb.execute("info registers vector") + report(True, "info registers vector") + + # Now all the zregs + frame =3D gdb.selected_frame() + for i in range(0, 32): + rname =3D "z%d" % (i) + zreg =3D frame.read_register(rname) + report(True, "Reading %s" % rname) + for j in range(0, 4): + cmd =3D "set $%s.q.u[%d] =3D 0x%x" % (rname, j, MAGIC) + gdb.execute(cmd) + report(True, "%s" % cmd) + for j in range(0, 4): + reg =3D "$%s.q.u[%d]" % (rname, j) + v =3D gdb.parse_and_eval(reg) + report(str(v.type) =3D=3D "uint128_t", "size of %s" % (reg)) + for j in range(0, 8): + cmd =3D "set $%s.d.u[%d] =3D 0x%x" % (rname, j, MAGIC) + gdb.execute(cmd) + report(True, "%s" % cmd) + for j in range(0, 8): + reg =3D "$%s.d.u[%d]" % (rname, j) + v =3D gdb.parse_and_eval(reg) + report(str(v.type) =3D=3D "uint64_t", "size of %s" % (reg)) + report(int(v) =3D=3D MAGIC, "%s is 0x%x" % (reg, MAGIC)) + +# +# This runs as the script it sourced (via -x, via run-test.py) +# + +try: + # These are not very useful in scripts + gdb.execute("set pagination off") + gdb.execute("set confirm off") + + # Run the actual tests + run_test() +except: + print ("GDB Exception: %s" % (sys.exc_info()[0])) + failcount +=3D 1 + +print("All tests complete: %d failures" % failcount) + +# Finally kill the inferior and exit gdb with a count of failures +gdb.execute("kill") +exit(failcount) --=20 2.20.1