From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6b9defb366eso1103803a34.2 for ; Thu, 27 Jul 2023 12:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690486872; x=1691091672; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=LWVnOfpW3Ja/kjXX2PR5Hv4Ryr3W0N40AbtGReYE2+8=; b=bp/SavSV1pAscxXkpwnKIAGxUkQI4hKh8/lzH+J+s8/p/Dg/0uN31dqCxbWhc68eKq 07TGf9hF24LPnwkMDOTKXm1bDg7sicjXk6JX3DKNrlF4iIL/DJrzNYqPyYCYRPW2eqR4 idp2H2sKHZJUR+pOdZNDKhbCfP0I6weQil7xDUjmlFPglYOdoHOBQOoPRg3nYZXTNJ9A +OxWlMvPu5+wuAtrmlFMAATIohvJKGQA2RXvlw/rARUMNg2HKCtGgiR1L3UbTwEfeP2Q gJIPVtZpo7domfDE3IocHVBgagcDEwVoR+db+uVO3JMYbzV/eFJZuGE8WcxIMBmeLevf hGIA== 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 From: Thiago Jung Bauermann 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 List-Id: 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