From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id hhIGDUa1DmY+MyMAWB0awg (envelope-from ) for ; Thu, 04 Apr 2024 10:12:22 -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=ms/Wf0ps; 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=ms/Wf0ps; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 2200C1E0C0; Thu, 4 Apr 2024 10:12:22 -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 086911E030 for ; Thu, 4 Apr 2024 10:12:20 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 782613858C33 for ; Thu, 4 Apr 2024 14:12:19 +0000 (GMT) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2088.outbound.protection.outlook.com [40.107.7.88]) by sourceware.org (Postfix) with ESMTPS id 9A9FA3858C98 for ; Thu, 4 Apr 2024 14:11:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9A9FA3858C98 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 9A9FA3858C98 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.7.88 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1712239913; cv=pass; b=T2xdmAZZaxJT57rC8L9BnJJeTXRXanCKMpEviLWjcYP/qaXJ+DF76hflwZMhPWk8aDDIelPgD49eHq+6D6mH76hzZRhcuJ8zILcaQZTZ3Mt0H21c6ZN5mf85tNdGDTlMJRJYjwclyUKVcGQCWxQ4aN03lzsyi+eeum2UzuiYemA= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1712239913; c=relaxed/simple; bh=rQUGBv7H7xKDp3/2PshiwIGQL6REnEcPGwddJErioaU=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=kxThl0au8Y1DLyjAmv8QjPSptKWriZs7tGZ1B/kBR2pna1EqmmEBuaXJjwLZzl2YH6YGuQSdjAeq2rP7rujsV69hUH6YZe4Ur+QuZALG3U21VWJwZa+TQN7hfkBrIEMYznxStYrPCO6cLe39qwPmFMwWluK+laNGIPTOBug6U6c= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=L3+a9BcI/pqftotkLcT1OtDkRXYaBtg38BSDqanXeSYODkL3nvJ+USjAkHqUpngBfXA24QfJ8dlBU1CkiG/P0VoiEODN36TeX0Mw49OBdn4yVHQN+9x5eufOytuHXctAlklEnWIGiR/YlbNa+xVgUMUu+2JqecJ5fx4f/WSDFJ7aa0l6ugxbh3gEg0NlqnBzDzcjBbcpgMlubRGsVXiyeKnuvsUwRCmPfUd7hroarPtNMMXGnrKanj6raiVp7gaeYQZW//+5t0H74CWRyXoiRZkmEl4iTQyTTJBJIJtVWir9Hmx1kFmd4VnDRIbqxzHiIvW5VqOOPBIOmcVtNIOeUQ== 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=i1vqdeGG6zeTru5jtJ906oopqtwWtd6C8722IQ88k9s=; b=j6B3wv/AjHv6RAwLjweSlSMc1U9kFhUoMBxKTKF8d4A0WWN3oWoacicLLtYDdNT+ud4ZyhopeROl6q9bOymYMaPDo2kaiCbAOS457DEBILm/YiaKjs0Q0m0UNlHut+0seZ5RWA35MlP7XW4vc6vNsezDfq0/WvXXFwwJG91iTxCcjmLprNuiFVta6oTDSWZyIEslQHeN5W5SH6e+Zp3v0bHHYJ4dP5LKABTB3hn7dmRimGX6A/3S68aoQM4B17bcHeQf12N3DCPmLsaWEonvyIl5ib/ALQIHVfo3rWd/LfjWdPw0nvjAmUf7LypIfz6yrzguWZgkIK2MV584Po7wjw== 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=i1vqdeGG6zeTru5jtJ906oopqtwWtd6C8722IQ88k9s=; b=ms/Wf0psilILOutiHNk6N/9KG4xWYLDEDm6GZ1vAYUOl1JnFp9ClUyOsYAJXUVeDVROG6swj1HeNnPFl8E6MXmDjM+wHfFM4T1E5ZI2wjd+Zm970DYHYwGbzjBn2ecVJRPPC0YWgSaeiBFh1thaT3kRV/4fb9QOR5j2GiMyxbao= Received: from DU7P195CA0006.EURP195.PROD.OUTLOOK.COM (2603:10a6:10:54d::29) by VE1PR08MB5791.eurprd08.prod.outlook.com (2603:10a6:800:1b1::18) 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:11:46 +0000 Received: from DU2PEPF00028CFC.eurprd03.prod.outlook.com (2603:10a6:10:54d:cafe::8d) by DU7P195CA0006.outlook.office365.com (2603:10a6:10:54d::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46 via Frontend Transport; Thu, 4 Apr 2024 14:11:45 +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 DU2PEPF00028CFC.mail.protection.outlook.com (10.167.242.180) 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:11:45 +0000 Received: ("Tessian outbound ff4e98f65004:v300"); Thu, 04 Apr 2024 14:11:45 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8253899d431d9e5d X-CR-MTA-TID: 64aa7808 Received: from db2c4c25a6f1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 39333AFF-3C21-43A3-B037-8D99A7BEE211.1; Thu, 04 Apr 2024 14:11:39 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id db2c4c25a6f1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 04 Apr 2024 14:11:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RA3lXRS5QNXBeJGNVynOKDGnMeXPk5Ys7Ce7JgYMvl1yN0DfrNf7dtafazDXqBpfoUtktERyRzky2IcIDjl22D9evu/0KWuKWWhTWvKN/258lniDG8ANuo/D9neD+miTRzlyCDLf5lS/Ktmo3lXx90qvsp0x3NVg1VntM/BTEJi0rfKxExqMh/uir8XerLVfCb/bRHXxqXZnbrTrUqlcisZ5acj4R0aJzbB0oHahrmzDLeNpg3FPk7JkiXek3rGonxYk9XCD+YsjTFRHwudbhruJT4z/dZRy/SNK25jRCiQ0HllqhfpyRd8Clmej8GbYlKdunGKiZXqffVvLqkxicg== 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=i1vqdeGG6zeTru5jtJ906oopqtwWtd6C8722IQ88k9s=; b=C0tueDOqnr5SxToU+zVgU4n8U+oMx13yjI8dvRcVwHUQuQ3cKl7Ebs8mQe7GWrJ7FMRqXp4x6CoWA7XfcUaXIhgTw4plGsSjrOOKI6bfqKybMHPMrjQ3v1wM3i5/KCjNO036EWyslU+XvHCJQNFZsOOVt5PWNTxuhGkts6DVuWiJgqoDmNVUJtZhRoqkqFT+DvcyJAZMNWwmHPz6nU+QAikN6Ln5RQSzdUmJfebzkG9pWj8o6G2uvLivnfucAv4OPttPnNkXfJ7N74qgPUzX85+HB0wV8Izr5EpWLl8UF4jCXMaIRHkz6dR2buWndxzR0jxY/tJpu2E5FkDrMEfuUg== 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=i1vqdeGG6zeTru5jtJ906oopqtwWtd6C8722IQ88k9s=; b=ms/Wf0psilILOutiHNk6N/9KG4xWYLDEDm6GZ1vAYUOl1JnFp9ClUyOsYAJXUVeDVROG6swj1HeNnPFl8E6MXmDjM+wHfFM4T1E5ZI2wjd+Zm970DYHYwGbzjBn2ecVJRPPC0YWgSaeiBFh1thaT3kRV/4fb9QOR5j2GiMyxbao= Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by DBBPR08MB10531.eurprd08.prod.outlook.com (2603:10a6:10:53d::7) 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:11:35 +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:11:35 +0000 Message-ID: Date: Thu, 4 Apr 2024 15:11:32 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/7] gdb: aarch64: Remove MTE address checking from get_memtag 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-2-gustavo.romero@linaro.org> From: Luis Machado In-Reply-To: <20240404064819.2848899-2-gustavo.romero@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0584.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:276::15) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|DBBPR08MB10531:EE_|DU2PEPF00028CFC:EE_|VE1PR08MB5791: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: +suJy77zZ0pBzjMfEXWJSc06aW2bm88mb61d1b2Z9V76FOLcugg66GeOyN25FETcht44oacqQSYE6WHb4Ct4adWfmmjTOKk7n258MAf9rd/jAR13/lEgcaYD2tsirw2CoAvXBNAXKWXYc+7TruUpPlllgbFyJEK5yU2Sh4vXdrnkiRkK40qnnEueT3nNzvapWaF7JPqCSxoWVlBq6SibsTmCgn8dUnAS2Pm0J/8G4ia5w4V6ZCogdK432aoi97x5BCxEDuGIEezpmBiEtlE4V58PncjsbqhCAZaBgOwzRxduwzgxklLxAOqs2050JrxKsDOL+fsV0NZn6PdPE4tG50HGZA9MUd0VghWaJvfctaU5+mWoGhyllGdovlx3FiJb6cHqOvLNf+5Z7iASBubIWMCx68EB5F+c/rbnK1I/kdnnXoEB+EhDIhllIQcjC/nHZKQTbeI8MPwUxnPs9+vCjRtHnEl1JHXczgPfWHUsg51rKiiiqxqMinD2MfSSBZ/mjPGZx1P5CyXsCV0M8SsPjNZWYcztxuxKBFYi0/6FTjjZzooSYUvsVeiC9D/m6mUIQkBlPFZ54DcaLJNFOJVwsZ8MPozFY5Aj4XTMegi3nHT/vJrrKILQVUsGNurHFF8CsqgenkXfxZYK9dlNX8su2Qcu7mtJCklHUT9GH2Cpfxk= 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)(376005)(366007)(1800799015); DIR:OUT; SFP:1102; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB10531 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF00028CFC.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3433b007-1458-4b56-280e-08dc54b12957 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R2QpzUKec/CZnOVg1FR8EXaByL7p+frzXpNJgO+XnZSApIenETTquix5rtbh3qWf2/kS63hh4yrfgYPUeLPNs3h6m5i8jCwMEhigO8FBi3E2lR5hLDzHyCC6rKg6iEL1p78GrnVR4FRv9W9yWYAKnPHZxPxAs2AoFtKTBTMJff1fR14Act/sz3SCSKXuUuZbo7zg36/ZaAR7ynV6c+ARc9Z1GkoI/blcYcb8IZPw5J9UwBicHNkhRc3i+YoQD1QQMZe/q59AbE9Prc+n6CaORLndydPvWU5vsYJcR5qkKUWQAVsA7W7yR70cf5Zkduy0F3VyAoDeAxcMtc8NQfo51tYNWTkHzuoMfe8wzR3lNEYuw20jkNSVF3Hlf6Q5/6TAaPFg2qcOVCkmQ25Q7MgY+4Yxx9AdDujQOL99GLIHSui3svCbjFBEIAGHVGN6tt7fcCNuFaaXu8nZc7ULP5vQsFB1P+6LalWAPP8tDcox2gOWGkbRnfZ7gRu+ciiCGV+7gUkDjseki9Mf/mjg40wbGuo8f3SdFF4YeCYn5w27o1uVHJwa+4S0RpYjTnwJWaV+A+fjI9RFS5/UFWWVOtgPrmpTPDV79yotFBaYOZwXj0QZLSE5ltv16hGvwJHDE1TF7nJkEdN+wjenD3PAzIQN+lyElMNWX3ExFW4mHNFMRZUIbLqG8ia82RHOw8+dCq8aMh6i61dbyPqHeMLDaOShBN/94Jbn2beKSQ7hQc49TIJk0ZzlPAycVgpHgEajxi6x 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:11:45.9290 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3433b007-1458-4b56-280e-08dc54b12957 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: DU2PEPF00028CFC.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5791 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_get_memtag. aarch64_linux_tagged_address_p checks if an > address is tagged (MTE) or not. > > The check is redundant because aarch64_linux_get_memtag is always called > from the upper layers (i.e. from printcmd.c via gdbarch hook > gdbarch_get_memtag) 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, aarch64_linux_get_memtag (via gdbarch_get_memtag > hook) is called but only after should_validate_memtags, which calls > gdbarch_tagged_address_p; > > b) in do_examine, aarch64_linux_get_memtag is also called only after > gdbarch_tagged_address_p is directly called; > > c) in memory_tag_check_command, gdbarch_get_memtag is called -- tags > matching or not -- after the initial check via direct call to > gdbarch_tagged_address_p; > > d) in memory_tag_print_tag_command, address is checked directly via > gdbarch_tagged_address_p before gdbarch_get_memtag is called. > > 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 0b9784f38e4..50055ac3f48 100644 > --- a/gdb/aarch64-linux-tdep.c > +++ b/gdb/aarch64-linux-tdep.c > @@ -2575,10 +2575,6 @@ aarch64_linux_get_memtag (struct gdbarch *gdbarch, struct value *address, > tag = aarch64_mte_get_ltag (addr); > else > { > - /* Make sure we are dealing with a tagged address to begin with. */ > - if (!aarch64_linux_tagged_address_p (gdbarch, address)) > - return nullptr; > - > /* Remove the top byte. */ > addr = gdbarch_remove_non_address_bits (gdbarch, addr); > std::optional atag = aarch64_mte_get_atag (addr); 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