From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91090 invoked by alias); 9 Nov 2016 10:27:00 -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 91073 invoked by uid 89); 9 Nov 2016 10:26:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=diagnose, UD:arm.com 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; Wed, 09 Nov 2016 10:26:49 +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 4D0F1CF6; Wed, 9 Nov 2016 02:26:47 -0800 (PST) Received: from [10.2.207.77] (e100706-lin.cambridge.arm.com [10.2.207.77]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CDA103F24D; Wed, 9 Nov 2016 02:26:46 -0800 (PST) Message-ID: <5822F9E5.8040400@foss.arm.com> Date: Wed, 09 Nov 2016 10:27:00 -0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: "Andre Vieira (lists)" , gcc-patches@gcc.gnu.org Subject: Re: [PATCH 7/7, GCC, ARM, V8M] Added support for ARMV8-M Security Extension cmse_nonsecure_caller intrinsic References: <5796116C.6010100@arm.com> <57961419.8040904@arm.com> <57BD7EA4.4010500@arm.com> <580F889A.1030802@arm.com> In-Reply-To: <580F889A.1030802@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2016-11/txt/msg00813.txt.bz2 Hi Andre, On 25/10/16 17:30, Andre Vieira (lists) wrote: > On 24/08/16 12:01, Andre Vieira (lists) wrote: >> On 25/07/16 14:28, Andre Vieira (lists) wrote: >>> This patch adds support ARMv8-M's Security Extension's >>> cmse_nonsecure_caller intrinsic. This intrinsic is used to check whether >>> an entry function was called from a non-secure state. >>> See Section 5.4.3 of ARM®v8-M Security Extensions: Requirements on >>> Development Tools >>> (http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/index.html) >>> for further details. >>> >>> The FIXME in config/arm/arm_cmse.h is for a diagnostic message that is >>> suggested in the ARMv8-M Security Extensions document mentioned above, >>> to diagnose the use of the cmse_nonsecure_caller intrinsic outside of >>> functions with the 'cmse_nonsecure_entry' attribute. Checking whether >>> the intrinsic is called from within such functions can easily be done >>> inside 'arm_expand_builtin'. However, making the warning point to the >>> right location is more complicated. The ARMv8-M Security Extensions >>> specification does mention that such a diagnostic might become >>> mandatory, so I might have to pick this up later, otherwise it is left >>> as a potential extra feature. >>> >>> >>> *** gcc/ChangeLog *** >>> 2016-07-25 Andre Vieira >>> Thomas Preud'homme >>> >>> * config/arm/arm-builtins.c (arm_builtins): Define >>> ARM_BUILTIN_CMSE_NONSECURE_CALLER. >>> (bdesc_2arg): Add line for cmse_nonsecure_caller. >>> (arm_expand_builtin): Handle cmse_nonsecure_caller. >>> * config/arm/arm_cmse.h (cmse_nonsecure_caller): New. >>> >>> *** gcc/testsuite/ChangeLog *** >>> 2016-07-25 Andre Vieira >>> Thomas Preud'homme >>> >>> * gcc.target/arm/cmse/cmse-1.c: Add test for >>> cmse_nonsecure_caller. >>> >> Added more documentation as requested. >> >> --- >> >> This patch adds support ARMv8-M's Security Extension's >> cmse_nonsecure_caller intrinsic. This intrinsic is used to check whether >> an entry function was called from a non-secure state. >> See Section 5.4.3 of ARM®v8-M Security Extensions: Requirements on >> Development Tools >> (http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/index.html) >> for further details. >> >> The FIXME in config/arm/arm_cmse.h is for a diagnostic message that is >> suggested in the ARMv8-M Security Extensions document mentioned above, >> to diagnose the use of the cmse_nonsecure_caller intrinsic outside of >> functions with the 'cmse_nonsecure_entry' attribute. Checking whether >> the intrinsic is called from within such functions can easily be done >> inside 'arm_expand_builtin'. However, making the warning point to the >> right location is more complicated. The ARMv8-M Security Extensions >> specification does mention that such a diagnostic might become >> mandatory, so I might have to pick this up later, otherwise it is left >> as a potential extra feature. >> >> >> *** gcc/ChangeLog *** >> 2016-07-xx Andre Vieira >> Thomas Preud'homme >> >> * config/arm/arm-builtins.c (arm_builtins): Define >> ARM_BUILTIN_CMSE_NONSECURE_CALLER. >> (bdesc_2arg): Add line for cmse_nonsecure_caller. >> (arm_expand_builtin): Handle cmse_nonsecure_caller. >> * config/arm/arm_cmse.h (cmse_nonsecure_caller): New. >> * doc/extend.texi (ARM ARMv8-M Security Extensions): New intrinsic. >> >> *** gcc/testsuite/ChangeLog *** >> 2016-07-xx Andre Vieira >> Thomas Preud'homme >> >> * gcc.target/arm/cmse/cmse-1.c: Add test for >> cmse_nonsecure_caller. >> > Hi, > > Rebased previous patch on top of trunk as requested. No changes to > ChangeLog. > > Cheers, > Andre @@ -1832,6 +1834,17 @@ arm_init_builtins (void) = add_builtin_function ("__builtin_arm_stfscr", ftype_set_fpscr, ARM_BUILTIN_SET_FPSCR, BUILT_IN_MD, NULL, NULL_TREE); } + + if (arm_arch_cmse) + { + tree ftype_cmse_nonsecure_caller + = build_function_ty Should this be use_cmse ? This looks ok to me otherwise. I believe patch [6/7] is the only one needing approval after this... Kyrill