From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id lZj7Fi+3DmaKNiMAWB0awg (envelope-from ) for ; Thu, 04 Apr 2024 10:20:31 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=w1C75NGO; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=w1C75NGO; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 50E1E1E0C0; Thu, 4 Apr 2024 10:20:31 -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 3C9FF1E030 for ; Thu, 4 Apr 2024 10:20:29 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F35D93858428 for ; Thu, 4 Apr 2024 14:20:28 +0000 (GMT) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2087.outbound.protection.outlook.com [40.107.21.87]) by sourceware.org (Postfix) with ESMTPS id AA04C3858C98 for ; Thu, 4 Apr 2024 14:20:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AA04C3858C98 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AA04C3858C98 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.21.87 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1712240405; cv=pass; b=DEOPWLNQ6PKLwm7PACCHZKJusnxZpK2dIEqkt04pSlwZbPT7kVEkiLlc7Oo6raRAwSWFkDPNic9HosyIrg65OsWrHLukuwl+1ss70m2eKIbl52W0X7XIvgiiFY6Au7JUQd9wPKFW1z4nbj/oDeXmdEFAXwjxHIg8DpxZxzgdUHQ= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1712240405; c=relaxed/simple; bh=yArLz6+h/Zz/Rdwmi11OAE4+j6qna+uT8agTM0XoSKc=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=wx/hgejXmMaPJuxG0zSZ0bk0N2+JeIUNBUTq1vuLb1GNivYGPvpY4XHXBmhktlABlTZ2hdeylKqdfZeGmZ7AAatTFyapdQpwY5pqy1B/eMnawiKbxjAacrbu1xq6h4GzQHeGAiPE6TCRmdh6d8GGHWIZZR4AdJSgGi8eKrifLZ0= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=oAvqA9YjdRbY7g/sQejNTGMq6v/4HX6r4IFAwS+I6krhRsz8Pwme93VkZDpsO7u3U5F0DUiStPVuW0F1TkCpjncMnkDKsMopP2+hoHjJCqldJG1aNNvfNxlwEIvP7FVSxttz8M5xzoZcY0e1HdO55t2WUf2aBAFWsyOfzriMFwekWkxaIGwEAhN4QN3KVmxgGjFZIgNAPzrlBu2P5CEcUE//KDcUpPAZqFR9LcesTO0bV6Kg/yzJPKnJYoHjStN9qPlqFfTiLcs3njmzLbznq/MkK0IUlsOcTMJTsgM1RkCNzgdZzpw8abVitxq3nao2LjpcKXvCbfGgsB4E6ra55w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N+5lKI6BVKqnsuWNUeTgL4Z7CEguelVvxhEy9Kfp5kE=; b=m6xhYIYdfrF68Ftm7jD8ofQzymrXKzDvis+Ie6Qf1D3nY++mrS48jCBnxbXlHk4o3XTVTOAkXvfMj11D5wTcpb7reXri8a82SePJeGy0z7rOw5fqjAOAc09MP1JeYBT4h6BvlGklhC+zy7qrpWb/QNsv0itNwhSJarOtxozoW8TlErgRHXsRFkbXsgbTExutdgRE6Ki+WpDz/ZQbyAgjp1NRle+6+IZmbYB1krIszhW5Z8zXTVVijCaNw4XMS96lswDSTP+4wVAA+SMBEAfdlgQJ6hEvlNODj3YX0Cc8/0JQ/zh5i3mb0Af74C+k3s/J4ZVi/2jiyKBHhqpBXJ9lDw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N+5lKI6BVKqnsuWNUeTgL4Z7CEguelVvxhEy9Kfp5kE=; b=w1C75NGOam0X9d0VoShMRgdQchvyLOesoRCL24ZSf8cbC/K5AVTVm2tCscIyBhFzf4j9HTBHNvC/ev12h+DQ76k/llDesKn5KujLmdKJfmXjvJnGVwrC/kolCRNRVgLeSSNPjLDbrTA3Z3xbahwfqTK1Cvz/BHP5ueiSWOJ9ieQ= Received: from AS9PR05CA0117.eurprd05.prod.outlook.com (2603:10a6:20b:498::33) by AM8PR08MB6451.eurprd08.prod.outlook.com (2603:10a6:20b:315::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Thu, 4 Apr 2024 14:19:59 +0000 Received: from AMS0EPF000001A0.eurprd05.prod.outlook.com (2603:10a6:20b:498:cafe::5a) by AS9PR05CA0117.outlook.office365.com (2603:10a6:20b:498::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.28 via Frontend Transport; Thu, 4 Apr 2024 14:19:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AMS0EPF000001A0.mail.protection.outlook.com (10.167.16.230) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Thu, 4 Apr 2024 14:19:59 +0000 Received: ("Tessian outbound f0b355493f75:v300"); Thu, 04 Apr 2024 14:19:59 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f07c679a0ecb65ec X-CR-MTA-TID: 64aa7808 Received: from 9f4f3e66ab12.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C6B77D3E-FC05-42CA-9DC4-62B9AA3E31F3.1; Thu, 04 Apr 2024 14:19:52 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9f4f3e66ab12.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 04 Apr 2024 14:19:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RAPC536ha8pJANq2kVOXlifQPd5NVkiZR8SqL9lm6U/kEHHyVTDJnPE1gLsTRHCuH/vumqg6O+wiYkLNXhUtXFRHoogNWPQLeM/10Hay1ja1+W48YwfiSlO5YCok4+EmVCpyhnDqcfbZi79S4GaVBUy4/mOi5vYVUNpeog+AZ9dH9BVDjWd1rYE8pnGnM6WOwbQuzNKYxzAC4PjDMZJvUWywE4TfpL/9LOU5W5eZu+Jboohqm5Jqioubq6jDu2ZVDFijLp3dFHH77bhTReaqM4qPvlBHO7wOS/aRDbgRdiIznqt4eFotHDb8Ot7CLZS4BmndtaZBI/aBxMGaltn79A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N+5lKI6BVKqnsuWNUeTgL4Z7CEguelVvxhEy9Kfp5kE=; b=UmWPfJqvlMy2ciQtaNhEBVAEmTIOcSxiNG7o3Enb2RbSdstI2UtgDn81eSQ0SJXB14N4ALNvy72fy7zS5FC8d4k7PNwbN14wbnNcZrM24I049gU8AlCK5dnRUt446zHSq3JfXq1UsDWyetYvMkK4uuop9s5ippikLX8iyh8LqUr+G5dC/uQrTDWrYE2VyA/q9UjcpY0ZK6Sci6T0gWe8DhcoZr+A7BLqDd5ugCJQEhIZ3kERFaaAk7p8/kDBZjVRKSy11D2bElbpKSjIZGzZNYY3XO8B4NC7O9IPLJ+7Jl6FWHaeIfXN4zyTpHCn+OrS9DDS59HYqfDSOAAUwVzjwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N+5lKI6BVKqnsuWNUeTgL4Z7CEguelVvxhEy9Kfp5kE=; b=w1C75NGOam0X9d0VoShMRgdQchvyLOesoRCL24ZSf8cbC/K5AVTVm2tCscIyBhFzf4j9HTBHNvC/ev12h+DQ76k/llDesKn5KujLmdKJfmXjvJnGVwrC/kolCRNRVgLeSSNPjLDbrTA3Z3xbahwfqTK1Cvz/BHP5ueiSWOJ9ieQ= Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by DU0PR08MB10358.eurprd08.prod.outlook.com (2603:10a6:10:415::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Thu, 4 Apr 2024 14:19:50 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::363f:3fc8:fc36:58ed]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::363f:3fc8:fc36:58ed%5]) with mapi id 15.20.7409.042; Thu, 4 Apr 2024 14:19:50 +0000 Message-ID: <4e2ca4a1-2572-410e-8474-c36aa4098bc3@arm.com> Date: Thu, 4 Apr 2024 15:19:49 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 3/7] gdb: aarch64: Remove MTE address checking from memtag_matches_p Content-Language: en-US To: Gustavo Romero , gdb-patches@sourceware.org Cc: thiago.bauermann@linaro.org References: <20240404064819.2848899-1-gustavo.romero@linaro.org> <20240404064819.2848899-4-gustavo.romero@linaro.org> From: Luis Machado In-Reply-To: <20240404064819.2848899-4-gustavo.romero@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO6P265CA0018.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ff::6) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|DU0PR08MB10358:EE_|AMS0EPF000001A0:EE_|AM8PR08MB6451:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Htqa9DeYvtMSMTK1VfoQBxLLc5pquyWJD+4qzEtdcNssYjpB1ZCRZIn3g0Hj9K8Owgrs0Amq59vigDi353nZKDEz3/cINAj9dEeiunArptwTijlqMh8nnHqMFLBRdPY/RtEXppzjnz3A7/8thzFR8i5IH8EjfIGmHhirHlRzz0DVZjkXSHVQucwghyF65DaVwwzxwZmK/DhEMCRxEQpJpj5POk0IRukQIHSzvZK19w1NsLQuw/AlYxh0j0QHH8X7u6dl4fPv5CBsJkOFW5oVn2Wijy9APHO2NwDKE1E711VbnXbwhTiz24uF8XdPfox0KILeNU/QXs3auLVK/XyKM+AoXlQ2RNzNONXysVshnUkSh67i9+I9L2YUFouH5KUDqGUTMJFLZ65Bx14FeqeDooogNBNZhd6dUxi3nURAqZJbf8qszMk/qb8Eld+qLJY5LU+Ckab43adqDK2z6neTssCDytuASF0GkWu3mVWUR5yTzHkcMEgmcKPD2iMFbLT3b5YxO4R+jnql8Vr2mhaCEsbVNKntDQJk4WLJX/NmXVFY16VeC6eZinjY3OWk7baZ+UUjrnU/2ScnTDEpEfuxILUFyAlHVdn+3UuvUPTw/GYKVIjRrZTtBpDOaXxs4MC5lIAeuhDF4d7FFYExFngaJYyKvK1AK0Br7Y1ufihHvUI= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB3919.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(376005)(366007); DIR:OUT; SFP:1102; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB10358 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS0EPF000001A0.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e54fb7fe-b1df-48e6-1ddb-08dc54b24f80 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PSxmL150i81+L2XmeL9V2NnPqS6+VWM1YDZIDdM9rIry9lUtHmqmTaALtFe6dlOPQWyr1123Hw9knZN1MxVt6+EZpLToOR9H27I0tcMPEFmRHqEWiXWfch1iHYCOE052RqtyrJyD/HS30BnYeRhNP4upY/vRQG/QHPCvasu7W6MwGtnQG9Fh9hHYNekivXQMKa18owk2nFn07HdVvf3AhNHAVcxlm5stNAGwWfC5fSPu6mTozNViyNmLszxQ27enSsWCx/xJKB+oVjU30+zu+d3r7s8+8aRBBmpZdJ1u/ifd2gp/oWYX6jlqcuWVrNDgYnvlC+0cBV2Uz7r2Hq92wZOUIb6lk6FW1hgghes8eAhtLcfE4Ger2XTv7A3j/uT54OKMveVKn38Kb9PpfaF11olrnn61Vd4+2+ERQfzdnaHFWLDG52NzfQvF/wr8v4H/ebw1weUENZRJanHixBn+IKZjsRPjvRJRcBLyEhIJz4vqqUduT9MvAMGfQHu/0gftV5mydGGuavabnunO2SBgWpA9jaNV7Tr+knYJosZVat3rrQlGvXp/4bXjrzbWiKbYdT+244+mY7hKxLmOScnEeArW49UXWvW/mwwSg5db423nSfX+WMFZccet9dYXKGEsHTpknfFkBwCieoxwXX3zjOvKLyOnNpEvziGG4H2T+f8NYowKLvKYA8TwltIGOZ5EsuwYwvpe2qzU3VvfJdoU182KyURoyAVLwOg6oVHHuM24Gyl/Iig1YB7mvJJ/b2ht X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(376005)(1800799015)(82310400014)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2024 14:19:59.3850 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e54fb7fe-b1df-48e6-1ddb-08dc54b24f80 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF000001A0.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6451 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY 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 On 4/4/24 07:48, Gustavo Romero wrote: > 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. */ Thanks. This is OK and can go in separately, or alongside the rest of the series if you wish. Approved-By: Luis Machado Tested-By: Luis Machado