Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1254301pxb; Fri, 1 Apr 2022 08:29:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPEqHPF0nW+z1GrYQn7gFice/ZOkBv2rFbrrN81FCGgTlRtfA3NMRNYT8ASXJXnQL4Cuvj X-Received: by 2002:aa7:d517:0:b0:419:16c0:f313 with SMTP id y23-20020aa7d517000000b0041916c0f313mr21654512edq.379.1648826946483; Fri, 01 Apr 2022 08:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648826946; cv=none; d=google.com; s=arc-20160816; b=gI+NCkPzIJy1EUyD3WpHZ7gr9RCeH22B1hD3Her500XjvEozCLrZnf8IwoHQI8ftG/ WpQ2tcZq7ADAG348zaP29dYuohkSD6uI42IAsVmInEDOdxwGQYbDGclEH0JGKtgFszKZ bgEvNxXH9Cg9UGqdAybVuV7piEdtlQmTn/6Pl1pWPQrS092x2eL60GSipZXq0ib2MDhf 0/o7ALHnzOfdDdHtevyVFuSZSKNNQriuk2Cya4FaWJ8JQHqvycq4l2KzDW4p9yesvGce haSg+L7MK0zYBagDPpekV8PQ6M7syGr8C5RrG1Uq9fzpLPFqvDyHEDuu5u6IhqxS8jIl NCow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GvcF/udbQV4E9Ql2GKyoE5nf12Yoy9rjSW3RTUGviW8=; b=OjSEZerVzLDUprWYGHlpRnefNnLRZ2YE/fERyKEpk96BfgDb8NN5QXUzFx3RvPoGAW xDGHJVA6cLkpmPmaCpbM4CfFu89q2DQ2iv0t6XXU5poBVkK/QPQXpzVjBrOx8tPfZh0S NeBdMlllMxo4Awzb/pY4c54T8aWdT92SuVTcbF0lTAkMYQc8b+MyDeOaNbxO9uLSbfc1 BJAi3u+zucyJFbYaXgNpmCvYxWOHkwt1GFn06ilIGhJKXjuSPuR32M9b5W8SWXv5/DB9 wXp4Vl9CyjoEoXYUwy1j9W7iNyOJ90uJcq2LiIBheNTHevupsN3rtDJEzUO6I2p6HGu3 zB3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v18-20020a170906181200b006df76385dd3si1683802eje.627.2022.04.01.08.28.41; Fri, 01 Apr 2022 08:29:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235358AbiCaShN (ORCPT + 99 others); Thu, 31 Mar 2022 14:37:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235206AbiCaSgc (ORCPT ); Thu, 31 Mar 2022 14:36:32 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 89E3D1F1D08; Thu, 31 Mar 2022 11:34:42 -0700 (PDT) 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 6D92113D5; Thu, 31 Mar 2022 11:34:42 -0700 (PDT) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.218]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C45F33F718; Thu, 31 Mar 2022 11:34:41 -0700 (PDT) From: James Morse To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: james.morse@arm.com, catalin.marinas@arm.com Subject: [stable:PATCH v4.14.274 15/27] arm64: entry: Move trampoline macros out of ifdef'd section Date: Thu, 31 Mar 2022 19:33:48 +0100 Message-Id: <20220331183400.73183-16-james.morse@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220331183400.73183-1-james.morse@arm.com> References: <20220331183400.73183-1-james.morse@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit 13d7a08352a83ef2252aeb464a5e08dfc06b5dfd upstream. The macros for building the kpti trampoline are all behind CONFIG_UNMAP_KERNEL_AT_EL0, and in a region that outputs to the .entry.tramp.text section. Move the macros out so they can be used to generate other kinds of trampoline. Only the symbols need to be guarded by CONFIG_UNMAP_KERNEL_AT_EL0 and appear in the .entry.tramp.text section. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse --- arch/arm64/kernel/entry.S | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 12612e3ae7f7..20055f976146 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -985,12 +985,7 @@ __ni_sys_trace: .popsection // .entry.text -#ifdef CONFIG_UNMAP_KERNEL_AT_EL0 -/* - * Exception vectors trampoline. - */ - .pushsection ".entry.tramp.text", "ax" - + // Move from tramp_pg_dir to swapper_pg_dir .macro tramp_map_kernel, tmp mrs \tmp, ttbr1_el1 sub \tmp, \tmp, #(SWAPPER_DIR_SIZE + RESERVED_TTBR0_SIZE) @@ -1081,6 +1076,11 @@ alternative_insn isb, nop, ARM64_WORKAROUND_QCOM_FALKOR_E1003 .endr .endm +#ifdef CONFIG_UNMAP_KERNEL_AT_EL0 +/* + * Exception vectors trampoline. + */ + .pushsection ".entry.tramp.text", "ax" .align 11 ENTRY(tramp_vectors) generate_tramp_vector -- 2.30.2