Message ID | 20240523035124.2639220-1-thiago.bauermann@linaro.org |
---|---|
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9DD1E3865C2A for <patchwork@sourceware.org>; Thu, 23 May 2024 03:52:16 +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 <gdb-patches@sourceware.org>; 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 <gdb-patches@sourceware.org>; 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-Google-Smtp-Source: AGHT+IEgUVptiMVd3nRj9PaAUqn5gAmJEoqwrrMppbp39DiDYg2kSMr0iEP7MyZt2BcX1FCD6IbafA== 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 <thiago.bauermann@linaro.org> To: gdb-patches@sourceware.org Cc: Christophe Lyon <christophe.lyon@linaro.org>, Luis Machado <luis.machado@arm.com>, Guinevere Larsen <blarsen@redhat.com>, Pedro Alves <pedro@palves.net> 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org |
Series |
Add support for AArch64 MOPS instructions
|
|
Message
Thiago Jung Bauermann
May 23, 2024, 3:51 a.m. UTC
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
Comments
On 5/23/24 04:51, Thiago Jung Bauermann wrote: > 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 I went through the tests and validated they work fine on an emulator. Unless there are other specific objections (from Guinevere on the record/replay side or Pedro), this looks good to me. Approved-By: Luis Machado <luis.machado@arm.com> Tested-By: Luis Machado <luis.machado@arm.com>
Hello Luis, Luis Machado <luis.machado@arm.com> writes: > On 5/23/24 04:51, Thiago Jung Bauermann wrote: >> 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 > > I went through the tests and validated they work fine on an emulator. > > Unless there are other specific objections (from Guinevere on the record/replay side or > Pedro), > this looks good to me. > > Approved-By: Luis Machado <luis.machado@arm.com> > Tested-By: Luis Machado <luis.machado@arm.com> Thank you! I'll wait for additional feedback. I would also like to know whether it's fine to backport this series to the release branch.
On 6/3/24 18:07, Thiago Jung Bauermann wrote: > Hello Luis, > > Luis Machado <luis.machado@arm.com> writes: > >> On 5/23/24 04:51, Thiago Jung Bauermann wrote: >>> 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 >> >> I went through the tests and validated they work fine on an emulator. >> >> Unless there are other specific objections (from Guinevere on the record/replay side or >> Pedro), >> this looks good to me. >> >> Approved-By: Luis Machado <luis.machado@arm.com> >> Tested-By: Luis Machado <luis.machado@arm.com> > > Thank you! I'll wait for additional feedback. > > I would also like to know whether it's fine to backport this series to > the release branch. > Given it is a smaller scope of change, I don't see a problem with that.
Hello, Luis Machado <luis.machado@arm.com> writes: > On 6/3/24 18:07, Thiago Jung Bauermann wrote: >> Hello Luis, >> >> Luis Machado <luis.machado@arm.com> writes: >> >>> I went through the tests and validated they work fine on an emulator. >>> >>> Unless there are other specific objections (from Guinevere on the record/replay side or >>> Pedro), >>> this looks good to me. >>> >>> Approved-By: Luis Machado <luis.machado@arm.com> >>> Tested-By: Luis Machado <luis.machado@arm.com> >> >> Thank you! I'll wait for additional feedback. >> >> I would also like to know whether it's fine to backport this series to >> the release branch. > > Given it is a smaller scope of change, I don't see a problem with that. Thanks! I just pushed to the main branch ending at commit 55e3fcf5e523 and to gdb-15-branch ending at commit 3504ea29464f.