From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2066.outbound.protection.outlook.com [40.107.247.66]) by sourceware.org (Postfix) with ESMTPS id 746813854557 for ; Tue, 13 Dec 2022 09:18:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 746813854557 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=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=CqbVLaXIxxiyFpZqUcOmKeZ3cc2MB6Q4hCZezWXjcFY=; b=kJV0dghNwB3+RIbjxzO5NG3GMS5iPZBujcGtLLJyRFs+ijOhtpzImbztKgR9/bpmeAtiX50S7s8haVI6/KZZUHNqep6AKn9ajvK4w4dFpC5JQQTmPuie6rbDsJ/utzt2TuMscpgF+FgdujCqWkpxYHYZgs9BOQPmnWPgR45BmeA= Received: from AS9PR04CA0069.eurprd04.prod.outlook.com (2603:10a6:20b:48b::11) by PA4PR08MB7459.eurprd08.prod.outlook.com (2603:10a6:102:2a6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.10; Tue, 13 Dec 2022 09:18:40 +0000 Received: from AM7EUR03FT026.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:48b:cafe::7c) by AS9PR04CA0069.outlook.office365.com (2603:10a6:20b:48b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.8 via Frontend Transport; Tue, 13 Dec 2022 09:18:40 +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 AM7EUR03FT026.mail.protection.outlook.com (100.127.140.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5901.21 via Frontend Transport; Tue, 13 Dec 2022 09:18:40 +0000 Received: ("Tessian outbound b4aebcc5bc64:v130"); Tue, 13 Dec 2022 09:18:40 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7b1c98655be3b269 X-CR-MTA-TID: 64aa7808 Received: from 81aae5f01776.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8120BA99-AD1E-4F6A-94F2-279F4627C7BE.1; Tue, 13 Dec 2022 09:18:32 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 81aae5f01776.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 13 Dec 2022 09:18:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BeACYSEskQm5HyTGumj2NEmzMSivIU3t35BZIwreabp+z696w42spJ9vmtIUgVgX5/gHhcsKtiWMvM44mk0tcDwA6XvV7K1fkJfgYSy0vG3Vr4wX2Kzyrg0zueDCOlBF+Js8KWQFKpe0qYavgvOXdmm5mh5NIpyehHTyrvZzfX0zC/5YVKv3XODy1TW6P1iDcZj3C20F9s+GEzb8J4z59l6hH4pu3oTfpbEADGve8CbduAiFZ5D4EiMKn1LL7aBPjFDhJwJLRZ5oJctqYBcNwJiwjuxi7kv0UDxgxqqJukPb4HeVt+69ryNgiZGK0sNDEh2ms7Uxla6r/UtagfPLYA== 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=CqbVLaXIxxiyFpZqUcOmKeZ3cc2MB6Q4hCZezWXjcFY=; b=E0VBQxxM6bGM0gxY6/nrApcFeNzcS1LaH5eszsAHwibJW268ULlDw/IMcTbRfPYJhyUNtjf+ip4LuQ48NUGcJw0P+QVAkEndMKwwneGCqLu0sWPGHRg89/nRoC4KdVvatU1qadmvkTBfBvdCqY82SywJBhmtu3QeG/kMo4ktq5XsD7rZXr9LCUGEispXVhqfPOsoLX1DuEByR7r6fKcL9g0dx3rUmMb/c7ArLk+IfGj6sDKc02/Jb84IsrP6UXdVg/Y/kKAk1z5JCWry7h0734FnJJ8Vm2Ocam7RdYCrkjHpmgn6JVxu363yrRQjlCt/GuoDf2bEGbn7JvAo9dNjJQ== 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=CqbVLaXIxxiyFpZqUcOmKeZ3cc2MB6Q4hCZezWXjcFY=; b=kJV0dghNwB3+RIbjxzO5NG3GMS5iPZBujcGtLLJyRFs+ijOhtpzImbztKgR9/bpmeAtiX50S7s8haVI6/KZZUHNqep6AKn9ajvK4w4dFpC5JQQTmPuie6rbDsJ/utzt2TuMscpgF+FgdujCqWkpxYHYZgs9BOQPmnWPgR45BmeA= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by GV2PR08MB8631.eurprd08.prod.outlook.com (2603:10a6:150:b3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.9; Tue, 13 Dec 2022 09:18:31 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::eed7:25a3:e4ea:187a]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::eed7:25a3:e4ea:187a%7]) with mapi id 15.20.5924.010; Tue, 13 Dec 2022 09:18:30 +0000 Message-ID: Date: Tue, 13 Dec 2022 09:18:27 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v4] [aarch64] Fix removal of non-address bits for PAuth Content-Language: en-US To: Simon Marchi , gdb-patches@sourceware.org Cc: simon.marchi@efficios.com, jhb@FreeBSD.org, lsix@lancelotsix.com, thiago.bauermann@linaro.org References: <20220705140037.135012-1-luis.machado@arm.com> <20221212171320.799445-1-luis.machado@arm.com> From: Luis Machado In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0272.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::20) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|GV2PR08MB8631:EE_|AM7EUR03FT026:EE_|PA4PR08MB7459:EE_ X-MS-Office365-Filtering-Correlation-Id: f4884feb-873c-4cb4-b584-08dadceb0624 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: c5w/hms09K98SLi2E6jkcyW+QD/8H1D2YytCVTH55HcG7GqZrUdq5dIyZTpdAMWCDpFmt3mPJcPEaGQ3fuHB9ZizjGvStAh9wP1vze2ZygflkyGiverrXugKKhCtaxck8gFKK9K+WYgxvImFrLuUBky+syqtUTSH1EJzbWhr7D1+6R9mF5Oe3yw27gQoZhi7flm9klnJ5kzI9VAWST4mO3I1A7lNDYxEevzpnUQWhIziyWyw0WvSnN+z4G+jIx3bj3uFSnv3DROqJKAQziT0r7UTAVlyYsazeamFyEozOW6pZ/wQuGspaJlxSLLdrfoGJk0rktg/R8mtOqEuJCC5ge6zmMQvEgkzfY2bhM8Yod/Z8iLaaCawU+uL37rRKDoVTWzD7ADJY527aoqcM5dkEbSYHtBD5d/yFgynywP406MrZFRDVuel/UmYHfPquPrTuS/EoVqNFSZR57fOTyg14eNAiz+r1Zh1ISEOYQHAo+nfc9DoOgaaXa3zlZj1ETz4OBgY3q2kIlvjRvwHCoXDseOdnkNpsVd5/B1TXojP+SsDN+VipK+WdhbJxMOGXOg5xPx5bXdqAdV0OSlJ2foLMYQ63/frrdDPvetFECjXhztJ3ENg6GpYvjbCcoWCqGT0vYpIHKD2SQ4YgXAGdidvP5NrWO2ofB3QltWn/eG1sTCZGBFPoNjKevQNmcg/scP9Pfll+xFX7nfzBvgFO4JIEC/KwIV/jnHJPe+NLF7faAc= 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:(13230022)(4636009)(346002)(39860400002)(376002)(396003)(136003)(366004)(451199015)(66476007)(8676002)(4326008)(66556008)(86362001)(66946007)(31686004)(31696002)(8936002)(44832011)(316002)(83380400001)(36756003)(186003)(26005)(5660300002)(53546011)(6512007)(38100700002)(6666004)(6506007)(2906002)(41300700001)(478600001)(6486002)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8631 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT026.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 93d4cfdd-3cd6-446b-5ee3-08dadceaffff X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bmOSlM7w8PpBWzkX4lRtQlbErpBpGkryycmVmy7cs/yWFNA1L7Ei8q4UPjEhP1H0BhhsKzAu0Y2eZn1omRSLMD0Wz2vqlRXFdUOf4ZZ0r7kq23JWcy43LX2MFslXp6ZFpf43NFwJghP1OtG7ztdM/vr9kmaY+wO8DgYwtVY960fsUGM3I23YfaIH5X5nAxdQ7OtO10OiGPSt7LoKr9o/by4pPj+7aVSjtD0ZMMtOl2bYXuRZ2ELbzj8v7BYcLPj/BK++LRvERjprq/lxCHrJ3ZWL7MCHcJzuiNuZX8pGEJJqYm8nv0zm8gei8y53eaerSKp7VfPeX4C/U3TuVCGlj66montY+XoWbATycH5Lp/EuAWZsQmeB+G21NLXOp+etZRoK3gPewt3WJw5LaxsYSABX+IKLa0BtK2qzLL6Tj1SUFa+jGZwO3hJmWVbEqHwnVTMBiEy80HstWBnomFSWJoufZip8v1XswLpM69Qg09buyHAbJn/qVwt8pxpTdpo0X9z440/2B2b0MhnyDfGz888ncpFe7W+qihlOeQueaherPbIAVpqBOEidFG1Am8aGr2xxOASkiOcgyl+WedrMb6e8G6uo9dGfqYNEzofJopolJKm3xsJKks9hoboOc+sUuDYLeoOb/HLYopXR3ngSZxHvIxtXBLHo4bTd75rDDvB7mopPvyeDLS2payE5tq88KF0C+ibO/wGZ8cJtWmrriEvl5EBSMTtJ/id/SjVV4Gw= 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:(13230022)(4636009)(346002)(376002)(136003)(396003)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(36860700001)(336012)(83380400001)(47076005)(86362001)(31696002)(5660300002)(81166007)(2906002)(82740400003)(8936002)(44832011)(41300700001)(82310400005)(40460700003)(40480700001)(6666004)(107886003)(6486002)(6512007)(478600001)(8676002)(6506007)(2616005)(70206006)(53546011)(186003)(26005)(70586007)(4326008)(316002)(31686004)(356005)(36756003)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2022 09:18:40.4215 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4884feb-873c-4cb4-b584-08dadceb0624 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: AM7EUR03FT026.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7459 X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Simon, On 12/12/22 18:54, Simon Marchi wrote: > > Hi Luis, > > I noted some nits, but the patch LGTM in any case: > > Approved-By: Simon Marchi > >> +CORE_ADDR >> +aarch64_mask_from_pac_registers (const CORE_ADDR cmask, const CORE_ADDR dmask) >> +{ >> + if (dmask != cmask) >> + { >> + /* Warn if the masks are different. */ >> + aarch64_pauth_mask_warning (); > > We don't really need aarch64_pauth_mask_warning anymore, you can inline > the warning here. > Done now. >> +# Cycle through the tag and pac bit ranges and check how GDB >> +# behaves when trying to access these addresses. >> +foreach upper_bits {"0x0" "0x1" "0x2" "0x4" "0x8" "0x10" "0x20" "0x40" "0x80"} { >> + foreach lower_bits {"0x0" "0x1" "0x2" "0x4" "0x8" "0x10" "0x20" "0x40"} { > > I would perhaps suggest using foreach_with_prefix for these two, and > then you can simplify the test names below. I like using prefixes, > because it standardizes how the test names look when multiple variants > are tested or iterations are executed. For a moment I forgot the prefix variable gets printed alongside the value, which made me print it by hand so it would be more meaningful. Adjusted now. Thanks! I'll send a v5 of what I plan to push. > > Simon