From patchwork Sat Nov 30 08:45:48 2019 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: 180513 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2642276ile; Sat, 30 Nov 2019 00:50:24 -0800 (PST) X-Google-Smtp-Source: APXvYqwrhNCTkt5p10rH4RbWmc+YbwFdvMozGX4gocVuGdhDrfmFa797/8LpClJ3okwirAcMzQxS X-Received: by 2002:a17:906:6d52:: with SMTP id a18mr6331580ejt.52.1575103824804; Sat, 30 Nov 2019 00:50:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575103824; cv=none; d=google.com; s=arc-20160816; b=0tNVnIbXHcAqnghl+jhLjeQVM7PtZm6gijzgEgQwrsdLo6PJvlUgC3j5/idF3+HSp7 fEBlRXvcPZ86eWfB0H6pnCY8s723+T7bwfaH+CTijFcLd44Q/AZIU8YsT9RpwkH3hyKr uu8D9d9aGOR1QOME6shnduP0sJDWXTto5Ap+XFvpD+WAlI9fgY45Jdf3YVfpA7cxxeDT ryzZqDP9DzVvZHGFwZNbTIkSQWkZ5D4LZJ/a4m2NEF5p+MKZMjP+UtfmrODoHK0BWwHk OQ8Wb3Iffe7LheUdKCm+ow5zRvXkgHnPxPGQS19hWCdjy/SS2I5/7TbGAJ6kcj6HMsDt pUXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=LAfp5wEVFKlFvtQUxkFov81nSLAkjFHfewxk/LJDvm0=; b=pRk/a/A/7oov5QS0pOLe+6QrdbZHyKKr867fiI2v1H1BQPrJVoHi/yw+udM29k5eo0 hBZzyXm79sFynr7+ZLS2Ggu9DWoagKw1VVM9hzWB72s8+rP4n5fKiV+1gzK4Ku+eBLuB XADCzTwnC4cfTW1k0rumHaBIvQOAI/dQU4/e2QpIqc+6+YAmXt4Ag+FWkgauhwoJMTd5 4DuKYrlSGh3PIHTDE6tDInRqYXIx3500ynNpg+JNJTzrs6CoeuA2109faf72RqKFy4V6 A1fkbnTVNsmmxcPjgQfHfqm3vGz4OayECF2IlDSQjH7r9adxnf7hSgr5RPK2WbUs2mG/ rKlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DQFEbHKp; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y2si16885946edt.191.2019.11.30.00.50.24 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Nov 2019 00:50:24 -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=fail header.i=@linaro.org header.s=google header.b=DQFEbHKp; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaySN-0007Zw-Ek for patch@linaro.org; Sat, 30 Nov 2019 03:50:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57619) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iayOG-0002xd-D1 for qemu-devel@nongnu.org; Sat, 30 Nov 2019 03:46:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iayOE-0003BA-Oi for qemu-devel@nongnu.org; Sat, 30 Nov 2019 03:46:08 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:52182) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iayOE-00039b-HN for qemu-devel@nongnu.org; Sat, 30 Nov 2019 03:46:06 -0500 Received: by mail-wm1-x344.google.com with SMTP id g206so16308970wme.1 for ; Sat, 30 Nov 2019 00:46:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LAfp5wEVFKlFvtQUxkFov81nSLAkjFHfewxk/LJDvm0=; b=DQFEbHKpLjtWChA6M0Zl4U3wMaQsFkib29hmhp/bLn/BsqziVhNjd9KSeiLm0nvevr uXVFjRI+KesL6yDd/Nuq3dueyQMfJhtBoVoxUtQPn3gX4xolv7kY3wDr3mRlOIih3LmT hUk+obin1nUkhqH4hu8vR5tbmubqM8PZQRZjCBTnzgUF8eCbLVmS6w61TzqT8VsxhSCA l7Z+S3rqeO0oiPlOMVTsyvJY0GwqP8CF5bRXqmYEvc+WhZ+6v+MmMAX1+5BSH3OjxnuA im5bFd1NTi+Hj3Amdr5KkdqipVUQPU41YNZ2bbtJLnLZqp0L+M/E3dnhsir19mMAUI56 Fckg== 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:mime-version :content-transfer-encoding; bh=LAfp5wEVFKlFvtQUxkFov81nSLAkjFHfewxk/LJDvm0=; b=dYab6sMKtuQJNTI/p04FvxlGMDyUrCdNjSJAwlnaTkNRe0bgxaIHrENDR4sq6BahoU YgDTvNIl2U8ejWfxTx2rVYJTtMU7K9dAcmns6vdD/tqze5ww/bdnvUUqsu7PRZt4q0jL 1CpvVXYB/CCMIwl8kzYjxMXze6M/Wml+mSuz5GE+UAMpc4yqjEez1/qbxf/Lq9oFZH7o 2ezT7+6elDJNlQIAaVYmNfWz7x8+dGVDgr1CCYMOSkukTF1Zoja3ggGZ6MXkM6upKSrq jeqZJcruqZCa+ePEaiMaoG9uFFI7VkwRfJKWyVDOhOSnn0LhOfoeNGNu+wmZ1jP6OTeq 0X+w== X-Gm-Message-State: APjAAAUXgsk439QwbFt3BeNDQOzgMYiCVmfqcpEySgCzSH/Z+ClHI38U P91C++gf0i2DGp0tPiU7mJznVQ== X-Received: by 2002:a1c:f705:: with SMTP id v5mr17880241wmh.82.1575103564832; Sat, 30 Nov 2019 00:46:04 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v188sm5782426wma.10.2019.11.30.00.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Nov 2019 00:46:03 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B6AA61FF87; Sat, 30 Nov 2019 08:46:02 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 00/14] gdbstub refactor and SVE support Date: Sat, 30 Nov 2019 08:45:48 +0000 Message-Id: <20191130084602.10818-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 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, luis.machado@linaro.org, =?utf-8?q?Alex_Be?= =?utf-8?b?bm7DqWU=?= , richard.henderson@linaro.org, alan.hayward@arm.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Hi, So this is the first fully working version of the SVE gdbstub implementation. As before the first set of patches are mostly re-factoring of the gdbstub register interface. I include a new patch to default the SVE size to a more reasonable number for linux-user to mirror what the Linux kernel actually does. Finally the XML that QEMU generates is closer to that of GDB in terms of the nesting of the union and keeping all registers intact. If you enable the maximum VQ you still end up with pages of text if you examine the vector registers. Finally I've added a bit more test harness for running gdbstub tests and included a basic smoke test for SVE itself. It's still not plumbed into the main test harness yet though as there are complications caused by the available version of gdb. However I hope I can hide these in the run-test.py script later and just skip tests that we know won't work. Alex Bennée (14): gdbstub: make GDBState static and have common init function gdbstub: stop passing GDBState * around and use global gdbstub: move str_buf to GDBState and use GString gdbstub: move mem_buf to GDBState and use GByteArray gdbstub: add helper for 128 bit registers target/arm: use gdb_get_reg helpers target/m68k: use gdb_get_reg helpers gdbstub: extend GByteArray to read register helpers target/arm: prepare for multiple dynamic XMLs target/arm: explicitly encode regnum in our XML target/arm: default SVE length to 64 bytes for linux-user target/arm: generate xml description of our SVE registers tests/guest-debug: add a simple test runner tests/tcg: add a gdbstub testcase for SVE registers include/exec/gdbstub.h | 49 +- include/hw/core/cpu.h | 2 +- target/alpha/cpu.h | 2 +- target/arm/cpu.h | 34 +- target/cris/cpu.h | 4 +- target/hppa/cpu.h | 2 +- target/i386/cpu.h | 2 +- target/lm32/cpu.h | 2 +- target/m68k/cpu.h | 2 +- target/microblaze/cpu.h | 2 +- target/mips/internal.h | 2 +- target/openrisc/cpu.h | 2 +- target/ppc/cpu.h | 4 +- target/riscv/cpu.h | 2 +- target/s390x/internal.h | 2 +- target/sh4/cpu.h | 2 +- target/sparc/cpu.h | 2 +- target/xtensa/cpu.h | 2 +- gdbstub.c | 892 +++++++++++++------------- hw/core/cpu.c | 2 +- target/alpha/gdbstub.c | 2 +- target/arm/cpu64.c | 3 + target/arm/gdbstub.c | 169 ++++- target/arm/gdbstub64.c | 2 +- target/arm/helper.c | 151 ++++- target/cris/gdbstub.c | 4 +- target/hppa/gdbstub.c | 2 +- target/i386/gdbstub.c | 2 +- target/lm32/gdbstub.c | 2 +- target/m68k/gdbstub.c | 2 +- target/m68k/helper.c | 33 +- target/microblaze/gdbstub.c | 2 +- target/mips/gdbstub.c | 2 +- target/nios2/cpu.c | 2 +- target/openrisc/gdbstub.c | 2 +- target/ppc/gdbstub.c | 48 +- target/ppc/translate_init.inc.c | 54 +- target/riscv/gdbstub.c | 18 +- target/s390x/gdbstub.c | 30 +- target/sh4/gdbstub.c | 2 +- target/sparc/gdbstub.c | 2 +- target/xtensa/gdbstub.c | 2 +- tests/.gitignore | 1 + tests/guest-debug/run-test.py | 57 ++ tests/tcg/aarch64/gdbstub/test-sve.py | 75 +++ 45 files changed, 1038 insertions(+), 644 deletions(-) create mode 100755 tests/guest-debug/run-test.py create mode 100644 tests/tcg/aarch64/gdbstub/test-sve.py -- 2.20.1