From patchwork Fri Aug 10 02:52:09 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: 28827 Received: (qmail 85970 invoked by alias); 10 Aug 2018 02:52:46 -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 85714 invoked by uid 89); 10 Aug 2018 02:52:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.4 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; Fri, 10 Aug 2018 02:52:43 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7A2n7l0113757 for ; Thu, 9 Aug 2018 22:52:41 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2krvpmte36-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 09 Aug 2018 22:52:41 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 9 Aug 2018 22:52:40 -0400 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 9 Aug 2018 22:52:37 -0400 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7A2qZxR14418316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 10 Aug 2018 02:52:35 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 08053AE05C; Thu, 9 Aug 2018 22:52:33 -0400 (EDT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CDC93AE068; Thu, 9 Aug 2018 22:52:32 -0400 (EDT) Received: from pedro.localdomain (unknown [9.85.189.55]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 9 Aug 2018 22:52:32 -0400 (EDT) Received: by pedro.localdomain (Postfix, from userid 1000) id 1CF5F3C0555; Thu, 9 Aug 2018 23:52:30 -0300 (-03) From: Pedro Franco de Carvalho To: gdb-patches@sourceware.org Cc: uweigand@de.ibm.com, edjunior@gmail.com Subject: [PATCH v2 11/12] [PowerPC] Reject tdescs with VSX and no FPU or Altivec Date: Thu, 9 Aug 2018 23:52:09 -0300 In-Reply-To: <20180810025210.6942-1-pedromfc@linux.ibm.com> References: <20180810025210.6942-1-pedromfc@linux.ibm.com> x-cbid: 18081002-0040-0000-0000-0000045C7545 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009516; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01071497; UDB=6.00551796; IPR=6.00851231; MB=3.00022623; MTD=3.00000008; XFM=3.00000015; UTC=2018-08-10 02:52:39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18081002-0041-0000-0000-000008637949 Message-Id: <20180810025210.6942-12-pedromfc@linux.ibm.com> Currently rs6000_gdbarch_init will accept a tdesc with the "org.gnu.gdb.power.vsx" feature but without the "org.gnu.gdb.power.altivec" or "org.gnu.gdb.power.fpu". It isn't clear from the standard features documentation that these are requirements. However, these tdescs would cause trouble in the VSX pseudo-register functions, so this patch will cause them to be rejected. gdb/ChangeLog: YYYY-MM-DD Pedro Franco de Carvalho * rs6000-tdep.c (rs6000_gdbarch_init): Reject tdescs with vsx but without altivec or fpu. --- gdb/rs6000-tdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index a4998c1a39..8920a18089 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -6044,7 +6044,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) valid_p &= tdesc_numbered_register (feature, tdesc_data, PPC_VSR0_UPPER_REGNUM + i, vsx_regs[i]); - if (!valid_p) + + if (!valid_p || !have_fpu || !have_altivec) { tdesc_data_cleanup (tdesc_data); return NULL;