Message ID | 20240328070055.2578783-4-gustavo.romero@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2572874wrt; Thu, 28 Mar 2024 00:02:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVYFFoH00zDgXS6OpVhj6Yl/QuD7p9yuLDIviw6n41i3C8ep4gPLBCmXeDoSyKEoGbP6JWlzA745O/DdibrzcQx X-Google-Smtp-Source: AGHT+IGvnwf4xtvUgXJ4aRCJEzo3oxdoYoYyC6V77+G4BmmpHzoK6J4ddFwTwlzyGsurFwpUA1Ri X-Received: by 2002:a05:6871:60a:b0:229:f768:f6fa with SMTP id w10-20020a056871060a00b00229f768f6famr2079254oan.8.1711609324289; Thu, 28 Mar 2024 00:02:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711609324; cv=pass; d=google.com; s=arc-20160816; b=yu8eNnCS5k4zeBHyBVBFQYJvUQaXwXtCw3V7YnX3ENsJZM8NbkAjA8bYVW7AB3pzYp iup3W+4clpZLf+vxGjrbEQOjh0rIhcyUauNn5jlRJMgrEVcXohfULGLZgrn+nd9nXjRW obxNlQDdtphzLEbDtPH6xgjdwSYufnnN3t0WrktvkttDZFOmRJ8PIgMTU8hRoOlrLzbZ bGmPJ2p5vzXm0XkPXwjD/m9yXQxEfrvQ00/XAG61VUKE+bLLsTigFbO+VOuLDGoxlZVS LQAKGMkWDtEagXzUDF1GmqoqX34P7rX6VDYzXTMryLajOXynx6jsgVxt4klV47T4+ZRn 03MA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=CkpJndIS961iAMYqy80lEUh7uV3OrKV2zpeEaXIJ8mU=; fh=ip7+QkkM488k9wyzFaZPu3h7BUQARzj44zdeG2KNIXU=; b=0ckeD6IQS3qWMEMIeiGGTJDo5qe/KQ8pCc+3ombDHghgdjCDnM6/HzQJwk7TOsyrmv Ek8+8WaKcIvgsIDyN+oIBZLPKdfeUZkPnVOLKmWtiKO9NlVP2GB13kbSGxrLpx1eRkcK fqbGgcHNEj+tHZnRYRpfDJv2q04+9vgAhI4opgKHwNN+6jTb/SRMjjOLfgK8nc4c3fxJ geFTQGSd8njRqHY5I2XOhnmvc376vvCcek3MpQAxxicRfBhh27t9Ba0oICsyvAL0SuWf hxBUsvwt8D2TOHfQPGXbtDhcbgxiBAL/uYiBrczqMJUEmOADMxhhNg87hwy/wQKYT3wD h0yQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IfJe9z0N; 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: <gdb-patches-bounces+patch=linaro.org@sourceware.org> Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id z3-20020ac87f83000000b00431651420cbsi767837qtj.755.2024.03.28.00.02.03 for <patch@linaro.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 00:02:04 -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=IfJe9z0N; 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 BEDAE385ED4A for <patch@linaro.org>; Thu, 28 Mar 2024 07:02:03 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id 91D03385DC06 for <gdb-patches@sourceware.org>; Thu, 28 Mar 2024 07:01:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 91D03385DC06 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 91D03385DC06 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::629 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711609296; cv=none; b=qjqr6hKgGE1jYNFr1gHn8Ep6bGPkNM2GSMNennAtdiBxZXpuvVvoOj3lxx6Nti23CEp+qIAbO0mbscYBt1qVYNWguBSZm7E70kpFevnc+hC9fL6er/mzggES4onxnBU8I7inpRNtLASOtSmTPTsAOAkGiOVVVNoEgMLEL2ohaNQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711609296; c=relaxed/simple; bh=m0zxqCy8ZHC4pqDMn5zPMAeOHRoB5JgRRsV+IvPQPCM=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=CwrExYixEKPb9gEwLb+ZzpymFjwvpIRm5EObiuuiOfgqXfkD+bRF2oLAFuRg5SVNgApkZMXPTTX3Fj6fReoPRARhFMvVIJEwlYN1AUmIkUJo3KRkzhYiAgh6FlO22vehG68xlLNOLip+CqaGcpZmepSXzp/AqM9Ob0ETRQDjaI4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1e0189323b4so4475295ad.1 for <gdb-patches@sourceware.org>; Thu, 28 Mar 2024 00:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711609293; x=1712214093; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CkpJndIS961iAMYqy80lEUh7uV3OrKV2zpeEaXIJ8mU=; b=IfJe9z0NdHlQaIVZpADMMdjA2qoioRnuHJaZNKhOVVYhuNSGhFHL8kICoRx1hX9Hvp ZzF9JWuEEqGF8wmxScloFk3FztLU6hzcgE4iVplZVgels5214Sojehad1AvxfHM6UJJJ 5SdMeohGm8U2NtI7CzvWOJJx5dNrUVb0eC6+6RMHa5mo7ACUl7zAytfbPnYK/x5565Mc MnMviUdT859WrMEG9S/y2IypexhfaHQEsOColW2XtzYyQnfavdrvdwYbglfcsBFJkvN4 FN/qjpVq4LTMNThKG84gaUd/5RjvgJWv0nygG/cQsX44eINHSbASHxZYN1WSB8g+wXHh +pcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711609293; x=1712214093; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CkpJndIS961iAMYqy80lEUh7uV3OrKV2zpeEaXIJ8mU=; b=GLA06TG72xa2ZKyN9Wzd8zKe0ddUyjuNbh+f8iw/y9U6qvo5fosPt7heoZuZPlsWvs S9ylMt5i2/z7Hf19Dpqyv+9GHDu2z/5V+Sd1TmvPu6T8Eoo3IGKb7d+FLSK1CyU4HWgR TlvWXUGyJb6Fp4MciW4vwaUK9T2+wNz+RFjmP4EZBngyV614//AuiXpvHILORQ1u57DA JsjjT8JXTQVEFtcpdUBaO+eh5nd2fnb21Rv5e4PQTov/86oL1kS+ASbYGGWEoTY9y2AH L7tK1mztRCKtYbKOijcHPmk94gzetrKtb5MfFznytU9ayGnGPDdVhg3rnFgTzBVOgcrA 7xOw== X-Gm-Message-State: AOJu0YxqdbMSwmdsaXm4iWO2Xvi7YEIx7VEMGszWJFlEP4t/OQvBzrXm sO1dPlS8ZzOYQWwBnOdiIJZxiL4Aa4fguppyvfBIRZaUF3nmysVH3vrKfS5oYJGfCPjZR6ZDYLb 3 X-Received: by 2002:a17:902:7248:b0:1e0:afbb:7a89 with SMTP id c8-20020a170902724800b001e0afbb7a89mr1672701pll.22.1711609293144; Thu, 28 Mar 2024 00:01:33 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 00:01:32 -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 3/4] gdb: aarch64: Remove MTE address checking from memtag_matches_p Date: Thu, 28 Mar 2024 07:00:54 +0000 Message-Id: <20240328070055.2578783-4-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240328070055.2578783-1-gustavo.romero@linaro.org> References: <20240328070055.2578783-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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+patch=linaro.org@sourceware.org |
Series |
Add another way to check for MTE-tagged addresses on remote targets
|
expand
|
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index 8e6e63d4dcb..fc60e602748 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -2476,10 +2476,6 @@ aarch64_linux_memtag_matches_p (struct gdbarch *gdbarch, { gdb_assert (address != nullptr); - /* Make sure we are dealing with a tagged address to begin with. */ - if (!aarch64_linux_tagged_address_p (gdbarch, address)) - return true; - CORE_ADDR addr = value_as_address (address); /* Fetch the allocation tag for ADDRESS. */
This commit removes aarch64_linux_tagged_address_p from aarch64_linux_memtag_matches_p. aarch64_linux_tagged_address_p checks if an address is tagged (MTE) or not. The check is redundant because aarch64_linux_memtag_matches_p is always called from the upper layers (i.e. from printcmd.c via gdbarch hook gdbarch_memtag_matches_p) after either gdbarch_tagged_address_p (that already points to aarch64_linux_tagged_address_p) has been called or after should_validate_memtags (that calls gdbarch_tagged_address_p at the end) has been called, so the address is already checked. Hence: a) in print_command_1, gdbarch_memtag_matches_p is called only after should_validate_memtags is called, which checks the address at its end; b) in memory_tag_check_command, gdbarch_memtag_matches_p is called only after gdbarch_tagged_address_p is called directly. Also, because after this change the address checking only happens at the upper layer it now allows the address checking to be specialized easily per target, via a target hook. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> --- gdb/aarch64-linux-tdep.c | 4 ---- 1 file changed, 4 deletions(-)