From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id llq+Ij2k6mTCwgsAWB0awg (envelope-from ) for ; Sat, 26 Aug 2023 21:17:49 -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=cQtLt4Ec; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8088D1E0C2; Sat, 26 Aug 2023 21:17:49 -0400 (EDT) Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 703051E028 for ; Sat, 26 Aug 2023 21:17:47 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4BD523858D39 for ; Sun, 27 Aug 2023 01:17:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4BD523858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693099066; bh=Kw0QqshS2Eae9elalaSlKJ7/R98nJ35EzAO5crDxWQk=; 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=cQtLt4Ec5NH9z2L+oHBVofIZZPV25RjxdxnmtFiJ0gcMqxxH8gLLurMOkJPE8vDMk PPOX+c7rLe1QHt+wx7KDo/OVWDhVE/kK+yRTDXBo0bFyvoPTY4v7rDZ35kgwituvfK hnHcG0pDUzqoev7IGm0IQwa/tkmDo8Zg03WMcQ4M= Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id 37EA23858D39 for ; Sun, 27 Aug 2023 01:16:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 37EA23858D39 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6b9e478e122so1565980a34.1 for ; Sat, 26 Aug 2023 18:16:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693099004; x=1693703804; 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=Kw0QqshS2Eae9elalaSlKJ7/R98nJ35EzAO5crDxWQk=; b=dfN8APCmsg+Kan+NsKJLg/MDx/VG/Dq+jnmOuzuGKTs2V9Zc4BxOoEPlCy9XQ3XvfL MfiWpEFvghqz3cM4CSIuashRjQI8W69UqrSlMLH7vwpQCR+om3YU+duv5T5rqmXC3tWo cJvaPWcj60BzpeXv9lU0qiNql/oXuNfCgUtRfHzyfQMjC/kyYOrOMlqmCJA/Q7KY9pkb p2zTKPYdCxbU3UKmcQns+jwsdzmnEmBKQMnsuG1dCrNzL4TkRKSp5eMCMWWTO82SjPLA 0tqMRKM6XHGJmI1c6X2IfqpVP3OPJovAWBAO2XyEqLMHv9UwudCyTcduuw8CWx5y9IfE mZUA== X-Gm-Message-State: AOJu0YyyU67k6dnDCY0hT+zaMxaJPXpDNtHmjnGH193IQrNiVa1kNmVO sx+cNrTjPnHxNqn6J/q6kXWPqQ== X-Google-Smtp-Source: AGHT+IExMzT6FmqMXHqDqxvHyfj2fI/2VCcDM7Pgu5nuKkSyeGsUHWtxyswDYgPNTFtwhO8T3EiWyQ== X-Received: by 2002:a05:6830:1d83:b0:6bd:152f:9913 with SMTP id y3-20020a0568301d8300b006bd152f9913mr10493289oti.29.1693099004350; Sat, 26 Aug 2023 18:16:44 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:32e5:4bbf:ada3:7bf7]) by smtp.gmail.com with ESMTPSA id h8-20020a9d6408000000b006b96a4287d4sm2202907otl.5.2023.08.26.18.16.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Aug 2023 18:16:43 -0700 (PDT) References: <20230822112144.1513268-1-luis.machado@arm.com> <20230822112144.1513268-2-luis.machado@arm.com> User-agent: mu4e 1.10.5; emacs 28.2 To: Luis Machado Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 1/6] [gdb/aarch64] sme2: Enable SME2 for AArch64 gdb on Linux In-reply-to: <20230822112144.1513268-2-luis.machado@arm.com> Date: Sat, 26 Aug 2023 22:16:41 -0300 Message-ID: <87o7itl1xi.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 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 Luis, I have only one minor nit about this patch. In any case: Reviewed-by: Thiago Jung Bauermann Luis Machado writes: > diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c > index d7fcef5a0db..edbe6895c86 100644 > --- a/gdb/aarch64-linux-nat.c > +++ b/gdb/aarch64-linux-nat.c > @@ -376,6 +376,37 @@ store_za_to_thread (struct regcache *regcache) > tdep->sme_svcr_regnum); > } > > +/* Fill GDB's REGCACHE with the ZT register set contents from the > + current thread. If there is no active ZA register state, make the > + ZT register contents zero. */ Same comment about "current thread" from the SME patch series: the function uses the regcache's ptid to identify the thread, so it's not from the current thread that it gets the register values. > +static void > +fetch_zt_from_thread (struct regcache *regcache) > +{ > + aarch64_gdbarch_tdep *tdep > + = gdbarch_tdep (regcache->arch ()); > + > + /* Read ZT state from the thread to the register cache. */ > + aarch64_zt_regs_copy_to_reg_buf (regcache->ptid ().lwp (), > + regcache, > + tdep->sme2_zt0_regnum); > +} > + > +/* Store the NT_ARM_ZT register set contents from GDB's REGCACHE to the current > + thread. */ Also here. > + > +static void > +store_zt_to_thread (struct regcache *regcache) > +{ > + aarch64_gdbarch_tdep *tdep > + = gdbarch_tdep (regcache->arch ()); > + > + /* Write ZT state from the register cache to the thread. */ > + aarch64_zt_regs_copy_from_reg_buf (regcache->ptid ().lwp (), > + regcache, > + tdep->sme2_zt0_regnum); > +} -- Thiago