From patchwork Tue Aug 14 20:05:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Franco de Carvalho X-Patchwork-Id: 28908 Received: (qmail 129910 invoked by alias); 14 Aug 2018 20:41:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 129884 invoked by uid 89); 14 Aug 2018 20:41:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Aug 2018 20:41:03 +0000 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7EK4GUE127738 for ; Tue, 14 Aug 2018 16:07:08 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kv1fq3mqa-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 14 Aug 2018 16:07:07 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 14 Aug 2018 16:07:06 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 14 Aug 2018 16:07:04 -0400 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7EK72bj62783602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 14 Aug 2018 20:07:02 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 90A5D11206E; Tue, 14 Aug 2018 16:06:41 -0400 (EDT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6432C112062; Tue, 14 Aug 2018 16:06:41 -0400 (EDT) Received: from pedro.localdomain (unknown [9.18.235.221]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 14 Aug 2018 16:06:41 -0400 (EDT) Received: by pedro.localdomain (Postfix, from userid 1000) id B66603C0528; Tue, 14 Aug 2018 17:06:54 -0300 (-03) From: Pedro Franco de Carvalho To: gdb-patches@sourceware.org Cc: uweigand@de.ibm.com, edjunior@gmail.com Subject: [PATCH v3 02/12] [PowerPC] Don't zero-initialize vector register buffers Date: Tue, 14 Aug 2018 17:05:59 -0300 In-Reply-To: <20180814200609.19999-1-pedromfc@linux.ibm.com> References: <20180814200609.19999-1-pedromfc@linux.ibm.com> x-cbid: 18081420-0052-0000-0000-0000031F0435 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009544; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01073530; UDB=6.00553150; IPR=6.00853488; MB=3.00022718; MTD=3.00000008; XFM=3.00000015; UTC=2018-08-14 20:07:05 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18081420-0053-0000-0000-00005DB9E46C Message-Id: <20180814200609.19999-3-pedromfc@linux.ibm.com> Now that linux-tdep.c already zero-initializes the buffer used for generating core file notes, there is no need to do this in the linux collect functions for the vector regset. The memsets in gdbserver were not useful to begin with. gdb/ChangeLog: YYYY-MM-DD Pedro Franco de Carvalho * ppc-linux-tdep.c (ppc_linux_collect_vrregset): Remove. (ppc32_le_linux_vrregset, ppc32_be_linux_vrregset): Replace ppc_linux_collect_vrregset by regcache_collect_regset. gdb/gdbserver/ChangeLog: 2018-07-31 Pedro Franco de Carvalho * linux-ppc-low.c (ppc_fill_vrregset): Remove memset calls. --- gdb/gdbserver/linux-ppc-low.c | 4 ---- gdb/ppc-linux-tdep.c | 22 ++-------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c index 47428c1529..d1ab69fac9 100644 --- a/gdb/gdbserver/linux-ppc-low.c +++ b/gdb/gdbserver/linux-ppc-low.c @@ -495,13 +495,9 @@ ppc_fill_vrregset (struct regcache *regcache, void *buf) if (__BYTE_ORDER == __BIG_ENDIAN) vscr_offset = 12; - /* Zero-pad the unused bytes in the fields for vscr and vrsave in - case they get displayed somewhere. */ - memset (®set[32 * 16], 0, 16); collect_register_by_name (regcache, "vscr", ®set[32 * 16 + vscr_offset]); - memset (®set[33 * 16], 0, 16); collect_register_by_name (regcache, "vrsave", ®set[33 * 16]); } diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index 33a0b5a83b..b9bd775695 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -444,24 +444,6 @@ ppc_linux_collect_gregset (const struct regset *regset, } } -static void -ppc_linux_collect_vrregset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *buf, size_t len) -{ - gdb_byte *vrregs = (gdb_byte *) buf; - - /* Zero-pad the unused bytes in the fields for vscr and vrsave - in case they get displayed somewhere (e.g. in core files). */ - if (regnum == PPC_VSCR_REGNUM || regnum == -1) - memset (&vrregs[32 * 16], 0, 16); - - if (regnum == PPC_VRSAVE_REGNUM || regnum == -1) - memset (&vrregs[33 * 16], 0, 16); - - regcache_collect_regset (regset, regcache, regnum, buf, len); -} - /* Regset descriptions. */ static const struct ppc_reg_offsets ppc32_linux_reg_offsets = { @@ -544,13 +526,13 @@ static const struct regcache_map_entry ppc32_be_linux_vrregmap[] = static const struct regset ppc32_le_linux_vrregset = { ppc32_le_linux_vrregmap, regcache_supply_regset, - ppc_linux_collect_vrregset + regcache_collect_regset }; static const struct regset ppc32_be_linux_vrregset = { ppc32_be_linux_vrregmap, regcache_supply_regset, - ppc_linux_collect_vrregset + regcache_collect_regset }; static const struct regcache_map_entry ppc32_linux_vsxregmap[] =