From patchwork Mon Jul 22 16:07:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Romero X-Patchwork-Id: 813734 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1942240wro; Mon, 22 Jul 2024 09:11:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVCibSJCDAR5NhoWHYnzcsJN0u4Vcxz7+VRCTpK+ZeJVvl9TBPL/qY1F9ACW/C952BssOsjqf+DUFY1gBTi9dIC X-Google-Smtp-Source: AGHT+IHJtn8/i/d/txDxzv7kSsR+cRTH9h+3EiyGyyTkPL3U2iF/6IO9Srp7dyLD/xjxthZXadIS X-Received: by 2002:a05:6214:2423:b0:6b7:a4dc:e243 with SMTP id 6a1803df08f44-6b98192197bmr3981866d6.15.1721664668046; Mon, 22 Jul 2024 09:11:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721664668; cv=none; d=google.com; s=arc-20160816; b=YoIBLtOWZoKlybFzQ1Na07p8pyZOkzR4/KZ3siEBmQptZEgALjOCzf87kDx9y2rwet dlS5nuP/m6pE3Y+I9xcOfKx+hUWLTAqEqmYDy9z1DKqx4tbx6lzrlBwYRce14sLCN9n6 0qq8hoqiPBrGHaTccNOgbMRUWuXf9LGyj18JyFYUZKpezPtJJMqu5NxxP3WfQhr/db0Y 5Xz1Q9dS71F/tkiVAcLirkcUixk4Y0iKKo649RTZMsGlldf6ywPkCMGdF1SDd3AhnF6g osOuc444PYBIB0ooPv/ce1Oj8c2zV1wyfOQ225YFJDUlZq1yMdLLRPUUMrutPxgnQKSC VfxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=5TybG9Wl5Lf+sqEB7R1oc8u9w3KDzgw5DOhQ3sJf4Lg=; fh=fQSRkfw+DkTHa5KQssXieneufL+rl3wPoA2jkVIsZpk=; b=mckCoV1D46NP1pQccNV8s+QpvGUDvrZhG9zoA8JLY/nZnp2m4Zuppd7raSgl0nC27i SLwpl0xRpmt6CTzFJl1N49G4aN4+ZUHzJPNqw4T2mdbsFQP09pchzoiihMyWRIzeQk53 +KJ9xAiKi5CQWhpENe1OQNLXz94WfCMZXmgVl+tMlgs3X90YhzdKG29LAKIE3VSsl9ry 5k1+caex6eXB+Y6jqyuke++uei+g+blUK/5ttkcaOblpYuu8GVmcOood6v3RUJRcna22 i2VNql1ly5bcirgf4UsKR/K8SfGbn67hT2L87zyo/vGAlm5baJdcsTLTa8W5behz03I4 O7Tg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gTeAU+ur; 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-6b7acaed82bsi77429996d6.435.2024.07.22.09.11.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jul 2024 09:11:08 -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=gTeAU+ur; 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 1sVvZV-0004NH-34; Mon, 22 Jul 2024 12:07:33 -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 1sVvZS-0004Mg-V6 for qemu-devel@nongnu.org; Mon, 22 Jul 2024 12:07:31 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sVvZQ-0007dK-Vv for qemu-devel@nongnu.org; Mon, 22 Jul 2024 12:07:30 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1fc569440e1so35696745ad.3 for ; Mon, 22 Jul 2024 09:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721664446; x=1722269246; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5TybG9Wl5Lf+sqEB7R1oc8u9w3KDzgw5DOhQ3sJf4Lg=; b=gTeAU+urCjKEhDOQGgv1XWYQRee07XViaUBqJjntgIoHrInEZIabC/VGYSRNJqmFKR qlNMFwIBHgirfrkWJODQLW2ZR1oVgiZb+E1o3FnKjPhKLtEsXh2ke1FFB966nS7p3UAz YzK7MFRCnM4x+MhyYLSYT7QlJnA7jFbiNOHkypgTAy4RnOBJmBqMbayzhWL/5V6LsRg5 +PJTGeCsF6aoFhERs4DKkndWuZ7c8/vR8LjT5o+uZ3ROxL78LA4OzAjpPS/TPQYlFtSx AWJf74ORoY8JOIckIkxeoW1b6X/hK9TqZF7maEvjnXroS5GZ62vgO3a7WP+p/MsKlZly NeMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721664446; x=1722269246; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5TybG9Wl5Lf+sqEB7R1oc8u9w3KDzgw5DOhQ3sJf4Lg=; b=cGkV2E8IQiiPPpY73nr2pQyCky1BYHXHt2FkKmZE68kftD+emwk+WEb0LNaIj60yNw 0Hs9YB+zOEjLawYTRk+G9OG3fEvSxfCFAhYeAO3eLjbMYD9kPPJwf4mIO7j1BilZWqK5 GOUYU7y/DWVT+vH2xgTxfLiisFvg3kppAdowzV+/pRZVn6irmMhK8Wcai7ZMLFTuOjqL C93D1TfNg2h6WWhIKVo0owEnN4q/KG2m16janS7zOoVxhiYFY2WK/LAQSWXLlpuY6Uf5 yqnGG3bH0KNRr4aLQU90QazXjCeyCQQvH0tvHf5X/zBH2+eAZ6VemdYerH36eD+newjt gY1A== X-Gm-Message-State: AOJu0YxymJ7OMgHmZbhJQLhARGqMJEbHPFhFWu5eId54iqw5bNLSq+sA x0W3MAsz8mFMuSYrFuybDQnh0QUzfDP4TH8QaJStJhNsz0FLjJArTGb5Sm92RB7H64BRHy/8JOw E X-Received: by 2002:a17:902:e805:b0:1fb:6663:b647 with SMTP id d9443c01a7336-1fdb5f50c08mr2484075ad.3.1721664445822; Mon, 22 Jul 2024 09:07:25 -0700 (PDT) Received: from amd.. ([2804:7f0:b402:9243:3e7c:3fff:fe7a:e83b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fd6f2ac8eesm56533165ad.118.2024.07.22.09.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 09:07:25 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, philmd@linaro.org, alex.bennee@linaro.org, richard.henderson@linaro.org Cc: peter.maydell@linaro.org, gustavo.romero@linaro.org Subject: [PATCH 0/4] gdbstub: Add support for MTE in system mode Date: Mon, 22 Jul 2024 16:07:05 +0000 Message-Id: <20240722160709.1677430-1-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=gustavo.romero@linaro.org; helo=mail-pl1-x631.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 This patchset makes handle_q_memtag, handle_q_isaddresstagged, and handle_Q_memtag stubs build for system mode, allowing all GDB 'memory-tag' subcommands to work with QEMU gdbstub on aarch64 system mode. It also extends the MTE gdbstub tests to run in system mode, sharing the tests between user mode and system mode. For running the tests, a GDB that supports MTE for baremetal targets is necessary. The patch for this support is currently under review [0]. For convenience, this patch is available in this GDB branch [1], and GDB can be built and installed into a /tmp directory in a straightforward way. After cloning [1], in a 'build' directory, configure GDB to build: $ git clone --depth 1 https://github.com/gromero/binutils-gdb.git --branch mte_baremetal mte_baremetal && cd mte_baremetal $ mkdir build && cd build $ ../configure --disable-binutils --disable-ld --disable-gold --disable-gas --disable-sim --disable-gprof --disable-gprofng --with-python=python3 --enable-libctf --enable-unit-tests --prefix=/tmp/gdb --with-additional-debug-dirs=/usr/lib/debug --enable-targets=all $ make -j 32 $ make install Configure QEMU, specifying where GDB is installed. For example: $ cd build $ ../configure --target-list=aarch64-linux-user,aarch64-softmmu --disable-docs --gdb=/tmp/gdb/bin/gdb $ make -j 32 $ cd.. And, finally, run the MTE gdbstub tests for system mode: $ make -C build -j 32 run-tcg-tests-aarch64-softmmu Cheers, Gustavo [0] https://sourceware.org/pipermail/gdb-patches/2024-July/210584.html [1] https://github.com/gromero/binutils-gdb/tree/mte_baremetal Gustavo Romero (4): gdbstub: Use specific MMU index when probing MTE addresses gdbstub: Add support for MTE in system mode tests/guest-debug: Support passing arguments to the GDB test script tests/tcg/aarch64: Extend MTE gdbstub tests to system mode target/arm/gdbstub64.c | 21 +++++++---- tests/guest-debug/run-test.py | 4 +++ tests/tcg/aarch64/Makefile.softmmu-target | 36 +++++++++++++++++-- tests/tcg/aarch64/Makefile.target | 3 +- tests/tcg/aarch64/gdbstub/test-mte.py | 44 +++++++++++++++-------- tests/tcg/aarch64/system/boot.S | 26 ++++++++++++-- tests/tcg/aarch64/system/kernel.ld | 5 +++ tests/tcg/aarch64/system/mte.c | 40 +++++++++++++++++++++ 8 files changed, 151 insertions(+), 28 deletions(-) create mode 100644 tests/tcg/aarch64/system/mte.c