From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id INxZCX5NDmaMySIAWB0awg (envelope-from ) for ; Thu, 04 Apr 2024 02:49:34 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=MIl5LrkE; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1BB1A1E0C0; Thu, 4 Apr 2024 02:49:34 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 00F491E08C for ; Thu, 4 Apr 2024 02:49:32 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A2EA73858C50 for ; Thu, 4 Apr 2024 06:49:31 +0000 (GMT) Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id E215F385840A for ; Thu, 4 Apr 2024 06:48:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E215F385840A 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 E215F385840A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::236 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712213333; cv=none; b=q4f3QmK325omzM7ZCA2jtkz6UaD2Bz3/sCYNUl51f86Z/ENH9gDJ+HEmg2YomtE1sH4ewdofnst8tUlF3XG8w+i79wX/50z2LqcaP8xW6amW8PV5GHfOFV5bRHlwiOhxXkg+CCtmv9Gl8HTAobaOXFgS3Cwl3pH+WkEze4EJKjc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712213333; c=relaxed/simple; bh=m0zxqCy8ZHC4pqDMn5zPMAeOHRoB5JgRRsV+IvPQPCM=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=cBdAMT2YC+EPnErO3wfTJVnN2P8YD3PSqESzo8ITc+MUa/cJ8StkUOTggKjXf6Z9bQt6STA2IzNUizdQXlyvZpDTUuYIpXIsp8gmZQNbKuu/fb8nazgMDHCmfaV3L1FyHVaMaZjvZI98qtpqh3OftaioeXUF4k59jhMdlI4I+fU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3c3e2e18db7so377936b6e.0 for ; Wed, 03 Apr 2024 23:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712213330; x=1712818130; 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=MIl5LrkErzFqCMBwR/1Boz/58FrG02lP3qxaJDK0Qmg/d+xFHg8bOGaiHIUwBzR1hp V4o7DpYCgLzIVUTjxO6PNRqj7FhRRdFJw0qOXOfSHiFfkT4DFNNSVzTn8MgPlhxecoch XUhtDuucKOKsXAGPnDYeRdOcqekhQwoh4EQ4d5cz+pEQr625STf+h2ymgNx+Wq9PEq2h J9XcI9uFJ1w7qCT9qp/71wADa4/5jmGosgu4wCTO7G2uQd5DvHw9SBcxZHxj+Di/7O9L lBEta+ogyTaBGbYcJ6dac72w9PmRzfMyr8MFUSAMZQkpy8BGAMawjCMbxycLikFzOMfv spIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712213330; x=1712818130; 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=Xezg1hy8sXaCfePta0Z6foYheuFnTNDb50j2aITKS8BBsH7qWGxVo3BLLbtOYkzFkM JgRtgsuFIYd8ftsGyLfL7uxRbOIYWi89brtsTLAyNiDZj3mgKblEvh8v3Ccmm/dyCJJR CJEVkG/3J2YCdm5aghcC92uylq9DQYzBC+lWnNHGPimYFtOsDyWHSItKBDsx0gZb/iyc J2uglPre/YVt2x72njp5rpPDGOJ7w+wzMo9lc1BV1VuYCdLknxt+xo9Lkgzl67JSw0T/ FoC+j5j9o1WwJNXCccNLSSkMhY/HJTRPdtwqswAFlpa1ptUfnlIMIK53UkkvRJkr5Zm8 ye2w== X-Gm-Message-State: AOJu0YzXluY0zO+xlywmqfhBlatc/OM1+f1ToURbvfwBkdTphoiUIvsM Ypo4tk1CMtpZ7bSzCXNUZlJez0yUbKK9OBzYd6LHHkKC55OPhWAXCAVpo35BAxFrl7aclh/EGU9 v X-Google-Smtp-Source: AGHT+IHxAoij9xUeXbrGXG38bHhzeze2mPU1tY94oPc02wymP7S2m3PKibK8FPURlUXwcb4At/9Idg== X-Received: by 2002:a05:6808:178d:b0:3c5:d4e0:b295 with SMTP id bg13-20020a056808178d00b003c5d4e0b295mr1684394oib.0.1712213330609; Wed, 03 Apr 2024 23:48:50 -0700 (PDT) Received: from amd.. ([2804:7f0:b402:d0dc:3e7c:3fff:fe7a:e83b]) by smtp.gmail.com with ESMTPSA id n16-20020aa79850000000b006e64ddfa71asm13218899pfq.170.2024.04.03.23.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 23:48:49 -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 v3 3/7] gdb: aarch64: Remove MTE address checking from memtag_matches_p Date: Thu, 4 Apr 2024 06:48:15 +0000 Message-Id: <20240404064819.2848899-4-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240404064819.2848899-1-gustavo.romero@linaro.org> References: <20240404064819.2848899-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org 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 --- gdb/aarch64-linux-tdep.c | 4 ---- 1 file changed, 4 deletions(-) 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. */ -- 2.34.1