From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id DC7AF3858C83 for ; Wed, 11 Jan 2023 10:39:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC7AF3858C83 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=foss.arm.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=foss.arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7C917FEC; Wed, 11 Jan 2023 02:40:36 -0800 (PST) Received: from [10.57.37.91] (unknown [10.57.37.91]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AFA7E3F587; Wed, 11 Jan 2023 02:39:53 -0800 (PST) Message-ID: Date: Wed, 11 Jan 2023 10:39:52 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 10/15 V7] arm: Implement cortex-M return signing address codegen Content-Language: en-GB To: Andrea Corallo Cc: Andrea Corallo via Gcc-patches , Richard Earnshaw , nd References: <2d22c659-1452-6302-0dd0-270763510950@foss.arm.com> <9643aa03-b0d0-6c8b-c668-a1a6e5814c6e@foss.arm.com> From: Richard Earnshaw In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3489.6 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,NICE_REPLY_A,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/01/2023 09:58, Andrea Corallo via Gcc-patches wrote: > Richard Earnshaw writes: > > [...] > >> >> Otherwise ok with that change. >> >> R. > > Minor respin of this patch addressing the suggestion to have > 'use_return_insn' return zero when PAC is enabled. > > BR > > Andrea > + /* Never use a return instruction when return address signing + mechanism is enabled. */ + if (arm_current_function_pac_enabled_p ()) + return 0; + I can see what it does. It would be better to explain why it does: ie that return address authentication needs more than one instruction. OK with that change.