From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id kFJqHikq2mPN+yYAWB0awg (envelope-from ) for ; Wed, 01 Feb 2023 04:00:25 -0500 Received: by simark.ca (Postfix, from userid 112) id 6D5411E128; Wed, 1 Feb 2023 04:00:25 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=R2HxmaWY; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RDNS_DYNAMIC,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 7E9721E0D3 for ; Wed, 1 Feb 2023 04:00:24 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1DAF13858024 for ; Wed, 1 Feb 2023 09:00:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1DAF13858024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675242024; bh=y7P2CsSw3sDGNlVU4OCWZoHif5jFaMNiud6nVO08ghg=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=R2HxmaWYUKGGqo63Wdk90WeI99ADyB/ShUUVBq6D1zaoN4Wh/7YTjq30p3NF8DqPi ZNm+rfBQHIfqSGzHWgxfO1o6I02xDs4pCX6vK0WJvc5y/BFAngE6ys6uXAyawwiSlJ 9suqhOSGJjIVMobF5EZwZrPG1wnaIcfy62MUuIxY= Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2052.outbound.protection.outlook.com [40.107.7.52]) by sourceware.org (Postfix) with ESMTPS id EE1623858D38 for ; Wed, 1 Feb 2023 09:00:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EE1623858D38 Received: from DUZPR01CA0004.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::20) by AS2PR08MB8381.eurprd08.prod.outlook.com (2603:10a6:20b:558::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.33; Wed, 1 Feb 2023 08:59:57 +0000 Received: from DBAEUR03FT007.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:3c3:cafe::c9) by DUZPR01CA0004.outlook.office365.com (2603:10a6:10:3c3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38 via Frontend Transport; Wed, 1 Feb 2023 08:59:57 +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 DBAEUR03FT007.mail.protection.outlook.com (100.127.142.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25 via Frontend Transport; Wed, 1 Feb 2023 08:59:57 +0000 Received: ("Tessian outbound 0d7b2ab0f13d:v132"); Wed, 01 Feb 2023 08:59:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fb968996e6ee6077 X-CR-MTA-TID: 64aa7808 Received: from 4951a989b52c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B8A3A581-ED71-4C7A-8146-CE722B888898.1; Wed, 01 Feb 2023 08:59:50 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4951a989b52c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 01 Feb 2023 08:59:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OEnw5nIpodXKP6FRSEiR5Rt6O95tfjx83YuPdt1eKuHOk/EKkwDJZX0fO/2nRo3TgHgPs/BgoF1nBSAhWvelmtAB+8BDOkxHZxvKpkBdTU/XRp+4hGVfrvvN1E/zOr2Kq7pDW5sDyqcb+cZZdDZnKN76M0WsiTm5gLgCXg2bjwRmV9Z6Yw1Gc49A2ncvC7wTFrIWtsN5sYiMD3r8mNKcRfewJcA74d4XtaRr0RWhtOz2a5LZYKRz+mzaN1ULZWXUsY7QG2F/rkKDV8PQIaAa4/fJ8gP7cR3G895nL/Mnw+0qQkTrWdbMvfXqkQ9JdGJC8EG1XoJ8nsOooyj3bXY6CA== 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=y7P2CsSw3sDGNlVU4OCWZoHif5jFaMNiud6nVO08ghg=; b=Q2KN5zEiLqWHJWeH26MIBgVHTzyeNoL3Ir5LYnaqQ/Hzlr6z52NvWEzcfwR8q8H8fyb/FwEPB6YRCSqaM5DSS7x2gwPkPNBAS+MlYb6uCHNTtJHUq4bftbX5u+yrHk6Av85odHdPBeTPKSNDPPm0iSuxUqyKyiJwG0s62Wnif/dDM2O6f16hrBKCLgNtfYa76NBzv8gJtYK+9o0/Z879yg8j8m4L5ZcxLbZazOxjfLybwr8O7e/04GUtlNPH0BXoI5LN5gckCZyoUdZjl6kZNgQU1XiL86WsvB24MLOsfNC7N1aMbyiSK2upc3+RlbOuoYKJ5wnRDu8yeHlTIYmz0w== 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 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 AS8PR08MB8183.eurprd08.prod.outlook.com (2603:10a6:20b:560::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22; Wed, 1 Feb 2023 08:59:48 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6%3]) with mapi id 15.20.6043.036; Wed, 1 Feb 2023 08:59:47 +0000 Message-ID: <50e0d83b-ba25-e9ba-057b-207d84f732ee@arm.com> Date: Wed, 1 Feb 2023 08:59:45 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v3 3/8] gdbserver/linux-aarch64: Factor out function to get aarch64_features To: Thiago Jung Bauermann , gdb-patches@sourceware.org Cc: Simon Marchi References: <20230130044518.3322695-1-thiago.bauermann@linaro.org> <20230130044518.3322695-4-thiago.bauermann@linaro.org> Content-Language: en-US In-Reply-To: <20230130044518.3322695-4-thiago.bauermann@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0325.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::25) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS8PR08MB8183:EE_|DBAEUR03FT007:EE_|AS2PR08MB8381:EE_ X-MS-Office365-Filtering-Correlation-Id: 4cff07da-0492-4d8d-dcd8-08db0432b15c 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: YTMmFZ/4Y+XFOjN5zitkCj/Q25rttWfDuN5kLfNTnn7US4+wHzujDZvYTZzGJ+QQ9n5pW04oYsXfB4HgH/H+YQso/Uox2fuxfHtjv0t9yRLnV1iF0kb3bRowmtqeyJ9VtpjJdk/L/wK/OR967yFKwVA1LmRC1XNpsKo5hxantb2IkHS8JQz5JtY1Aws/XO+UfcWu8wjUYjSBdWN599HBrb1MtYeLYBUtybO/U3a67aO/1hgjO8i2uYyAsRmpe8Jaxk1OsFSr6/ZIsKHWznU9V35ks3BKIH3Ix3hhwGGYZhqsEpONgB9be5ZXMfQrCMDslu68PcfxKRM/6kx5IJ1f8WJ3D1bjMb1BVr+woKhF6tXNjpRz6e7R2NHxuRzAKJ3JcBC1wRMUi1r6daL8r67eMJFCLiRUo40lLAbf/3/rh1FIE7NEVdKHIpeeSGlEY8vyVw47e3WrDtjRgtQZFi+z9r0Wpj6+fbyDAEjSYvylQwK2xCiKd8jwJM4U+/G0T7oeHFuORN+fEC5CH1Q97ApNMXqVJJhH/dv45hglS63ZjsD5qnYxllruppSu2gGZDeQ5GSnY/gxhFgPMA0ziN7jy/ugOIt6ArRFB3rXWccvnQguCtMSwMjshZGli2q/RzdfsLq/W+2NxSyA6FctAp5VMot5Eq6L7MgxuC8l/qjs/TfFvzJb2K7BGgGysjH+x4JWUPQ24lBHXB9Yt09HGR1ZaCfODvRrf+OT4sTfkAOEsiGo= 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:(13230025)(4636009)(39860400002)(396003)(346002)(366004)(136003)(376002)(451199018)(83380400001)(2906002)(36756003)(44832011)(26005)(2616005)(66946007)(38100700002)(66556008)(8936002)(316002)(66476007)(41300700001)(5660300002)(6512007)(6506007)(86362001)(53546011)(31696002)(4326008)(186003)(6486002)(8676002)(478600001)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8183 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: DBAEUR03FT007.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 29f4edf3-6df0-4e59-bc03-08db0432ab39 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: akaWyrQCII0vIB8CSRq8ty+fejDT4j1EQbEzJCTUzkSqJL66MQfLoNCXes7zIp6h1KeSlQigK79Hc/vdcvcEM/rNY3b5+PU7MjzOw70uJDEl5o9gNiAKpY4WQQWKLm7s5PE3WGH76uhoBrQ4GAmhaAwM0LPqCDwxIy6SM3i8aWDMbgQKSILniupj5Si9AZ4Yn1ZbGmU+bxPpJh+VMkhiLKczoewmD0ImHcRp/pI+oKj477mfXyFAy6JKM2vL2i6kO7A5yeCVQLwd6Y7SbcMrO32lL+xa/LmYA9uQTxra4MSmZii/kSE4vnr3IzMZnq2Sd9VxrPp+d6w9BG57gupZU72JceVfkCami9TrnvYWWDnbWNp9UkLNOvS/zoCGvHZDH027JxOCk2cMQw5tt49AIdFqyuPBKvMHxxE2Sv4pnr1lOr1Z5pP6cn9rxR6mXZzHAZXNgTRsdgh/PpJ2Xt3bf8Z7NFYpqPJ2yED02f694kHDD6nfpxuS+OCX8mTRfmLkj/ZUewqnxJajxMskBoL6LV3BzF3DyrxeRiJNOumqeeAuv5JEMzvELms00YIBtCwi9hHVA3MFRlbKQs+RTtulJDas2ai5WPw33J4HxPdYJJvDFoLikBas12o+LA6cM15X88eXjoM0bLYyZDcHfFVZzvZC0sZ0J/PSN6q9CpNl3JRzPTts9CHtrOvlFwUqHYvth5Q8UcAQARUcBVPFdOndvy1oS/faPJXchEo93j5rUZU= 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:(13230025)(4636009)(346002)(396003)(39860400002)(376002)(136003)(451199018)(36840700001)(46966006)(40470700004)(47076005)(31696002)(336012)(82740400003)(86362001)(44832011)(316002)(36860700001)(36756003)(8936002)(83380400001)(41300700001)(40460700003)(4326008)(40480700001)(70586007)(70206006)(5660300002)(8676002)(82310400005)(2906002)(6486002)(81166007)(478600001)(356005)(2616005)(6506007)(107886003)(31686004)(53546011)(26005)(6512007)(186003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2023 08:59:57.3586 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4cff07da-0492-4d8d-dcd8-08db0432b15c 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: DBAEUR03FT007.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8381 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Luis Machado via Gdb-patches Reply-To: Luis Machado Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 1/30/23 04:45, Thiago Jung Bauermann wrote: > It will be used in a subsequent commit. There's no functional change. > > Reviewed-by: Luis Machado > Approved-By: Simon Marchi > --- > gdbserver/linux-aarch64-low.cc | 36 ++++++++++++++++++++++------------ > 1 file changed, 24 insertions(+), 12 deletions(-) > > diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc > index 2ed6e95562c5..92c621e5548c 100644 > --- a/gdbserver/linux-aarch64-low.cc > +++ b/gdbserver/linux-aarch64-low.cc > @@ -675,6 +675,28 @@ aarch64_target::low_delete_process (arch_process_info *info) > xfree (info); > } > > +/* Matches HWCAP_PACA in kernel header arch/arm64/include/uapi/asm/hwcap.h. */ > +#define AARCH64_HWCAP_PACA (1 << 30) > + > +/* Obtain the architectural features available in the given THREAD. */ > + > +static struct aarch64_features > +aarch64_get_arch_features (const thread_info *thread) > +{ > + struct aarch64_features features; > + int pid = thread->id.pid (); > + int tid = thread->id.lwp (); > + > + features.vq = aarch64_sve_get_vq (tid); > + /* A-profile PAC is 64-bit only. */ > + features.pauth = linux_get_hwcap (pid, 8) & AARCH64_HWCAP_PACA; > + /* A-profile MTE is 64-bit only. */ > + features.mte = linux_get_hwcap2 (pid, 8) & HWCAP2_MTE; > + features.tls = aarch64_tls_register_count (tid); > + > + return features; > +} > + > void > aarch64_target::low_new_thread (lwp_info *lwp) > { > @@ -827,9 +849,6 @@ aarch64_adjust_register_sets (const struct aarch64_features &features) > } > } > > -/* Matches HWCAP_PACA in kernel header arch/arm64/include/uapi/asm/hwcap.h. */ > -#define AARCH64_HWCAP_PACA (1 << 30) > - > /* Implementation of linux target ops method "low_arch_setup". */ > > void > @@ -845,15 +864,8 @@ aarch64_target::low_arch_setup () > > if (is_elf64) > { > - struct aarch64_features features; > - int pid = current_thread->id.pid (); > - > - features.vq = aarch64_sve_get_vq (tid); > - /* A-profile PAC is 64-bit only. */ > - features.pauth = linux_get_hwcap (pid, 8) & AARCH64_HWCAP_PACA; > - /* A-profile MTE is 64-bit only. */ > - features.mte = linux_get_hwcap2 (pid, 8) & HWCAP2_MTE; > - features.tls = aarch64_tls_register_count (tid); > + struct aarch64_features features > + = aarch64_get_arch_features (current_thread); > > current_process ()->tdesc = aarch64_linux_read_description (features); > Still LGTM.