From patchwork Fri Jun 30 13:44:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Machado X-Patchwork-Id: 114726 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp10376861vqr; Fri, 30 Jun 2023 06:45:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlGimHows2MYJZ3x5amlh4xPwHti9qRWNZp+jINsnWPCsy0G9OV1Llyl3WRF5YZWLs9xPN3h X-Received: by 2002:a17:906:5653:b0:992:9ea0:2317 with SMTP id v19-20020a170906565300b009929ea02317mr2340465ejr.61.1688132731726; Fri, 30 Jun 2023 06:45:31 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id g27-20020a170906395b00b0098e3591d105si7317097eje.405.2023.06.30.06.45.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 06:45:31 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Yey6VEDC; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EAF8B387093F for ; Fri, 30 Jun 2023 13:45:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EAF8B387093F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1688132728; bh=sdep4Kz77nfLo6psS2OPiE/7XQwALbIyN9r/yyNMxv0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Yey6VEDC6zzeopJ0v8pOO7FaH2i1rgHfyZwZVmZxuGbjbKjw8RDD02SF3Q6E5l9M6 HSMTQjZcTYSqWK7wQK0z1MVeb1vcMAqFwPGD+bwAqWughuh3T0R0ptNJnB+uhg8ODt B9amvLGtyAfdVj2Vp3HiLi3s6F2+Q4oF1WUGulLc= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2059.outbound.protection.outlook.com [40.107.241.59]) by sourceware.org (Postfix) with ESMTPS id A7A083870C0C for ; Fri, 30 Jun 2023 13:45:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A7A083870C0C Received: from AM0PR02CA0124.eurprd02.prod.outlook.com (2603:10a6:20b:28c::21) by DB9PR08MB8387.eurprd08.prod.outlook.com (2603:10a6:10:3d8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.19; Fri, 30 Jun 2023 13:44:58 +0000 Received: from AM7EUR03FT063.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:28c:cafe::1a) by AM0PR02CA0124.outlook.office365.com (2603:10a6:20b:28c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.22 via Frontend Transport; Fri, 30 Jun 2023 13:44:58 +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 AM7EUR03FT063.mail.protection.outlook.com (100.127.140.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.22 via Frontend Transport; Fri, 30 Jun 2023 13:44:58 +0000 Received: ("Tessian outbound 7c913606c6e6:v142"); Fri, 30 Jun 2023 13:44:58 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a2a5cf9d48f80b7a X-CR-MTA-TID: 64aa7808 Received: from 3f6faee451b1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1A872992-1C5A-4303-A7B1-A44B9332DFC0.1; Fri, 30 Jun 2023 13:44:51 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3f6faee451b1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 30 Jun 2023 13:44:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iWW5ARBaNulmj6mO1VHy+pzSg7hm/mzD68LFBwb+PUlLFKQA7ruhp2voQ+zADvF9lSfcgkdiOCWbgpQd5zWcbxHDAha8hkDcv6nwhuGYqE1wErVjPipm7XbFlT7fzblzSs/P6uUjLHdfQoouib7QbxK1H/GFsEMGSxu0/kL5RJdhv7eAoMDeFi/jwYWvZurwrwIzJ3zqQho2De042OREkK3F8JMcX25z+cduebbQjkiCruUc1kMCSW0s5p3y8RBdZOQm1CfL5UgAtx3p1l6HikvUbkBRSz6YdpbBC2sL87BdAS9ZA8VKEI15vxbW5ZwHyUPgPXWukThw+/1pQiwS1w== 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=sdep4Kz77nfLo6psS2OPiE/7XQwALbIyN9r/yyNMxv0=; b=Eoiw7wugoRP3ASPY7d6i6kch7L+8LcFTsFm2pBDRpeHjPMOOsTQTaZ/qWJRKDnaFRHSdLq4CI36B3tIpcbX1dPbm4nDFK3inHGHAsWR2e0Qpz3rk7eZ4Qz2lR7mtz+kedAZDDAiMldSOJHR2uKgv6x0czMIpznT/cvmGBEv5rIInXlyUNzBsQPAFpeGFbwxiAeDrMVjSKDMgOjC3XwSqg1NgedZE+D3h/Fxhe6Q+rMZPazXbcmQMHwou8F2bSTgvgqd0ujP3xrCjoFkT9x4hbK45XuLL8LbHbty72Q1TatE2pwZHsVMPWZYlIcWWJ8+eVDbG/01uamwg5RhPx3NuAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none Received: from AM6P193CA0072.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::49) by PAWPR08MB9097.eurprd08.prod.outlook.com (2603:10a6:102:330::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Fri, 30 Jun 2023 13:44:49 +0000 Received: from AM7EUR03FT023.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8e:cafe::f2) by AM6P193CA0072.outlook.office365.com (2603:10a6:209:8e::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.22 via Frontend Transport; Fri, 30 Jun 2023 13:44:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT023.mail.protection.outlook.com (100.127.140.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6544.22 via Frontend Transport; Fri, 30 Jun 2023 13:44:49 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 30 Jun 2023 13:44:48 +0000 Received: from e129171.arm.com (10.57.27.17) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Fri, 30 Jun 2023 13:44:48 +0000 To: Subject: [PATCH] [aarch64] sme: Core file support Date: Fri, 30 Jun 2023 14:44:36 +0100 Message-ID: <20230630134436.1237733-1-luis.machado@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT023:EE_|PAWPR08MB9097:EE_|AM7EUR03FT063:EE_|DB9PR08MB8387:EE_ X-MS-Office365-Filtering-Correlation-Id: 353f1b0a-7606-460f-6d40-08db79703221 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: UtYbzkfli1h6dNLBxeokpAOnrcfMQhi9WEEZn83+BionK/eoyaBs9aGLgcENfr34UxJuiNYOM6XFMhILuLHrlAxyPLbjG08ahFL/Vje+lSYOSaGvcGFxEqt71Tam06zkiCLbqpdTz+Omy9cpGRMpxKoztgqgVqlokcx8IRrNcHNMLy0J+8ht/+rXKPV02yYbsu088vG6sDBQEQHjje3qvU0yvAVICt1t7yATRVk7P4wZiyY+t7QKiXcT1zSFQXNKihhWfSD5lcjMibczv8buwuvmIfd23kIOzzthEEvonqxRGt2n/UuwT6+HIgKQA0dWPuOJ07KAbzdNX7YGAA5AXIWWcM4p1AKxqyhVt+QC4Mp8cLzZTq1SyLM1YAhO/7tvlyT4Gc6shCcpA2/RJXoiKojkeitEiS+MLnepL5YEaXqwkdjvwcOl6RhvMyIQYz99HsYgZuEhl72dvfzXt4hcGVWWbGfHzARrO19Vt0MK27QKeUQwvxg+S8WQuswXs32k1ZNpbTCiA583PbdGc3VvcHeCIV9t4oBd0PFMbUwdhrIB/GoQbjF0gnixMhL/cWYhajKhRtFSKoGuRkQPgXEuSH/9b8yzNDZGm8pGt6q8j/Q/g8vsOugVvRrvCwe0fkcgqPzFiaGoVdXIZT0UgE4Dnz43rQDWyZGwyrXDd0Re7dCjZjfkjybaJpP+FVhf9Wc8KEUF+FCo22aVuMJ2d6KUH1MRUNWpmVoNcWsNP2sLMRQIxgxldR6bZC4aR/FMGjVOKBmJGfaLna1QtLNVKSWnFA== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230028)(4636009)(376002)(136003)(346002)(39860400002)(396003)(451199021)(36840700001)(46966006)(40470700004)(82310400005)(36860700001)(40460700003)(47076005)(426003)(2616005)(26005)(6666004)(336012)(478600001)(7696005)(2906002)(186003)(1076003)(70206006)(44832011)(316002)(356005)(36756003)(40480700001)(70586007)(82740400003)(8676002)(81166007)(5660300002)(41300700001)(86362001)(6916009)(8936002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9097 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 7baf3058-a0cd-4d5f-63cd-08db79702c69 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VfKqjV+2kBymV4hL556s+JOuHRvY5Ykr9+XFmHyyiXM1HburidFJbM682VnBTr7uudS0Ik+MsrwRrZQwBW73B4a1SFFGpn37YCvm+l6woy7x6QhIYfksexMuD96yGOy99WFm5+7JxbLzt5fhGwNRWtCx6dRilvmbpZIyQdSlEDj0yuKYc5uT0FKdV4YvbhkQ/ag8O7NOUMd0JEawT6ZjfSsXbUSh9mjsUZFZhEQjzmvpG9PPYh5960VxeBg5rmspScJlv7rMPu89fyt6gMWVHDxX3cUhJgPEtsPf2mxXD6HellDfdvhjZpQvzrLF3pA3l+8GF3bAHaCedLkiJcI1o0nNA98Nqx+PWVmBLZwrNNc7IaUsoyVKs6xoH2O/G1ZquGP+PXjIlOTPxzYmEMv2HQr/FJ10DElkAe6bhqh1dWlEenGdRUZ7UxXQ/waCi4heCMH5DeGGJ7AbRFsZeGk2mWD/UVRd5vrP9W2zL/BUyY363fEc+veXhULGbNncQ/deLXDKzgaSid3K8LS7qfwQ6iQrpT481a2kuE1uAjOGMPft7ZJuyseVs9Qqv9p35H1Y7gYJheJja2gMM+UrPHMn0QL59ulVvrv04IKwHA+AigCZTWfcbwqp2JBXYX6AXhv+Q5mb0K5WP1fQ6oAlEbvTrXJRu3BU7IIyAOGUQkf5xrH8sGTbK7ptLR33tdbJG01myjKRN2d5zA2+RefcbbUerwlpYDVKLgPw0g0bSH+COqtYQI12VS9FP+/mawJKr8YQ 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:(13230028)(4636009)(136003)(346002)(376002)(39860400002)(396003)(451199021)(46966006)(36840700001)(40470700004)(82310400005)(2906002)(1076003)(26005)(186003)(81166007)(2616005)(336012)(426003)(47076005)(41300700001)(40480700001)(70586007)(36860700001)(44832011)(5660300002)(40460700003)(70206006)(6666004)(6916009)(8676002)(8936002)(36756003)(86362001)(7696005)(82740400003)(316002)(478600001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2023 13:44:58.6781 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 353f1b0a-7606-460f-6d40-08db79703221 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: AM7EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8387 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Luis Machado via Binutils From: Luis Machado Reply-To: Luis Machado Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770135467003302924?= X-GMAIL-MSGID: =?utf-8?q?1770135467003302924?= From: Ezra Sitorus Add required code to support core file dumps with NT_ARM_ZA and NT_ARM_SSVE register sets in them. These new register sets are dumped when SME is supported. --- bfd/elf-bfd.h | 4 ++++ bfd/elf.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index ec856764519..2a9eed7f9ee 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -2939,6 +2939,10 @@ extern char *elfcore_write_aarch_pauth (bfd *, char *, int *, const void *, int); extern char *elfcore_write_aarch_mte (bfd *, char *, int *, const void *, int); +extern char *elfcore_write_aarch_ssve + (bfd *, char *, int *, const void *, int); +extern char *elfcore_write_aarch_za + (bfd *, char *, int *, const void *, int); extern char *elfcore_write_arc_v2 (bfd *, char *, int *, const void *, int); extern char *elfcore_write_riscv_csr diff --git a/bfd/elf.c b/bfd/elf.c index d38e0afff2e..2a097b02977 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -10680,6 +10680,18 @@ elfcore_grok_aarch_mte (bfd *abfd, Elf_Internal_Note *note) note); } +static bool +elfcore_grok_aarch_ssve (bfd *abfd, Elf_Internal_Note *note) +{ + return elfcore_make_note_pseudosection (abfd, ".reg-aarch-ssve", note); +} + +static bool +elfcore_grok_aarch_za (bfd *abfd, Elf_Internal_Note *note) +{ + return elfcore_make_note_pseudosection (abfd, ".reg-aarch-za", note); +} + static bool elfcore_grok_arc_v2 (bfd *abfd, Elf_Internal_Note *note) { @@ -11395,6 +11407,20 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note) else return true; + case NT_ARM_SSVE: + if (note->namesz == 6 + && strcmp (note->namedata, "LINUX") == 0) + return elfcore_grok_aarch_ssve (abfd, note); + else + return true; + + case NT_ARM_ZA: + if (note->namesz == 6 + && strcmp (note->namedata, "LINUX") == 0) + return elfcore_grok_aarch_za (abfd, note); + else + return true; + case NT_GDB_TDESC: if (note->namesz == 4 && strcmp (note->namedata, "GDB") == 0) @@ -13009,6 +13035,34 @@ elfcore_write_aarch_mte (bfd *abfd, size); } +char * +elfcore_write_aarch_ssve (bfd *abfd, + char *buf, + int *bufsiz, + const void *aarch_ssve, + int size) +{ + char *note_name = "LINUX"; + return elfcore_write_note (abfd, buf, bufsiz, + note_name, NT_ARM_SSVE, + aarch_ssve, + size); +} + +char * +elfcore_write_aarch_za (bfd *abfd, + char *buf, + int *bufsiz, + const void *aarch_za, + int size) +{ + char *note_name = "LINUX"; + return elfcore_write_note (abfd, buf, bufsiz, + note_name, NT_ARM_ZA, + aarch_za, + size); +} + char * elfcore_write_arc_v2 (bfd *abfd, char *buf, @@ -13190,6 +13244,10 @@ elfcore_write_register_note (bfd *abfd, return elfcore_write_aarch_pauth (abfd, buf, bufsiz, data, size); if (strcmp (section, ".reg-aarch-mte") == 0) return elfcore_write_aarch_mte (abfd, buf, bufsiz, data, size); + if (strcmp (section, ".reg-aarch-ssve") == 0) + return elfcore_write_aarch_ssve (abfd, buf, bufsiz, data, size); + if (strcmp (section, ".reg-aarch-za") == 0) + return elfcore_write_aarch_za (abfd, buf, bufsiz, data, size); if (strcmp (section, ".reg-arc-v2") == 0) return elfcore_write_arc_v2 (abfd, buf, bufsiz, data, size); if (strcmp (section, ".gdb-tdesc") == 0)