Message ID | 20240328070055.2578783-1-gustavo.romero@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 67932385DC0F for <patchwork@sourceware.org>; Thu, 28 Mar 2024 07:01:57 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 7D9193858C31 for <gdb-patches@sourceware.org>; Thu, 28 Mar 2024 07:01:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D9193858C31 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 7D9193858C31 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711609291; cv=none; b=fyZma+A8GS7swY78cS29IrQ4rytvU+CXl6RDhvL3pC4UtTZIPcs8w3Se17UA1TpLf1IxKlutln6q5YInsh5WCCGy6gu15yvruBSCjASAWywcxsFzPwF/HJ2YZ2gp68jFxk3riKGtNuD4aFAfFbBkUzY6v3ZlY48u7ofnMZNbfdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711609291; c=relaxed/simple; bh=2h380leRBegIYN5dYm0lEHjQCuyodE7Z0dFd21W40lw=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=A9VNkgtg9LIloddqSaL0KwHPJlmOTGHxksqHySjnP9MtFZX3FUKwdlP/N+w+LTYzaxAMVhRCqc92PLPWatwELxdyMcTY8Xovfkkspcf42MqlU7bTYLqlhrKa3fvhD09pu2w8GjBeIR2blR6+6Qig1RLE7CguMVQJkJenGHzkk4E= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1e0bfc42783so5797435ad.0 for <gdb-patches@sourceware.org>; Thu, 28 Mar 2024 00:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711609287; x=1712214087; 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=lMM6/nYTv+uH87hlRPXK/tcJ3VNWLiCNrFIwPLny2Bg=; b=JrbM0p2he0/oj3JbP/LLsKG/PDN1cgFCPvqUsD30AtLSZ76eOUs8+kbBwhw27//gxB NvlgIxDM3hFqPNBctPxvw2SVMTU2JnfHvEuqIpbAk17MOHGDvseoZNpGDrZErc1T3ZBW 7Z/78gOykvjiMq7mTBLrWTHhA1YTRmmCjJfG8xVgm4YCyHoT8rKiUMHKRcdNWcU4B2C1 14JrciFIp10oO7cutC6RwMJJknIdNKaUxLYUQ9f4BtQVRXTc56Wk2+eulh/sA9z797bX CoKby14Xnd1SBkBE3h16KEy9MUYkN0x7mT8OEBAS3LmTShDJ28JHShNG5EbZqm6FX9WL 9wqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711609287; x=1712214087; 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=lMM6/nYTv+uH87hlRPXK/tcJ3VNWLiCNrFIwPLny2Bg=; b=nIIO4AWczc+qUsbGOLxf8FrvAizZv/c/12WkgXlTq1ZmhAcxk3We7WF1mggZANfQ/d 3MmcTiAgH7vCTtnBrW5xaEW1NVXWlHcA/ClnV/zMChy6NYcmcJhcJqBwrUuzl57TyiC3 sRLoNRYlHAF4bBxFRMLZ0sO2VMYHHZktRq1vuTau1nFpZ//asRbeE9/IphyB1S4RAb3Z PJulcg1tF1UldcUdMc1K1Oolmxk7gvn0c8GoyERDPkFY/ZG9kJCVc8AGhrXc9F1J/H5s yo+Ce0JBsOu20JURaMe7eBd1SUntPEzsUKDSru7IKuD1S1qHvtaWRk7RV/MYGkOd9cPs ravQ== X-Gm-Message-State: AOJu0Yy2WrnDsXhSfhT2a4yinC7dhsJ2US7dBJJJQsd1nletOGKDmycj b3ITFDhAhA2uJNimRrv3+9AU3MQxzShF8K+mQoNgccyWhQkvuDyHCyrt7HsspQ3CaCYWwiM8ddM J X-Google-Smtp-Source: AGHT+IH/JgSUfHnXqESKQabCbhPa7gucau00Pxb4GvvTLhRdGoRTRzZW3vkMF5x9LHKTydkjhXDI0Q== X-Received: by 2002:a17:902:f603:b0:1e0:f503:4ea0 with SMTP id n3-20020a170902f60300b001e0f5034ea0mr2269154plg.64.1711609287171; Thu, 28 Mar 2024 00:01:27 -0700 (PDT) Received: from amd.. ([2804:7f0:b402:41b2:3e7c:3fff:fe7a:e83b]) by smtp.gmail.com with ESMTPSA id b15-20020a170902650f00b001e014627baasm754252plk.79.2024.03.28.00.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 00:01:26 -0700 (PDT) From: Gustavo Romero <gustavo.romero@linaro.org> To: gdb-patches@sourceware.org Cc: luis.machado@arm.com, thiago.bauermann@linaro.org, gustavo.romero@linaro.org Subject: [PATCH 0/4] Add another way to check for MTE-tagged addresses on remote targets Date: Thu, 28 Mar 2024 07:00:51 +0000 Message-Id: <20240328070055.2578783-1-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 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 another way to check for MTE-tagged addresses on remote targets
|
|
Message
Gustavo Romero
March 28, 2024, 7 a.m. UTC
This series introduces a new method to check for MTE-tagged addresses on remote targets. A new remote packet, qMemTagAddrCheck, is introduced, along with a new remote feature associated with it, 'memory-tagging-check-add+'. Only when 'memory-tagging-check-add+' feature is advertised GDB will use the new packet to query if an address is tagged. This new mechanism allows for checking MTE addresses in an OS-agnostic way, which is necessary when debugging targets that do not support '/proc/<PID>/smaps', as the current method of reading smaps contents fails in such cases. Cheers, Gustavo Gustavo Romero (4): gdb: aarch64: Remove MTE address checking from get_memtag gdb: aarch64: Move MTE address check out of set_memtag gdb: aarch64: Remove MTE address checking from memtag_matches_p gdb: Add new remote packet to check if address is tagged gdb/aarch64-linux-nat.c | 8 +++++ gdb/aarch64-linux-tdep.c | 22 +++----------- gdb/arch-utils.c | 2 +- gdb/arch-utils.h | 2 +- gdb/corelow.c | 8 +++++ gdb/gdbarch-gen.h | 4 +-- gdb/gdbarch.c | 2 +- gdb/gdbarch_components.py | 2 +- gdb/printcmd.c | 29 +++++++++++------- gdb/remote.c | 62 +++++++++++++++++++++++++++++++++++++++ gdb/target-delegates.c | 28 ++++++++++++++++++ gdb/target.c | 6 ++++ gdb/target.h | 6 ++++ 13 files changed, 147 insertions(+), 34 deletions(-)
Comments
Hi Gustavo, On 3/28/24 07:00, Gustavo Romero wrote: > This series introduces a new method to check for MTE-tagged addresses on > remote targets. > > A new remote packet, qMemTagAddrCheck, is introduced, along with a new > remote feature associated with it, 'memory-tagging-check-add+'. Only > when 'memory-tagging-check-add+' feature is advertised GDB will use the > new packet to query if an address is tagged. > > This new mechanism allows for checking MTE addresses in an OS-agnostic > way, which is necessary when debugging targets that do not support > '/proc/<PID>/smaps', as the current method of reading smaps contents > fails in such cases. > > Cheers, > Gustavo > > Gustavo Romero (4): > gdb: aarch64: Remove MTE address checking from get_memtag > gdb: aarch64: Move MTE address check out of set_memtag > gdb: aarch64: Remove MTE address checking from memtag_matches_p > gdb: Add new remote packet to check if address is tagged > > gdb/aarch64-linux-nat.c | 8 +++++ > gdb/aarch64-linux-tdep.c | 22 +++----------- > gdb/arch-utils.c | 2 +- > gdb/arch-utils.h | 2 +- > gdb/corelow.c | 8 +++++ > gdb/gdbarch-gen.h | 4 +-- > gdb/gdbarch.c | 2 +- > gdb/gdbarch_components.py | 2 +- > gdb/printcmd.c | 29 +++++++++++------- > gdb/remote.c | 62 +++++++++++++++++++++++++++++++++++++++ > gdb/target-delegates.c | 28 ++++++++++++++++++ > gdb/target.c | 6 ++++ > gdb/target.h | 6 ++++ > 13 files changed, 147 insertions(+), 34 deletions(-) > Thanks for the series. Please bear with me while I go through it and try it on my end.
Hi Luis, On 3/28/24 10:00 AM, Luis Machado wrote: > Hi Gustavo, > > On 3/28/24 07:00, Gustavo Romero wrote: >> This series introduces a new method to check for MTE-tagged addresses on >> remote targets. >> >> A new remote packet, qMemTagAddrCheck, is introduced, along with a new >> remote feature associated with it, 'memory-tagging-check-add+'. Only >> when 'memory-tagging-check-add+' feature is advertised GDB will use the >> new packet to query if an address is tagged. >> >> This new mechanism allows for checking MTE addresses in an OS-agnostic >> way, which is necessary when debugging targets that do not support >> '/proc/<PID>/smaps', as the current method of reading smaps contents >> fails in such cases. >> >> Cheers, >> Gustavo >> >> Gustavo Romero (4): >> gdb: aarch64: Remove MTE address checking from get_memtag >> gdb: aarch64: Move MTE address check out of set_memtag >> gdb: aarch64: Remove MTE address checking from memtag_matches_p >> gdb: Add new remote packet to check if address is tagged >> >> gdb/aarch64-linux-nat.c | 8 +++++ >> gdb/aarch64-linux-tdep.c | 22 +++----------- >> gdb/arch-utils.c | 2 +- >> gdb/arch-utils.h | 2 +- >> gdb/corelow.c | 8 +++++ >> gdb/gdbarch-gen.h | 4 +-- >> gdb/gdbarch.c | 2 +- >> gdb/gdbarch_components.py | 2 +- >> gdb/printcmd.c | 29 +++++++++++------- >> gdb/remote.c | 62 +++++++++++++++++++++++++++++++++++++++ >> gdb/target-delegates.c | 28 ++++++++++++++++++ >> gdb/target.c | 6 ++++ >> gdb/target.h | 6 ++++ >> 13 files changed, 147 insertions(+), 34 deletions(-) >> > > Thanks for the series. Please bear with me while I go through it and try it on my end. Thanks a lot! I've sent a v2 [0] that fixes a build error and also has instructions on how to build a QEMU gdbstub that supports the new packet so it's possible to test the remote target with this series. Cheers, Gustavo [0] https://sourceware.org/pipermail/gdb-patches/2024-March/207650.html