From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iMjRKPThNGTHZygAWB0awg (envelope-from ) for ; Tue, 11 Apr 2023 00:28:36 -0400 Received: by simark.ca (Postfix, from userid 112) id A3FFE1E221; Tue, 11 Apr 2023 00:28:36 -0400 (EDT) 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=hUoUFPkv; 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=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1346C1E110 for ; Tue, 11 Apr 2023 00:28:36 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8BC603856248 for ; Tue, 11 Apr 2023 04:28:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BC603856248 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681187315; bh=IySlSi8SAVUQm7tH+kJiaEYlbgB9B5hd1xSSVL/3Oo0=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=hUoUFPkvRCE0oTMWYzDLrufqXCMWXjUmp1Nb5/95g7hi2WVT+IJNIZ+sYKc8O+vQV O2HA4oHskmBUHeh/puJ5653+Yts/D1QpVXgF5WbGFvM6O8n13StwhXRGRm36rG3O8a J44ZwhUSbo6k5n7JS3EFWbpAhGsuD2hbuPZXnW14= Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2049.outbound.protection.outlook.com [40.107.13.49]) by sourceware.org (Postfix) with ESMTPS id 219F5385841E for ; Tue, 11 Apr 2023 04:27:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 219F5385841E Received: from DB6PR0402CA0017.eurprd04.prod.outlook.com (2603:10a6:4:91::27) by AS8PR08MB9717.eurprd08.prod.outlook.com (2603:10a6:20b:617::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Tue, 11 Apr 2023 04:27:18 +0000 Received: from DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:91:cafe::79) by DB6PR0402CA0017.outlook.office365.com (2603:10a6:4:91::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.39 via Frontend Transport; Tue, 11 Apr 2023 04:27:18 +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 DBAEUR03FT021.mail.protection.outlook.com (100.127.142.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.20 via Frontend Transport; Tue, 11 Apr 2023 04:27:18 +0000 Received: ("Tessian outbound 3a01b65b5aad:v136"); Tue, 11 Apr 2023 04:27:18 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5a06a69fec2f5522 X-CR-MTA-TID: 64aa7808 Received: from 289483c94157.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 67C38F99-65EF-4725-98D0-C75E32B121EF.1; Tue, 11 Apr 2023 04:27:12 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 289483c94157.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 11 Apr 2023 04:27:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UTOMhbGHGM1C5ML1ZBJ/L6V2yDQY6tDvyG3pF07OMplSuS4XZMmnyhBUNh7Z15c5nYHRAuIyBuNdGbeo0VOqa6x0ShaivPbNE//9jnSXmWWsEA/JYRAOiV+UrGN/oLLq4zVMq7lcxtnj8Nhtww3yQM3boP6B9g1XLdXQT4BzKkoXUiU8HZsiPTEu1j2B2kJ2LECL8w5IXhRVm9A5b0GpoVOHuQ8AetgpSjWgmb1kJLyImjNtHkUuykpLn409kLuKdLwp6UrgcMo/zaSbozRWitcSyDCz5F7TGD+us0j//ejgVxzoWogCp9KUUfafCnCpetf7KM58qkSdjAI1bzLztg== 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=IySlSi8SAVUQm7tH+kJiaEYlbgB9B5hd1xSSVL/3Oo0=; b=eL1XXGSNez0tU8u2hVKMm7DNsewLbw2oYTlOIIE7M4JRqDbPQudAuCbmQ3pEPB4yjYp36QPJfBGpvTpNG0z3DHJxeRxCB1+5y61onAtilRuAGDQaic9LdkkyaJP6yExqgVYip1wloovaFpYS0z5voAncBPGj/vqythokas6xb5sppnNTth+o2egcF45UGmFD5Vn862vZP3YcItX+78hnwQfUKExtmaisK/NRSSlCJhf70T2kNOndbA4WdooDPnpJhiRkw1r8YmxK476o/IEjUOO6iUQLHPoAlFohXQjQ3oGyqpAKIqjKBxed/2YWtiypaJpV3FTclsZFkSsPwA1VHw== 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 AM3PR05CA0122.eurprd05.prod.outlook.com (2603:10a6:207:2::24) by AS4PR08MB8142.eurprd08.prod.outlook.com (2603:10a6:20b:58d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Tue, 11 Apr 2023 04:27:05 +0000 Received: from AM7EUR03FT053.eop-EUR03.prod.protection.outlook.com (2603:10a6:207:2:cafe::16) by AM3PR05CA0122.outlook.office365.com (2603:10a6:207:2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.40 via Frontend Transport; Tue, 11 Apr 2023 04:27:04 +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 AM7EUR03FT053.mail.protection.outlook.com (100.127.140.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.25 via Frontend Transport; Tue, 11 Apr 2023 04:27:04 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Tue, 11 Apr 2023 04:27:04 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Tue, 11 Apr 2023 04:27:04 +0000 Received: from e129171.arm.com (10.57.80.123) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Tue, 11 Apr 2023 04:27:04 +0000 To: Subject: [PATCH 07/17] [gdbserver/aarch64] sme: Add support for SME Date: Tue, 11 Apr 2023 05:26:48 +0100 Message-ID: <20230411042658.1852730-8-luis.machado@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230411042658.1852730-1-luis.machado@arm.com> References: <20230411042658.1852730-1-luis.machado@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT053:EE_|AS4PR08MB8142:EE_|DBAEUR03FT021:EE_|AS8PR08MB9717:EE_ X-MS-Office365-Filtering-Correlation-Id: 338e38eb-19be-4823-44d1-08db3a450936 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: QM4XwEluBodBx9slz66UJlD8TmzY5PwQ9McUtbQ8HMaW+eJdzvwfFgX+AxBrCIwhJ5R3cVzgLMqbPVfy+uk7croPbpGFPnPWARpFrM5GkO3MAmBapFqHp3DyAj5zgCDT6A48uAjHaAaUpZ55hM5rIkVKVH0yWp6Nv2/SiD0KWRN9+FKdDtjg7/Qx3VJqQcqBwbUgvbyqz9AvCgqfRjzb8/l3pUHeHaXKu1IyyEgEo5Cl7i4bRS0OkEVoQv/zOSvlCV5rRolnf6y0FsP9x8FUQD/35UfSp7HUEp34XV+ci3WlPmu5S6EzWP1VJBhO+3MoUCVSqHPFGXOT8+qUqTwHfmELeyddmD2IJyQOx0j9b8BrxrIPEAywgvu6xYJmYNf10KNmRilSHIMWrLtVG+/Wh10JoIEa97EgpoCXrva4IMbFvfRd86pj/wciKtI/0m4+qnhAuaUtATa87Kw2KVshRhZzJfscu8+TJW3DPwwTRXWgr7+uZrzoOPVP8CRK4iHVIw+lnlFi3ZrarCHjFgGgcf0cym3014rMhLJW0RjSM77o+pak783yIvGtOW9C0hrnKUxeaSnSm0nOsmhWEOI3M5kd4SsId1zU3K2wZ09ENnw3b3VcS5/qLoXYl5/1EmAu1ZaL2VayFBLWHjxoGUtDrlA90xpxbFNKRoeRvGRztv6GyFl9/taTLyfuI2QEo80svkX1PyEow5/Laz0DZSaAfA== 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)(396003)(376002)(39860400002)(346002)(136003)(451199021)(46966006)(36840700001)(86362001)(36756003)(41300700001)(316002)(70206006)(478600001)(70586007)(6916009)(8676002)(7696005)(40480700001)(5660300002)(82310400005)(2906002)(44832011)(8936002)(81166007)(47076005)(82740400003)(356005)(36860700001)(186003)(6666004)(26005)(1076003)(336012)(2616005)(426003)(83380400001)(66899021)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB8142 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f5bb8e87-49e8-4ccc-4d6d-08db3a450125 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P4blZgPzwYFmxk0jVseVOuaTjRTW34KGBm6pVK3T403FRzFkSwKRJ0tmoG07YqAMxEhu1cPa5I5ajvx2I7QCYC577Hu5no/ZLbg022IWvWUsz0DKCtJcfT2ZZd0XpHDkfZU8i9gBL4yfmUIss35TNti77rQjSkWlUphrPwH633cvIrs5wmfk4XPgAgEHkxIf4AO52W+iYX9AlzMtW3EKcHqn2ZTLixatDAZdw/CMXsiFzMAy8c5E5AgR8omDI4bHxRFoodVHU3FrHSUzxeJd1PO/UcEwqx2QJw18REIOVVF2sKg84wC2DuD3ys5gbBidSjTsa6LltqtnwOa8lbSxJzdPbyyvE7iMxqlWuJs1sHyQjLovMJBuDK+rsorgFzI9VfEPK7KttSmI0QcNQIladZh/BgHZJ0QUYz3SHs9r8wnEXZAKVVrELFxyHp092B883z9R/boZN+YhW0CAE1jcB7SIrNKCt3byY9NrtrrL0FEdVeVUi9i2NcsqP3FPFXG+DayUPVGVa2GS8QoLoUiJzaLJ2c0LvhXXuIBb40tTndnK+LiAiPgRegDczwvJDY/VuKnEzWn+gH3C3GodT+xIokkqwlceKdyQhSSQChqys4AyLu1tk/RL+lPL5SLUSuK+CI+xapZ7tYop/X3VStxORdi66L5E8z8pxNM0vIQ6GH1zM74tQSeklVEfNUP6UOOQylrXPSELP+vbO77sphm1FA== 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)(346002)(39860400002)(376002)(136003)(396003)(451199021)(40470700004)(46966006)(36840700001)(36756003)(86362001)(7696005)(41300700001)(316002)(478600001)(6916009)(8676002)(70206006)(70586007)(82310400005)(40480700001)(5660300002)(2906002)(8936002)(44832011)(82740400003)(186003)(36860700001)(81166007)(6666004)(1076003)(26005)(426003)(336012)(2616005)(83380400001)(47076005)(66899021)(40460700003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 04:27:18.4606 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 338e38eb-19be-4823-44d1-08db3a450936 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: DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9717 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" Enable SME support in gdbserver by adjusting the usual fields. There is not much to this patch because the code is either in gdb or it is shared between gdbserver and gdb. One exception is the bump to gdbserver's PBUFSIZ from 18432 to 131104. Since the ZA register can be quite big (256 * 256 bytes), the g/G remote packet will also become quite big >From gdbserver/tdesc.cc:init_target_desc, I estimated the new size should be at least (2 * 256 * 256 + 32), which yields 131104. It is also unlikely we will find a process starting up with SVL set to 256. Ideally we'd adjust the packet size dynamically based on what we need, but for now this should do. Please note we have the same limitation for SME that we have for SVE, and that is the fact gdbserver cannot communicate vector length changes to gdb via the remote protocol. Thiago is working on this improvement, which hopefully will be able to be adapted to SME in an easy way. Co-Authored-By: Ezra Sitorus --- gdbserver/linux-aarch64-low.cc | 74 ++++++++++++++++++++++++++++++++ gdbserver/linux-aarch64-tdesc.cc | 7 +++ gdbserver/server.h | 2 +- 3 files changed, 82 insertions(+), 1 deletion(-) diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc index af2e0fd9c10..93f5f4bb499 100644 --- a/gdbserver/linux-aarch64-low.cc +++ b/gdbserver/linux-aarch64-low.cc @@ -41,6 +41,7 @@ #include "gdb_proc_service.h" #include "arch/aarch64.h" #include "arch/aarch64-mte-linux.h" +#include "arch/aarch64-scalable-linux.h" #include "linux-aarch32-tdesc.h" #include "linux-aarch64-tdesc.h" #include "nat/aarch64-mte-linux-ptrace.h" @@ -750,6 +751,66 @@ aarch64_sve_regs_copy_from_regcache (struct regcache *regcache, void *buf) memcpy (buf, sve_state.data (), sve_state.size ()); } +/* Wrapper for aarch64_za_regs_copy_to_reg_buf, to help copying NT_ARM_ZA + state from the thread (BUF) to the register cache. */ + +static void +aarch64_za_regs_copy_to_regcache (struct regcache *regcache, + ATTRIBUTE_UNUSED const void *buf) +{ + /* BUF is unused here since we collect the data straight from a ptrace + request, therefore bypassing gdbserver's own call to ptrace. */ + int tid = lwpid_of (current_thread); + + gdb::optional za_regnum + = find_regno_no_throw (regcache->tdesc, "za"); + gdb::optional svg_regnum + = find_regno_no_throw (regcache->tdesc, "svg"); + gdb::optional svcr_regnum + = find_regno_no_throw (regcache->tdesc, "svcr"); + + gdb_assert (za_regnum.has_value ()); + gdb_assert (svg_regnum.has_value ()); + gdb_assert (svcr_regnum.has_value ()); + + /* Update the register cache. aarch64_za_regs_copy_to_reg_buf handles + fetching the NT_ARM_ZA state from thread TID. */ + aarch64_za_regs_copy_to_reg_buf (tid, regcache, *za_regnum, *svg_regnum, + *svcr_regnum); +} + +/* Wrapper for aarch64_za_regs_copy_from_reg_buf, to help copying NT_ARM_ZA + state from the register cache to the thread (BUF). */ + +static void +aarch64_za_regs_copy_from_regcache (struct regcache *regcache, void *buf) +{ + int tid = lwpid_of (current_thread); + + gdb::optional za_regnum + = find_regno_no_throw (regcache->tdesc, "za"); + gdb::optional svg_regnum + = find_regno_no_throw (regcache->tdesc, "svg"); + gdb::optional svcr_regnum + = find_regno_no_throw (regcache->tdesc, "svcr"); + + gdb_assert (za_regnum.has_value ()); + gdb_assert (svg_regnum.has_value ()); + gdb_assert (svcr_regnum.has_value ()); + + /* Update the thread NT_ARM_ZA state. aarch64_za_regs_copy_from_reg_buf + handles writing the ZA state back to thread TID. */ + aarch64_za_regs_copy_from_reg_buf (tid, regcache, *za_regnum, *svg_regnum, + *svcr_regnum); + + /* We need to return the expected data in BUF, so copy whatever the kernel + already has to BUF. */ + + /* Obtain a dump of ZA from ptrace. */ + gdb::byte_vector za_state = aarch64_fetch_za_regset (tid); + memcpy (buf, za_state.data (), za_state.size ()); +} + /* Array containing all the possible register sets for AArch64/Linux. During architecture setup, these will be checked against the HWCAP/HWCAP2 bits for validity and enabled/disabled accordingly. @@ -772,6 +833,11 @@ static struct regset_info aarch64_regsets[] = 0, EXTENDED_REGS, aarch64_sve_regs_copy_from_regcache, aarch64_sve_regs_copy_to_regcache }, + /* Scalable Matrix Extension (SME) ZA register. */ + { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_ZA, + 0, EXTENDED_REGS, + aarch64_za_regs_copy_from_regcache, aarch64_za_regs_copy_to_regcache + }, /* PAC registers. */ { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_ARM_PAC_MASK, 0, OPTIONAL_REGS, @@ -839,6 +905,10 @@ aarch64_adjust_register_sets (const struct aarch64_features &features) if (features.tls > 0) regset->size = AARCH64_TLS_REGISTER_SIZE * features.tls; break; + case NT_ARM_ZA: + if (features.svq > 0) + regset->size = ZA_PT_SIZE (features.svq); + break; default: gdb_assert_not_reached ("Unknown register set found."); } @@ -873,6 +943,10 @@ aarch64_target::low_arch_setup () features.mte = linux_get_hwcap2 (pid, 8) & HWCAP2_MTE; features.tls = aarch64_tls_register_count (tid); + /* Scalable Matrix Extension feature and size check. */ + if (linux_get_hwcap2 (pid, 8) & HWCAP2_SME) + features.svq = aarch64_za_get_svq (tid); + current_process ()->tdesc = aarch64_linux_read_description (features); /* Adjust the register sets we should use for this particular set of diff --git a/gdbserver/linux-aarch64-tdesc.cc b/gdbserver/linux-aarch64-tdesc.cc index 3c60e1a4db0..b6b622ba4f2 100644 --- a/gdbserver/linux-aarch64-tdesc.cc +++ b/gdbserver/linux-aarch64-tdesc.cc @@ -41,6 +41,11 @@ aarch64_linux_read_description (const aarch64_features &features) error (_("VQ is %" PRIu64 ", maximum supported value is %d"), features.vq, AARCH64_MAX_SVE_VQ); + if (features.svq > AARCH64_MAX_SVE_VQ) + error (_("Streaming svq is %" PRIu8 ", maximum supported value is %d"), + features.svq, + AARCH64_MAX_SVE_VQ); + struct target_desc *tdesc = tdesc_aarch64_map[features]; if (tdesc == NULL) @@ -56,6 +61,8 @@ aarch64_linux_read_description (const aarch64_features &features) if (features.vq > 0) expedited_registers.push_back ("vg"); + if (features.svq > 0) + expedited_registers.push_back ("svg"); expedited_registers.push_back (nullptr); diff --git a/gdbserver/server.h b/gdbserver/server.h index 730ec146530..dc8e04413f1 100644 --- a/gdbserver/server.h +++ b/gdbserver/server.h @@ -104,7 +104,7 @@ extern int in_queued_stop_replies (ptid_t ptid); /* Buffer sizes for transferring memory, registers, etc. Set to a constant value to accomodate multiple register formats. This value must be at least as large as the largest register set supported by gdbserver. */ -#define PBUFSIZ 18432 +#define PBUFSIZ 131104 /* Definition for an unknown syscall, used basically in error-cases. */ #define UNKNOWN_SYSCALL (-1) -- 2.25.1