From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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-x32b.google.com with SMTP id 46e09a7af769-6b9e478e122so1565980a34.1 for ; Sat, 26 Aug 2023 18:16:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693099004; x=1693703804; 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=Kw0QqshS2Eae9elalaSlKJ7/R98nJ35EzAO5crDxWQk=; b=mpme/hrLKByhzko9+S9Qk+5+qW4bvcCreReEuNdXjrBCJ6toS43128QyfGbpLvfZBi OcWSpgYc1eCDhVk+ygMmQ4TZqCYHYEsMAjo8Gtg+ngCMPlTNPfeof/8TazBYm2iycWHt IiTBrYyYs6MgWjnguyxi/7jyCQ4nKQOFK3iIJJbTVlt/P8MVSMnl2vX+zfd8CWspp5C4 mXQzvkJS8bx3mJtSfRJL8wxqnOt9B5/SfHRLkllbHNpKOaq2XgsNRBPO0axS3tj8xGOm y6isGPkFj2FF+p4ZV4FN3KQogt3O74l4NfYvOq3bpsc43b6ntt51gQd+yL873lIKhVg2 7o+A== 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 From: Thiago Jung Bauermann 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 List-Id: 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