From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93201 invoked by alias); 29 Jun 2017 08:44:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 93107 invoked by uid 89); 29 Jun 2017 08:44:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Hx-languages-length:1486 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 Jun 2017 08:44:44 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 67AAA344; Thu, 29 Jun 2017 01:44:42 -0700 (PDT) Received: from [10.2.206.52] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A2E6C3F41F; Thu, 29 Jun 2017 01:44:41 -0700 (PDT) Subject: Re: [PATCH, GCC/ARM] Remove ARMv8-M code for D17-D31 To: "Richard Earnshaw (lists)" , Kyrill Tkachov , Ramana Radhakrishnan , "gcc-patches@gcc.gnu.org" References: From: Thomas Preudhomme Message-ID: Date: Thu, 29 Jun 2017 08:44:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg02231.txt.bz2 Hi Richard, On 28/06/17 16:56, Richard Earnshaw (lists) wrote: > On 20/06/17 16:01, Thomas Preudhomme wrote: >> Hi, >> >> Function cmse_nonsecure_entry_clear_before_return has code to deal with >> high VFP register (D16-D31) while ARMv8-M Baseline and Mainline both do >> not support more than 16 double VFP registers (D0-D15). This makes this >> security-sensitive code harder to read for not much benefit since >> libcall for cmse_nonsecure_call functions do not deal with those high >> VFP registers anyway. >> >> This commit gets rid of this code for simplicity and fixes 2 issues in >> the same function: >> >> - stop the first loop when reaching maxregno to avoid dealing with VFP >> registers if targetting Thumb-1 or using -mfloat-abi=soft >> - include maxregno in that loop >> > > This is silently baking in dangerous assumptions about GCC's internal > numbering of the registers. That's not a good idea from a long-term > portability perspective. > > At the very least you need to assert that all the interesting registers > are numbered in the range 0..63; but ideally the code should just handle > pretty much any assignment of internal register numbers. Well there is already this: gcc_assert ((unsigned) maxregno <= sizeof (to_clear_mask) * __CHAR_BIT__); > > Did you consider using sbitmaps rather than doing all the multi-word > stuff by steam? No but am happy to. I'll respin the patch. Best regards, Thomas