From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id eLQNG+5OZ2QCmQ4AWB0awg (envelope-from ) for ; Fri, 19 May 2023 06:26:54 -0400 Received: by simark.ca (Postfix, from userid 112) id 697DB1E11E; Fri, 19 May 2023 06:26:54 -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=PceThj+e; 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=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 7BC4B1E111 for ; Fri, 19 May 2023 06:26:53 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F0CC33844008 for ; Fri, 19 May 2023 10:26:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0CC33844008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684492013; 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=PceThj+e3fenZuDHrhkKH/YmWtZT13kk3vpZh1/8S+i7a8tqcx8xuxUB0Zg3FtrUT npZC/qa217D9LIIqDLIJOfP5kILcwlsH803JkMUOK5v0LzAxdoFefJOR0Jb7PRRWRo m5GmhDsA67bOwtzSLx7ZuqeXqI4/SeUcukgV+ULE= Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2078.outbound.protection.outlook.com [40.107.20.78]) by sourceware.org (Postfix) with ESMTPS id 8B18D3858C27 for ; Fri, 19 May 2023 10:25:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8B18D3858C27 Received: from AM7PR03CA0023.eurprd03.prod.outlook.com (2603:10a6:20b:130::33) by DBBPR08MB5995.eurprd08.prod.outlook.com (2603:10a6:10:20b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Fri, 19 May 2023 10:25:24 +0000 Received: from AM7EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:130:cafe::43) by AM7PR03CA0023.outlook.office365.com (2603:10a6:20b:130::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 10:25:24 +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 AM7EUR03FT058.mail.protection.outlook.com (100.127.140.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19 via Frontend Transport; Fri, 19 May 2023 10:25:24 +0000 Received: ("Tessian outbound 945aec65ec65:v136"); Fri, 19 May 2023 10:25:23 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e4a7755dfc3b5a54 X-CR-MTA-TID: 64aa7808 Received: from df1ab71b1be3.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 20FB4D32-6003-4D47-B431-F500F8EDDCFB.1; Fri, 19 May 2023 10:25:18 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id df1ab71b1be3.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 19 May 2023 10:25:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SWgTFJqeVVbJ2ryRKTgmvxr4nlGsGRIajFL77lXF6lfCtc0Z4UOnX5Kg+yKfjHVL//KuXi0UB87wkBjptzsHIpE1Jn7Q6FqGsKGSDGo+frTJ8L5iBAuSaE20y0fKxe6I3cfIQEXxT5C6+/b8qw99+XaolEz+52rSJv5jYL4qfPolROKz8xjGD0lLYiBCWezUgTdFsgmFbEgBxx7hUJ4hnlnkZJ9TBfoJkBCWx92Xr2GX5NtYYBk1YPvr/JK16PM0ByFwZ2qce55gjSU9M9kzw6azLg/fKANJRZJVSOEV3R6SvKYD7SMeYF/AR01OBLnw1YA261m/+cKz8HfN6TOZgg== 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=SYGUcgratSEn4d7ZLBIlZ/O/rdrtkJmOHEhA9vZTqqAmh4hVSRyAIxHCbuF2twrpVHOg/4VaZDGoxNctXi8hR+tszA5SA47wBvxOpxueTo+OR6bcyNfUFDGK60NiAZZVi9+9/VC2TFDXIql251QdgzNTgax8YIujkIo2MJ6hfOzbk+gqHNZdO4baXqCThtM8ZYqDRHuFGdj2WczYXalTNl8uxjpr6XShtQMMtlkV+kOJJHureK+kqQxiumghXhMqb9JdU4RxNvTXq1efJOiqNSaog3kUUhrBUZm4C7P9QRMcHQuWABAbYD4Lub7L2t6x54Ogaim6HWoifCsizW5S0Q== 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 AS9PR05CA0182.eurprd05.prod.outlook.com (2603:10a6:20b:495::17) by PAXPR08MB7525.eurprd08.prod.outlook.com (2603:10a6:102:24b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Fri, 19 May 2023 10:25:13 +0000 Received: from AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:495:cafe::16) by AS9PR05CA0182.outlook.office365.com (2603:10a6:20b:495::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 10:25:13 +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 AM7EUR03FT009.mail.protection.outlook.com (100.127.140.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6433.7 via Frontend Transport; Fri, 19 May 2023 10:25:13 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.23; Fri, 19 May 2023 10:25:12 +0000 Received: from e129171.cambridge.arm.com (10.1.37.65) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 19 May 2023 10:25:12 +0000 To: Subject: [PATCH v2 07/17] [gdbserver/aarch64] sme: Add support for SME Date: Fri, 19 May 2023 11:24:58 +0100 Message-ID: <20230519102508.14020-8-luis.machado@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230519102508.14020-1-luis.machado@arm.com> References: <20230519102508.14020-1-luis.machado@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT009:EE_|PAXPR08MB7525:EE_|AM7EUR03FT058:EE_|DBBPR08MB5995:EE_ X-MS-Office365-Filtering-Correlation-Id: 6bc3576b-8e23-4dfa-be35-08db58535b53 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: LiXJILC6JPwfSPKAnmFU5lA/7V75tYDQtlFAaeYOkxA4wN/42ysGxhFmxKy86a7O+ql/QMrlPo+GT0K/iSArG4vEoRllpOOoMhQPbNqYgDks7PEWga/vJ2xkfdh5owL0KABM1UNN7++IotfXi4R4CwOIKPh8tIT/chqw5HsY4LZ3W+5jHduODH586/AG2Xoc8LHAtzjDxs2dCsHcVZpFMBfNyW4NITsFDgTbL1Uylx2IeplQF+WSQVLwKdlbsMVQMYNOIUfCcTFHgzrKhzJBImqhURvAJup7yt3I5NYH8PhMaacbfWkfgzHBo4x6vFDQZABPKgrLLetnI/9nZKv6dmN9idcFLwCPTrG0SyK9GLkiZ6knAMI+6egojKQtL3dsn5mnc+sHW6EuKuWfzzG4cZ5pcdO5V/xnrW+sAWEmbzxa+5bhlQef9kfUEiqO6h5juGRZGuPXlO5bYwTCkoAmGaHDzKNihUPPBRUr9KQlQfnj9+urOp8pxd9PGQ+bb7xKUeQSwDKZQbsDWu2KYgjvcjqYnweqYC4DOBIEfZWaCmbHhCialjlSBQOHuTm0g0hrnq6HUnrNgZ1y/36pBdsvM1TuBFE0A6fgcAQanQopzyv9Dge0OLoab2ax4i1z1vmJDyUsg/e0tE37XTFuhl7L0rLzyG7cT+mwbfkfJh/BhR0PVGBtDOlyedtb68vTCgXh0qiBW7NdP43qlnRBXP5qCuoyhHk2KeY0hPRwwXVfx0R2/Bnixx38L+e08+ciOlsm84etK4t10hs0FVirafQ31A== 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)(39860400002)(136003)(346002)(376002)(396003)(451199021)(40470700004)(36840700001)(46966006)(26005)(40460700003)(1076003)(7696005)(36860700001)(83380400001)(47076005)(2616005)(40480700001)(336012)(36756003)(426003)(86362001)(82310400005)(186003)(82740400003)(356005)(81166007)(44832011)(478600001)(2906002)(316002)(8936002)(6916009)(8676002)(41300700001)(5660300002)(70586007)(70206006)(66899021)(6666004)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7525 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e1c229ba-7fc5-429c-6042-08db585354c7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LPBBltq2K3VIeEr1Yh8c+LiJsa/xkOS3jx7VOKVpKNItPmowz26kqtWjm6pr9untatSNxA4bJUdd17IDp0Re2TRWnpTYdFdtIu9/28j9ddy0EvSmNKVA+s4PG4Uwe3LeE3iFneRliQD/0X420ZtwxMNBX4TEC8r1t3uYMbS8DfDrEfgcZWWpT/Z92MYGmh3miH5h2rB7tu36AzsNkNyXFsfzD3fHtNdCNUd2E3cKuX4gnOEaOZkgUpcm9AliUZc8ewh3F3UNKVupb5S6l9vxv5YkxYNiCcDM79AYI9Z+ajO83BojYJ1KO4IjsqO+IyX1OhYQUgeAoBFYaFmoOhnwZHsK1JJ6sgU59zThgqRRbXEbYJkJNJZG+gliu4T8+uQVAp+XxbQt5n4LhffgijIPIWokrpKnzVDzEs8EspxglRjGHcpWtQWNfgNEkZ10ph+somvXmKWFHhnNj4LJVzTKt0S/X03jY4xfsUpVJ0MfUHcBrJBFl/4fgzeq4c7XC3tvwIIl9CjNe2I327AmbSKpwwI1pni7GTwCIxd+D+SCpiyhOteJIxY7B0CVTVS9a7WWfplirRcrhu9sLvDlR/SvrHSpk0gu+NtQJQPwKMil06aZVAz/8SVBNumbYJ/kAWrSrZNxcwqbqywWylocuPucYrSxbWW4MbaQgrxQEBhr85yWaZC/V+QZNkMPPN//CANO4PLNYStcszBtIK1/kL1QoC1PGD9sc7JWj8h+IVETviMj9ZrIhK/77xSI7dipi1dL 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)(376002)(39860400002)(136003)(396003)(451199021)(46966006)(36840700001)(40470700004)(70206006)(70586007)(478600001)(316002)(7696005)(6666004)(66899021)(36756003)(41300700001)(83380400001)(5660300002)(6916009)(40460700003)(1076003)(26005)(186003)(8676002)(8936002)(40480700001)(44832011)(2616005)(426003)(36860700001)(47076005)(336012)(2906002)(82740400003)(86362001)(81166007)(82310400005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 10:25:24.0020 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6bc3576b-8e23-4dfa-be35-08db58535b53 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: AM7EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5995 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