Message ID | 20230427210113.45380-17-jhb@FreeBSD.org |
---|---|
State | New |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 70B8038555A9 for <patchwork@sourceware.org>; Thu, 27 Apr 2023 21:03:33 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2607:f138:0:13::2]) by sourceware.org (Postfix) with ESMTPS id 0AE74385770C for <gdb-patches@sourceware.org>; Thu, 27 Apr 2023 21:01:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0AE74385770C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=FreeBSD.org Received: from ralph.baldwin.net (c-98-35-126-114.hsd1.ca.comcast.net [98.35.126.114]) by mail.baldwin.cx (Postfix) with ESMTPSA id 682FD1A84C70 for <gdb-patches@sourceware.org>; Thu, 27 Apr 2023 17:01:38 -0400 (EDT) From: John Baldwin <jhb@FreeBSD.org> To: gdb-patches@sourceware.org Subject: [PATCH v5 16/19] gdbserver: Clear upper ZMM registers in the right location. Date: Thu, 27 Apr 2023 14:01:10 -0700 Message-Id: <20230427210113.45380-17-jhb@FreeBSD.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230427210113.45380-1-jhb@FreeBSD.org> References: <20230427210113.45380-1-jhb@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (mail.baldwin.cx [0.0.0.0]); Thu, 27 Apr 2023 17:01:38 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.103.1 at mail.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_STATUS, KHOP_HELO_FCRDNS, SPF_HELO_PASS, SPF_SOFTFAIL, 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Handle variable XSAVE layouts
|
|
Commit Message
John Baldwin
April 27, 2023, 9:01 p.m. UTC
This was previously clearing the upper 32 bytes of ZMM0-15 rather than ZMM16-31. --- gdbserver/i387-fp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 4/27/23 17:01, John Baldwin wrote: > This was previously clearing the upper 32 bytes of ZMM0-15 rather than > ZMM16-31. > --- > gdbserver/i387-fp.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdbserver/i387-fp.cc b/gdbserver/i387-fp.cc > index e63eef60330..a122e2d860b 100644 > --- a/gdbserver/i387-fp.cc > +++ b/gdbserver/i387-fp.cc > @@ -306,7 +306,7 @@ i387_cache_to_xsave (struct regcache *regcache, void *buf) > if ((clear_bv & X86_XSTATE_ZMM)) > { > for (i = 0; i < num_avx512_zmmh_high_registers; i++) > - memset (((char *) &fp->zmmh_low_space[0]) + 32 + i * 64, 0, 32); > + memset (((char *) &fp->zmmh_high_space[0]) + 32 + i * 64, 0, 32); From what I understand, this is correct, so: Approved-By: Simon Marchi <simon.marchi@efficios.com> Unrelated to your patch, but I believe that zmmh_high_space should be called zmm_high_space, since it doesn't contain only upper values like zmmh_low_space does, it contains the full values for ZMM 16 through 31. Simon
On 5/3/23 10:49 AM, Simon Marchi wrote: > On 4/27/23 17:01, John Baldwin wrote: >> This was previously clearing the upper 32 bytes of ZMM0-15 rather than >> ZMM16-31. >> --- >> gdbserver/i387-fp.cc | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/gdbserver/i387-fp.cc b/gdbserver/i387-fp.cc >> index e63eef60330..a122e2d860b 100644 >> --- a/gdbserver/i387-fp.cc >> +++ b/gdbserver/i387-fp.cc >> @@ -306,7 +306,7 @@ i387_cache_to_xsave (struct regcache *regcache, void *buf) >> if ((clear_bv & X86_XSTATE_ZMM)) >> { >> for (i = 0; i < num_avx512_zmmh_high_registers; i++) >> - memset (((char *) &fp->zmmh_low_space[0]) + 32 + i * 64, 0, 32); >> + memset (((char *) &fp->zmmh_high_space[0]) + 32 + i * 64, 0, 32); > > From what I understand, this is correct, so: > > Approved-By: Simon Marchi <simon.marchi@efficios.com> > > Unrelated to your patch, but I believe that zmmh_high_space should be > called zmm_high_space, since it doesn't contain only upper values like > zmmh_low_space does, it contains the full values for ZMM 16 through 31. Yeah, I think I do rename it to zmm_space () in patch 17.
diff --git a/gdbserver/i387-fp.cc b/gdbserver/i387-fp.cc index e63eef60330..a122e2d860b 100644 --- a/gdbserver/i387-fp.cc +++ b/gdbserver/i387-fp.cc @@ -306,7 +306,7 @@ i387_cache_to_xsave (struct regcache *regcache, void *buf) if ((clear_bv & X86_XSTATE_ZMM)) { for (i = 0; i < num_avx512_zmmh_high_registers; i++) - memset (((char *) &fp->zmmh_low_space[0]) + 32 + i * 64, 0, 32); + memset (((char *) &fp->zmmh_high_space[0]) + 32 + i * 64, 0, 32); for (i = 0; i < num_avx512_xmm_registers; i++) memset (((char *) &fp->zmmh_high_space[0]) + i * 64, 0, 16); for (i = 0; i < num_avx512_ymmh_registers; i++)