From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 017D1C61D9D for ; Wed, 25 Jan 2023 16:39:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aAP398U16knx55zsjP3tL6vsnEtJ7vpCIt7V5UsqcNk=; b=kf2ZB+24XxlfBX dlPVmaT3OzjiNh5HAx7X6+5IVgCZVKuZhnC2AfHK/SOy1ZkHUXryUFfzPFM64iDcSEnv9UFlFxsgY MAOzybzbuLNBwLDsvmIrt5RapDRIyrY4spmhKlBM/3IvMl8Uf0Rus57oRzIaaT6AC6M0P24MYJtcd kppfqrsc34CQpz4jcxACdgJnw3ZMZx8QE14RnFlq9iG0BT1X6JtRkfsi4iEFWFyqAHcXKa+eEcJ5w 5bsiX9Xc0YEICWE0bRocJJb6diVY1iK7yyiHWb83SfB2H1YECOrIWM7/Nvx0iozjcpQod99s/kPGZ cTcPMiImGe0je19RTnzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKin0-007yDt-2d; Wed, 25 Jan 2023 16:38:22 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKims-007yBu-Ln for linux-arm-kernel@lists.infradead.org; Wed, 25 Jan 2023 16:38:16 +0000 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 34F7AC14; Wed, 25 Jan 2023 08:38:53 -0800 (PST) Received: from capper-ampere.manchester.arm.com (capper-ampere.manchester.arm.com [10.32.100.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 77CC73F5A1; Wed, 25 Jan 2023 08:38:10 -0800 (PST) From: Jamie Cunliffe To: linux-arm-kernel@lists.infradead.org, rust-for-linux@vger.kernel.org Cc: Miguel Ojeda , Catalin Marinas , Will Deacon , steve.capper@arm.com Subject: [PATCH 2/3] arm64: rust: Enable PAC support for Rust. Date: Wed, 25 Jan 2023 16:37:38 +0000 Message-Id: <20230125163739.3798252-3-Jamie.Cunliffe@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230125163739.3798252-1-Jamie.Cunliffe@arm.com> References: <20230125163739.3798252-1-Jamie.Cunliffe@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230125_083814_788498_3FEDD90B X-CRM114-Status: UNSURE ( 9.08 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Enable the PAC ret and BTI options in the Rust build flags to match the options that are used when building C. Signed-off-by: Jamie Cunliffe --- arch/arm64/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index d62bd221828f..b53ab6aa2dfe 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -85,8 +85,10 @@ PACRET-$(CONFIG_UNWIND_PATCH_PAC_INTO_SCS) := pac-ret ifeq ($(CONFIG_ARM64_BTI_KERNEL),y) branch-prot-flags-$(CONFIG_CC_HAS_BRANCH_PROT_PAC_RET_BTI) := -mbranch-protection=$(PACRET-y)+bti +KBUILD_RUSTFLAGS += -Z branch-protection=bti,pac-ret,leaf else branch-prot-flags-$(CONFIG_CC_HAS_BRANCH_PROT_PAC_RET) := -mbranch-protection=$(PACRET-y) +KBUILD_RUSTFLAGS += -Z branch-protection=pac-ret,leaf endif # -march=armv8.3-a enables the non-nops instructions for PAC, to avoid the # compiler to generate them and consequently to break the single image contract -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel