From patchwork Thu May 23 03:51:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 798395 Delivered-To: patch@linaro.org Received: by 2002:a5d:6a47:0:b0:354:fb4b:99cd with SMTP id t7csp28967wrw; Wed, 22 May 2024 20:52:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUcwSPDphowFJSCjDSADnAihl/u46Wp9T9FvxJxRKrm1HqP5GVfKwAMSpuHa+nZOtL1eAdgxSr+YRIpIMf4+F6F X-Google-Smtp-Source: AGHT+IFAvlg4c7kU252a2LCgQd4mhzyVAEZKH0V7qYNsCvcGQ7rw5ofXgO2VpaQ4yywti/oL0Zx4 X-Received: by 2002:a05:6902:18cd:b0:de6:151a:2813 with SMTP id 3f1490d57ef6-df4e0e366ffmr6119665276.40.1716436329425; Wed, 22 May 2024 20:52:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716436329; cv=pass; d=google.com; s=arc-20160816; b=oFxL5I0XxXTnFpTK2Kius8sQRHygMQ/4RWWCY+qWKmBH/2eDaR9qRcKMJPF8iP/sAl ekjHvQj16FFxM5SupbQHCjY0ab1CTIgMRiFl3r5Ei5ww7o8djg/bUZPqF8iaVwNmZz68 W3L/i2F8X4Mk4XkA/DNlQ00s1kBm9KFjUtqh1m9/VlIImwhEMUr61awg7R6Fqw9JUZJR yqWOAK39rSIbZHWw6fzVhDVlIfBySkkhHrplV+Ihx9N7k/KQSgfpjOFzoCJgQXBsRnkw gSoxLT2HPMtzBqjBnwqK1OOBzlXto2TvV/jjgCAPtv/PHdrnL7EyzxqbxmC9SCjwJ+JO ztCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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 :arc-filter:dmarc-filter:delivered-to; bh=ONbaBB/mukZGgbL9dZmEPIbiCuP88L3gCbCP1Ld9yM4=; fh=loWCTN49GeJC1HCrrvtQFeZ0kzyLaMXCA7ZZRe9+Kj4=; b=u4gTDE/1gc4tolDQb1Ge2M2vClKMUgFAbf0M0VTKgh0N6bhlaEfrByuGrhvBVkE6Es CJQj7co4+r03E9+ElwaZ2U+/huSdm8sZ+iVGSvI7OTaNVq1d+o/TEa4/IjAHQhjKQzZx 7fr+LoBrO1yLjL8vmKB2/XVDmKXZuZDbYHfbN8rGKhO6BcVgq2MiaQ/WjY6k4iRH2bXo od8us5+HENfywyOkapoahHKt1dUkZTyZlGWE1tYbMyxVhIHea2AWRqf3uIeJvn31rgBj Wg6WvNqX8Fv5UAh8V4ohnZCy7FPMjE0xPm9j2OdAqaYrMYFh6yFfFBr6ZIskfATUx6Tf 3q2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H+e12OK+; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id 6a1803df08f44-6ab7c7c310bsi37132866d6.95.2024.05.22.20.52.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 20:52:09 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H+e12OK+; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 16D2B3865C11 for ; Thu, 23 May 2024 03:52:09 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id CF7723858CD1 for ; Thu, 23 May 2024 03:51:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF7723858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CF7723858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1033 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716436290; cv=none; b=N7E1Mp78ggLwRzkW8Ejv0Q/OuOxyo7zEfh1F/WQGwXxj1DTgHSEm3U1yjNtU+TAHBjW8jSdP45ouwPENq63cVLubRDRk8aUClVh+/YaanO4MEmlMMYlgGjpCuViNLJJq8KRzx/Yh0pkx27VidYV97apQcnaAQHaV9bnJkoczipw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716436290; c=relaxed/simple; bh=HLFI7OsfwQ08iArk1rQp3AwASkqAWdQWSPh6aw+JtEI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=EwdFKDV9V5Epc9HnM55AG80Ota6nplZ48Hl5tv8mlF/bWVumvPD+e/SN9yhZWuYhr8JkAVJ7xGxSbFEKoLJwpRuLmJqU1oUFMXwsYHRC7lxDZF3uKzEyTqAlNnkaF5bzPBFfUBSQNXir7aA0kZobfhh4f+w5oAPLBqGQP9gj1Vs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2bdb57f496eso665671a91.2 for ; Wed, 22 May 2024 20:51:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716436288; x=1717041088; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ONbaBB/mukZGgbL9dZmEPIbiCuP88L3gCbCP1Ld9yM4=; b=H+e12OK+4zBjRxjEJhJ73qu79Ug12/5bmxXl9Txq5BdRw8dIWGGbfq8WO6gQbCkTw8 NRyvbxOR3yxtfuvHvHmyWFQ6Oueh9MmxVGkcHn6FYfFnjpurCQkzKB+5wqaY1aih8snr H5hvibjSU3R3JlfAvBFxYr6IjprSpn5zRRMp08qJq+LGqIrmYPw+jPEHcJJznGy+z842 opYPFHbcdIK6q5mLFBs2uPm6499tf/baiW47aVHIVHpx8QnixfOicD+NTOENSg/z1ooZ MxxJK3QSPZk+7RvXs7WTLxMLVodACvMhVtH/zdAQt3hHU0Ng82Bnel+I5OxJmD5XftqJ QNSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716436288; x=1717041088; 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=ONbaBB/mukZGgbL9dZmEPIbiCuP88L3gCbCP1Ld9yM4=; b=mJ+gqObPTAZ2/FVdx8S9Uw0TrSpg8i5TrQXL3xSS4ozgHXxSTxNlNOUFsWqcLaUu7X AJFjJ3ti5kjL/7xERfaHFZj+1JlwNBPAnsxon6ZUSUDTX6l4YmuAG09XSfcrh6E+GQ+1 VYGXOyGWwsqLwzo3XFOHKgT8Zk63ZV9pXE5o+zBCzqC/lm1kxvpUKOsU0ILXUOOJGdJU 08K1MuhUf6DN7c0CIEGrrbn6j5BlY1BfXs0mjmJ7sc1Y9lgkFBrxlj/mks6NQ3x6IwvR /j//1JnFrG+AO8c4JZzOofD0QHrWxycWDFQDVtJQoupnDQwceJNekZr5IHoJwp/AwvzZ 11mQ== X-Gm-Message-State: AOJu0YzTzetVeAcQwujPDmLZwhHpiG3s48STrhia/U2ewoga9/5Owp1y wIB5QU0sk5yIDwdZUz0T0Rn0UOXJ11cgEArmSeKhVhHjE4w5q4Er2znK0Mwk0Kj/gT4t9dvwwwA p X-Received: by 2002:a17:90a:db84:b0:2ac:513b:b316 with SMTP id 98e67ed59e1d1-2bd9f44fe4amr5143134a91.10.1716436287813; Wed, 22 May 2024 20:51:27 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:f149:d562:aa25:4733]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f335e3c10esm7222715ad.74.2024.05.22.20.51.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 20:51:27 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Cc: Christophe Lyon , Luis Machado , Guinevere Larsen , Pedro Alves Subject: [PATCH v4 0/3] Add support for AArch64 MOPS instructions Date: Thu, 23 May 2024 00:51:21 -0300 Message-ID: <20240523035124.2639220-1-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patch=linaro.org@sourceware.org Hello, Almost all of the changes in this version are in patch 2. Its changelog has the details. One of them is a simplification of the code in aarch64_record_memcopy_memset because Luis noticed that both code paths in it can share code. Also, the gdb.reverse/aarch64-mops.exp was moved from patch 5 (which doesn't exist anymore) to patch 2, and code cleanups suggested by Guinevere were implemented. In addition, it was adapted to work with Clang's line number information, which considers some register preparation instructions as part of the line with the asm statement. Also, the testcase gdb.arch/aarch64-mops-single-step.exp was moved to patch 1 so patch 4 doesn't exist anymore either. Here is the original cover letter for convenience: This patch series implements GDB support for the new instructions in AArch64's MOPS feature. Patch 1 has a small overview. What is needed from GDB is recognizing the MOPS sequences of instructions as atomic so that they can be stepped over during instruction single stepping, and also to avoid doing displaced stepping with them. This is done in patch 1. Patch 2 adds support for the new instructions to the record an replay target. The other patches add testcases to test each of the aspects above, plus one testcase to verify the interaction of the MOPS instructions with watchpoints. Tested on Ubuntu 23.10 aarch64-linux-gnu with no regressions, using the Arm FVP emulator as well as QEMU v8.2. Thiago Jung Bauermann (3): gdb/aarch64: Disable displaced single-step for MOPS instructions gdb/aarch64: Add record support for MOPS instructions. gdb/testsuite: Add gdb.arch/aarch64-mops-watchpoint.exp gdb/aarch64-tdep.c | 77 +++++++- .../gdb.arch/aarch64-mops-single-step.c | 73 +++++++ .../gdb.arch/aarch64-mops-single-step.exp | 98 +++++++++ .../gdb.arch/aarch64-mops-watchpoint.c | 66 +++++++ .../gdb.arch/aarch64-mops-watchpoint.exp | 79 ++++++++ gdb/testsuite/gdb.reverse/aarch64-mops.c | 78 ++++++++ gdb/testsuite/gdb.reverse/aarch64-mops.exp | 186 ++++++++++++++++++ gdb/testsuite/lib/gdb.exp | 99 ++++++++++ 8 files changed, 753 insertions(+), 3 deletions(-) create mode 100644 gdb/testsuite/gdb.arch/aarch64-mops-single-step.c create mode 100644 gdb/testsuite/gdb.arch/aarch64-mops-single-step.exp create mode 100644 gdb/testsuite/gdb.arch/aarch64-mops-watchpoint.c create mode 100644 gdb/testsuite/gdb.arch/aarch64-mops-watchpoint.exp create mode 100644 gdb/testsuite/gdb.reverse/aarch64-mops.c create mode 100644 gdb/testsuite/gdb.reverse/aarch64-mops.exp base-commit: 002ccda0ef390fc2f02c0a27f01993bd5009f03d Tested-By: Luis Machado