From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2045.outbound.protection.outlook.com [40.107.6.45]) by sourceware.org (Postfix) with ESMTPS id 4976C3858402 for ; Wed, 30 Aug 2023 12:53:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4976C3858402 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=wsFpX5RGuWrFc6sXX1cnMItsSHs8jJyP6gYcoTGLTlo=; b=swu5atd3ELPC/VQWxap5qJRzFWwf4vgitZ7UhnJTS6RT7Gi9ct6QnZPaa9jgbCXXNuTtymFpCKY7oFY58OVL/bDyjgbZSMQfRgi/DZQIx+djyXXb4/SEBGuqiozO68QzAGLQfIYaFWl2k/bCDC39J/A6ETzUXqkfwuul2jC21jE= Received: from AS8PR04CA0153.eurprd04.prod.outlook.com (2603:10a6:20b:331::8) by GV1PR08MB7754.eurprd08.prod.outlook.com (2603:10a6:150:55::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20; Wed, 30 Aug 2023 12:53:43 +0000 Received: from AM7EUR03FT032.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:331:cafe::95) by AS8PR04CA0153.outlook.office365.com (2603:10a6:20b:331::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20 via Frontend Transport; Wed, 30 Aug 2023 12:53:43 +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 AM7EUR03FT032.mail.protection.outlook.com (100.127.140.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20 via Frontend Transport; Wed, 30 Aug 2023 12:53:43 +0000 Received: ("Tessian outbound d084e965c4eb:v175"); Wed, 30 Aug 2023 12:53:42 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 58ce4c8e411dd68e X-CR-MTA-TID: 64aa7808 Received: from 780ee3d70fa8.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 40087F98-7E5B-475D-BCBB-D6C2B4520033.1; Wed, 30 Aug 2023 12:53:36 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 780ee3d70fa8.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 30 Aug 2023 12:53:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KNmXj7BoLapozz4+m+4TqkhGcoMcyzJXHD2E6g2Joo3QkNPiruqBT3+LipRr4ZX0vdOshodfNAFO4N974ua1V93tbqmRMcAISOYjTRFle40rb/5AdW1QHnxkcP5DABEz9hpCN6jv4vkVXxdAokXJgImHYDOMhCfLctY8L/IbQikcLPlAYX6wA47Hnd5tSLqCuDt6hQB6fMZtAFwn/MiX4OyJZKv8jX0vT/jA2vO17IREGkplbRlTvAFVLFkcSa+q+1mwip02DsD7Zkq+sAhgI2JcLzGZB5VHmwml6LC09q+avLfkl6otITwwDhCs9E9DrbmFrsiLTyK6TdKIfZT3tg== 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=wsFpX5RGuWrFc6sXX1cnMItsSHs8jJyP6gYcoTGLTlo=; b=Ltb7/CcgZAkP0gpVgfy6f5iG60aR9VNFE8vl2XNFEQPzUUcuMHf5/kH7/Ds32sJrxankmL8DI1E2Sc0L/9WuNN9gGanDE2DiIjUYJ7ShvOPKVQ6rmWbKdvf4BditaDmP8brLYOyLsz/024X9/hN73vHfIMGbCcGJIAdLYJYPRhcpuFaHwFYwDOJLNGDZczviQz1FtwbSpUDWMN4TvICt/4USUFoWrwi63jnEZmRPpKrAKLJpPQYus6fC+za3LiySQcbU0Yrk6oGjDyQF6XliHcQvPyMEU84JvEMTg/BfHTmQN75309a7TOAgWHZX1qZMC1B5EhUjt/wZ+vQJHg10bQ== 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=wsFpX5RGuWrFc6sXX1cnMItsSHs8jJyP6gYcoTGLTlo=; b=swu5atd3ELPC/VQWxap5qJRzFWwf4vgitZ7UhnJTS6RT7Gi9ct6QnZPaa9jgbCXXNuTtymFpCKY7oFY58OVL/bDyjgbZSMQfRgi/DZQIx+djyXXb4/SEBGuqiozO68QzAGLQfIYaFWl2k/bCDC39J/A6ETzUXqkfwuul2jC21jE= 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 AS8PR08MB8492.eurprd08.prod.outlook.com (2603:10a6:20b:565::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.35; Wed, 30 Aug 2023 12:53:34 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7743:60fe:4859:2df2]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7743:60fe:4859:2df2%6]) with mapi id 15.20.6699.034; Wed, 30 Aug 2023 12:53:33 +0000 Message-ID: <39105c1a-6922-61c4-c615-357b82b6325c@arm.com> Date: Wed, 30 Aug 2023 13:53:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 1/6] [gdb/aarch64] sme2: Enable SME2 for AArch64 gdb on Linux Content-Language: en-US To: Thiago Jung Bauermann Cc: gdb-patches@sourceware.org References: <20230822112144.1513268-1-luis.machado@arm.com> <20230822112144.1513268-2-luis.machado@arm.com> <87o7itl1xi.fsf@linaro.org> From: Luis Machado In-Reply-To: <87o7itl1xi.fsf@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LNXP265CA0046.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5c::34) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS8PR08MB8492:EE_|AM7EUR03FT032:EE_|GV1PR08MB7754:EE_ X-MS-Office365-Filtering-Correlation-Id: a9cf0080-b551-439f-e360-08dba9582417 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: FcVecD02DlvHpaFqSmTgRnhBxXSeF9BkF0F+T1AARzHmSSuEe/uUGatLW5T+4fdhMIhzk6W6IFTrDIk/GryKi23g+vAf3V7nMbnOeDU3zlro3uxRsPGtMnjRAODZMZnJYJ/Y9d9YDJTxr/6TgydTdXlBNexaoeVajqL9BN8UTjv2IeFzuIYjR7vWqcs3bKHZFsVNGDDjXk36sA5bO/Owio4K6v5N9KySgU5QS7yOM5GD5NRrRmbx02rxMT5PWNKbbnjgw3HBKsublQvPmOg1OXuHxFmGev4YbGNWbyY11DynO7RDR0Meajx2W8mSIgOqlbHrcJEKVFEGlqVVFqNxNwxnT9D2K3kXcBkO14UFzPza/T1Q1t+EpzLjAS7A4Xhzud0y0YBvAYaaI0F284kWH3/Djgiiq+R4xj3/iTniCKk8EplHfp4s1/w32SkdWTvJ5mnX4sKNy4MfXjHBEPrcqxY1SrlgZ4GRmZeBfK9jOAFRULG7lrnvbhzjpeARisRAV4erwzd6S7ZRPsgXy18v6ekDIlVzPGy9RIo7HiWigd7OZ9wVuhTr+/0HDCBFQBb9Ww0C4rlYQFls0LAS3xEUrWAUlbo+054cGnWgmENE44gO3obuxrtDAOQjc+bCb98WLZiH2cT8gRqwlCXy5+vViQ== 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)(376002)(396003)(346002)(136003)(39860400002)(366004)(1800799009)(186009)(451199024)(8936002)(66946007)(31686004)(478600001)(53546011)(6506007)(66556008)(66476007)(6486002)(316002)(38100700002)(41300700001)(6512007)(5660300002)(8676002)(44832011)(26005)(36756003)(31696002)(2906002)(2616005)(6916009)(86362001)(4326008)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8492 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: AM7EUR03FT032.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d182bb52-b6df-4177-d291-08dba9581e2f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RM1NfC8sKITY2wA3O7SM5kszGLCktMNjto45VG7Zazb2ZhTGoP/wy42IrQYN2ydujaf2ihL4XkixepP3ZD3KE4L5KbSkJgDWPiQWyd1fOc9zwHvuWKt6T+foIfgJh/CI2Jdihg8WbvF88zF+Wjz9PvDleCgth209+dl4Q3MOzUEvKCg2umwYleSoRFQWDEc/F4yAicJ5UImHm1oGuPNDAd5Vetd8jL8plA20swsNibq4kJl1OO1zvtrgPPLLN86Z+WL525UJqRkI0tf0svcBazE8ueFZ23eZ30UPrvr8BpmPbLY9xVG+yjFKKyP01P4cz3SercEpPDWRJDaREM0X46do11ivndUAgXfmE05FmAiqTeWinIrjjN5qGuz2r/5Iyx0R32kP2Dkx1MqhFVWtJaL3z+QlJ37kRuAuHq8UHpnDrk1zioSoVj2OVJXe6UbyEPvAO9z9pxpzI2X1y1YQpydTT5H/RDJszDE3nw6T1a6dvdDdb8Cdj2xQ2Ye09mXgapRimP1SoB2aXnxe4JQ0/brm4YOjwIQgEEAKKUlz3gkigjN4oLGh3R3vIYu0dbw/o2KNYwTvjMW2OnmzojWA8nIO93TODveMN2Do5FuoSKBWhraKrkjwJNoXalZise6tRCOPSZkl4+tjjMQDoN2+2hP7RuwsNbL86sKwEVH7Iirpm1lQKEAKAjFLJEHHzdyV+Yhq3P+FHP5tkrLZ+S0gEMV42+r9rqrnqVelX+DKLQ3HKk8vW3szRmuzoca5zHWjrDVHYCjmeO+v0CcwkYY58Q== 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)(4636009)(39860400002)(396003)(136003)(346002)(376002)(1800799009)(186009)(451199024)(82310400011)(46966006)(36840700001)(40470700004)(40480700001)(40460700003)(316002)(70206006)(70586007)(356005)(478600001)(82740400003)(81166007)(2906002)(31696002)(86362001)(8936002)(8676002)(41300700001)(6862004)(5660300002)(44832011)(4326008)(36860700001)(47076005)(6512007)(6486002)(53546011)(6506007)(26005)(336012)(2616005)(36756003)(31686004)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2023 12:53:43.0349 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9cf0080-b551-439f-e360-08dba9582417 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: AM7EUR03FT032.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB7754 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_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 List-Id: On 8/27/23 02:16, Thiago Jung Bauermann wrote: > > Hello Luis, > > I have only one minor nit about this patch. In any case: > > Reviewed-by: Thiago Jung Bauermann > > Luis Machado writes: > >> diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c >> index d7fcef5a0db..edbe6895c86 100644 >> --- a/gdb/aarch64-linux-nat.c >> +++ b/gdb/aarch64-linux-nat.c >> @@ -376,6 +376,37 @@ store_za_to_thread (struct regcache *regcache) >> tdep->sme_svcr_regnum); >> } >> >> +/* Fill GDB's REGCACHE with the ZT register set contents from the >> + current thread. If there is no active ZA register state, make the >> + ZT register contents zero. */ > > Same comment about "current thread" from the SME patch series: the > function uses the regcache's ptid to identify the thread, so it's not > from the current thread that it gets the register values. > >> +static void >> +fetch_zt_from_thread (struct regcache *regcache) >> +{ >> + aarch64_gdbarch_tdep *tdep >> + = gdbarch_tdep (regcache->arch ()); >> + >> + /* Read ZT state from the thread to the register cache. */ >> + aarch64_zt_regs_copy_to_reg_buf (regcache->ptid ().lwp (), >> + regcache, >> + tdep->sme2_zt0_regnum); >> +} >> + >> +/* Store the NT_ARM_ZT register set contents from GDB's REGCACHE to the current >> + thread. */ > > Also here. > Thanks. Fixed now. >> + >> +static void >> +store_zt_to_thread (struct regcache *regcache) >> +{ >> + aarch64_gdbarch_tdep *tdep >> + = gdbarch_tdep (regcache->arch ()); >> + >> + /* Write ZT state from the register cache to the thread. */ >> + aarch64_zt_regs_copy_from_reg_buf (regcache->ptid ().lwp (), >> + regcache, >> + tdep->sme2_zt0_regnum); >> +} >