From patchwork Thu Mar 28 07:00:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Romero X-Patchwork-Id: 783584 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2572790wrt; Thu, 28 Mar 2024 00:01:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVRfjmoIp90qdk7ChI3UMnX3T5bsymF7bkMVyi0Ul9ZrnA6DZjGKQOHQQcrs4Zbs5Uhpt6ALUoPisCUyIHZJlD+ X-Google-Smtp-Source: AGHT+IHMNo3g66ycLldEgK3FXl0JfuJO5ijqflLTV4TnZ3dMK/44dPuzZMrNr4Gjf3Y1Kyxw7BxO X-Received: by 2002:ad4:45a2:0:b0:696:7522:f680 with SMTP id y2-20020ad445a2000000b006967522f680mr1818434qvu.25.1711609310815; Thu, 28 Mar 2024 00:01:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711609310; cv=pass; d=google.com; s=arc-20160816; b=JaUfYmWPJGJk+ShkTAKAZ2Glq2g312lFRe1RKlCJvNNQuMX1bTB1CyWnEO31b91HeB i3MNDhje78er1O3Pfqew8lvucgEXTiBbUKVyHPL13PVv6NtufbfaqTAFPMiQggFDN9rT Ls8oXJojvzurE/N5N9GUPwdVxu3HUTasDVcMXBT5hEMxK9kTgYN1SQHtb/+I8A+xNVaI nCmrvnFfRV1sRonvYzwbKVHXfR+LR/uKYe/dvrFHHWoMr2tuqHgSLHMuWWykc90aT1ax gzMGIahZfOZAHzJjWaRvfSKHux1SDmRg45UW6qGIcm/lO2KMfjXImlapM/OzyWK/QZkY LEKA== 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=lMM6/nYTv+uH87hlRPXK/tcJ3VNWLiCNrFIwPLny2Bg=; fh=ip7+QkkM488k9wyzFaZPu3h7BUQARzj44zdeG2KNIXU=; b=oVyv2jsbXVW9ZoHZayZk8NkWtF+MdXZ/CIqgUVL2o2j4XCmfRTYaKoLqcOIvtK9YaD 8M6FdJBx+Zi8oHslPehPuLeaTHqkKXemWHLJQu30K/TxXfrB9SVTA3y9ZN/mVwIx9YBv YFpewTdv0rOWlqrZeMp0oLkfPsWtRgPy5/bfj2WHfUVE0H+2DvH8x1Iwjo4/wuFPHKP9 ipsZLOSs5CHyPERI6vuCJun/5EeLVWLadjBNUfgXs6V1uZ07WvLlhzEQD56//aYZq+2z bisK9CI452RI2eiT6WzFYqaXyFBYGO+S9FznW0N1hbxP6Gm+wS8iLxpqLu8rpf1RzzuL OiOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JrbM0p2h; 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 j6-20020a0ceb06000000b006968566f8a2si790863qvp.542.2024.03.28.00.01.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 00:01:50 -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=JrbM0p2h; 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 6EA52385ED71 for ; Thu, 28 Mar 2024 07:01:50 +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 ; 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 ; 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-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 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patch=linaro.org@sourceware.org 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//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(-)