From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id b1z0IXDIwmQL2jAAWB0awg (envelope-from ) for ; Thu, 27 Jul 2023 15:41:36 -0400 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=Xr0k4WEN; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7FB691E0C0; Thu, 27 Jul 2023 15:41:36 -0400 (EDT) Received: from server2.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 66FFE1E00F for ; Thu, 27 Jul 2023 15:41:34 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 80C0D3857437 for ; Thu, 27 Jul 2023 19:41:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 80C0D3857437 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690486893; bh=LWVnOfpW3Ja/kjXX2PR5Hv4Ryr3W0N40AbtGReYE2+8=; h=References:To:Cc:Subject:In-reply-to:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Xr0k4WENsU/Sn11sHhBJf63iGphGsZfnm4eTav67Aq0REkVIvFFK+zz1JcG/zCl2u HZFAkZClCBg+cQj0/MWCShJ0dPLf4qo4j662zd7m4aiBGsVADiStmgUO0rf6hNfMQA WeLfKm2SYfB/RYwmp71Gu8du+b10KRXpZhv/J8zw= Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 87FFB3858D37 for ; Thu, 27 Jul 2023 19:41:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 87FFB3858D37 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6b9defb366eso1103803a34.2 for ; Thu, 27 Jul 2023 12:41:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690486872; x=1691091672; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=LWVnOfpW3Ja/kjXX2PR5Hv4Ryr3W0N40AbtGReYE2+8=; b=evF/jZvF6gKICVAWtktuskWcGOI5wZmac6hyppalbaGTELeJjt710Mjz4sqaWnI1Fz BNaQ+Mlv/iHc9pkktnI3Tbr5gZQMSoCzBjDHI4GfPaLXYWTpyCmF5xVmSmAYZpuxxo8n JW7ZxMiuE82yw3YlqfDfUnCD9Y6OoEjLgamPtVShhIDChnaIMjS8OIXvC61jBo4+YKIs YiAuZeuMO50eW78S1v085qjBcvIFeO2UZJgkJWv1u4Ov/bkH37eGuhBj8DB4U2I6nOfM OqsKbLzHT+BxDHe1ZbWxSWiwMJPjLJnChasLNPWy8PbDaj6ZbNGz/IpcN+UUmLXatCh5 I4kA== X-Gm-Message-State: ABy/qLbtm9Ifl08OqxQm3IOJeT4R8GwaBwoFQLqkID/NEtcrc2oQsGea GJj4jYYMC/2gGdk+HYRRFpyuegyAZbKl9wYSPZo= X-Google-Smtp-Source: APBJJlFNBEtulnzZkfPilOsc1VHQloPSk8wJpqBKfwY52E3xpg0mVoHEqyKMlTjQwPaH2WQ7IV4cRQ== X-Received: by 2002:a9d:7389:0:b0:6b9:cb32:f375 with SMTP id j9-20020a9d7389000000b006b9cb32f375mr124065otk.32.1690486872569; Thu, 27 Jul 2023 12:41:12 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:b6b2:cb77:8e91:bbbd]) by smtp.gmail.com with ESMTPSA id z10-20020a9d65ca000000b006b93d1e8e7esm920109oth.69.2023.07.27.12.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 12:41:12 -0700 (PDT) References: <20230630134616.1238105-1-luis.machado@arm.com> <20230630134616.1238105-8-luis.machado@arm.com> User-agent: mu4e 1.10.5; emacs 28.2 To: Luis Machado Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v3 07/16] [gdbserver/aarch64] sme: Add support for SME In-reply-to: <20230630134616.1238105-8-luis.machado@arm.com> Date: Thu, 27 Jul 2023 16:41:09 -0300 Message-ID: <87edkt87my.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: 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: Thiago Jung Bauermann via Gdb-patches Reply-To: Thiago Jung Bauermann Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hello, No real comment on this one, looks good to me. Luis Machado via Gdb-patches writes: > 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. Unfortunately this was paused due to other Linaro work, but I'm resuming it now. > 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 7c633c212f3..95688480c3d 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. */ It's a bit of a pity that that the result of that ptrace call goes unused. If ZA's regset_info.size was set to sizeof (struct user_za_header) then it could be used to fetch the header that aarch64_fetch_za_regset () needs. But I imagine that there's no need for performance in this code path so it's just a theoretical concern. Also, SVE already works this way. -- Thiago