From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46871 invoked by alias); 14 Jan 2019 10:44:04 -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 46850 invoked by uid 89); 14 Jan 2019 10:44:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT autolearn=no version=3.3.2 spammy=Taylor, taylor, sk:return_, gcc_assert X-HELO: foss.arm.com Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Jan 2019 10:44:01 +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 CBD9C80D; Mon, 14 Jan 2019 02:43:59 -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 419263F5BD; Mon, 14 Jan 2019 02:43:58 -0800 (PST) Message-ID: <5C3C67EC.1010508@foss.arm.com> Date: Mon, 14 Jan 2019 10:44: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: Sam Tebbs , James Greenhalgh CC: "gcc-patches@gcc.gnu.org" , Richard Earnshaw , Marcus Shawcroft , nd , "ian@airs.com" , Jeff Law Subject: Re: [PATCH 3/3][GCC][AARCH64] Add support for pointer authentication B key References: <57416d5b-c406-230a-dd13-ab77416dd3ab@arm.com> <20190107182801.GB4896@arm.com> <8f1b174d-7f04-9446-4d86-431fb1116b9b@arm.com> In-Reply-To: <8f1b174d-7f04-9446-4d86-431fb1116b9b@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2019-01/txt/msg00765.txt.bz2 On 08/01/19 11:38, Sam Tebbs wrote: > > On 1/7/19 6:28 PM, James Greenhalgh wrote: > > On Fri, Dec 21, 2018 at 09:00:10AM -0600, Sam Tebbs wrote: > >> On 11/9/18 11:04 AM, Sam Tebbs wrote: > > > > > > > >> Attached is an improved patch with "hint" removed from the test scans, > >> pauth_hint_num_a and pauth_hint_num_b merged into pauth_hint_num and the > >> "gcc_assert (cfun->machine->frame.laid_out)" removal reverted since was > >> an unnecessary change. > >> > >> OK for trunk? > > While the AArch64 parts look OK to me and are buried behind an option so are > > relatively safe even though we're late in development, you'll need someone > > else to approve the libgcc changes. Especially as you change a generic > > routine with an undocumented (?) AArch64-specific change. > > > > Thanks, > > James > > Thanks James, CC'ing Ian Lance Taylor. > Jeff, could you help with reviewing the libgcc changes please? I believe the latest version was posted at: https://gcc.gnu.org/ml/gcc-patches/2018-12/msg01569.html Thanks, Kyrill > The documentation relevant to the libgcc change is expected to be > published in the near future. > > > > >> gcc/ > >> 2018-12-21 Sam Tebbs > >> > >> * config/aarch64/aarch64-builtins.c (aarch64_builtins): Add > >> AARCH64_PAUTH_BUILTIN_AUTIB1716 and AARCH64_PAUTH_BUILTIN_PACIB1716. > >> * config/aarch64/aarch64-builtins.c (aarch64_init_pauth_hint_builtins): > >> Add autib1716 and pacib1716 initialisation. > >> * config/aarch64/aarch64-builtins.c (aarch64_expand_builtin): Add checks > >> for autib1716 and pacib1716. > >> * config/aarch64/aarch64-protos.h (aarch64_key_type, > >> aarch64_post_cfi_startproc): Define. > >> * config/aarch64/aarch64-protos.h (aarch64_ra_sign_key): Define extern. > >> * config/aarch64/aarch64.c (aarch64_return_address_signing_enabled): Add > >> check for b-key. > >> * config/aarch64/aarch64.c (aarch64_ra_sign_key, > >> aarch64_post_cfi_startproc, aarch64_handle_pac_ret_b_key): Define. > >> * config/aarch64/aarch64.h (TARGET_ASM_POST_CFI_STARTPROC): Define. > >> * config/aarch64/aarch64.c (aarch64_pac_ret_subtypes): Add "b-key". > >> * config/aarch64/aarch64.md (unspec): Add UNSPEC_AUTIA1716, > >> UNSPEC_AUTIB1716, UNSPEC_AUTIASP, UNSPEC_AUTIBSP, UNSPEC_PACIA1716, > >> UNSPEC_PACIB1716, UNSPEC_PACIASP, UNSPEC_PACIBSP. > >> * config/aarch64/aarch64.md (do_return): Add check for b-key. > >> * config/aarch64/aarch64.md (sp): Replace > >> pauth_hint_num_a with pauth_hint_num. > >> * config/aarch64/aarch64.md (1716): Replace > >> pauth_hint_num_a with pauth_hint_num. > >> * config/aarch64/aarch64.opt (msign-return-address=): Deprecate. > >> * config/aarch64/iterators.md (PAUTH_LR_SP): Add UNSPEC_AUTIASP, > >> UNSPEC_AUTIBSP, UNSPEC_PACIASP, UNSPEC_PACIBSP. > >> * config/aarch64/iterators.md (PAUTH_17_16): Add UNSPEC_AUTIA1716, > >> UNSPEC_AUTIB1716, UNSPEC_PACIA1716, UNSPEC_PACIB1716. > >> * config/aarch64/iterators.md (pauth_mnem_prefix): Add UNSPEC_AUTIA1716, > >> UNSPEC_AUTIB1716, UNSPEC_PACIA1716, UNSPEC_PACIB1716, UNSPEC_AUTIASP, > >> UNSPEC_AUTIBSP, UNSPEC_PACIASP, UNSPEC_PACIBSP. > >> * config/aarch64/iterators.md (pauth_hint_num_a): Replace > >> UNSPEC_PACI1716 and UNSPEC_AUTI1716 with UNSPEC_PACIA1716 and > >> UNSPEC_AUTIA1716 respectively. > >> * config/aarch64/iterators.md (pauth_hint_num_a): Rename to pauth_hint_num > >> and add UNSPEC_PACIBSP, UNSPEC_AUTIBSP, UNSPEC_PACIB1716, UNSPEC_AUTIB1716. > >> > >> gcc/testsuite > >> 2018-12-21 Sam Tebbs > >> > >> * gcc.target/aarch64/return_address_sign_1.c (dg-final): Replace > >> "autiasp" and "paciasp" with "hint\t29 // autisp" and > >> "hint\t25 // pacisp" respectively. > >> * gcc.target/aarch64/return_address_sign_2.c (dg-final): Replace > >> "paciasp" with "hint\t25 // pacisp". > >> * gcc.target/aarch64/return_address_sign_3.c (dg-final): Replace > >> "paciasp" and "autiasp" with "pacisp" and "autisp" respectively. > >> * gcc.target/aarch64/return_address_sign_b_1.c: New file. > >> * gcc.target/aarch64/return_address_sign_b_2.c: New file. > >> * gcc.target/aarch64/return_address_sign_b_3.c: New file. > >> * gcc.target/aarch64/return_address_sign_b_exception.c: New file. > >> * gcc.target/aarch64/return_address_sign_builtin.c: New file > >> > >> libgcc/ > >> 2018-12-21 Sam Tebbs > >> > >> * config/aarch64/aarch64-unwind.h (aarch64_cie_signed_with_b_key): New > >> function. > >> * config/aarch64/aarch64-unwind.h (aarch64_post_extract_frame_addr, > >> aarch64_post_frob_eh_handler_addr): Add check for b-key. > >> * unwind-dw2-fde.c (get_cie_encoding): Add check for 'B' in augmentation > >> string. > >> * unwind-dw2.c (extract_cie_info): Add check for 'B' in augmentation > >> string. > >>