Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2258068pxp; Mon, 21 Mar 2022 15:09:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEO3O9zjullBrsXlSqoWBh75InJ53QFHvOEEnsYKXnkxRPbrzGxeL5upltQZtHtMxdUZpK X-Received: by 2002:a17:903:11c7:b0:151:9769:3505 with SMTP id q7-20020a17090311c700b0015197693505mr14780431plh.72.1647900583476; Mon, 21 Mar 2022 15:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647900583; cv=none; d=google.com; s=arc-20160816; b=DkYuVm19grlKagP8GVNDkd2Dfimog7g28J3gH0C4oHC00P/rYI+oluJEROwWZB6nS3 L5Uwd2/aNlHfvU8y+jxV8VIjSXw0jvJr12wHBSCFo74XzhijtjiyzW+ilTY68L4hByBQ plq6b9f9GiHttlwkltGjMq1rInlQ8IBeRCTZPNZYuju/LwbTtLkVGMb79gue4Rk9uSeE 6qhOmFcF4MRyRyaWwNU9SRf1WuqUk55plKU1eyKMUDREzzWonbbmxaFW3nz0Ds3A5Rh4 8w24w3i2z+gLkplySYWGkXwjBpvFy+hj+tr0J8GD/3GlC48Z2d4utMBq8jpZfxxLqheB XZcQ== 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=yNz17/ayA+/uQ8rrSBb/+qLtfcNyfKqhj7cyuD3YKA0=; b=dqXqD3qDBprV+CsSSx9i2AmtiF+3Pf54P/k83qoRrA5SjEOxK3BxQ0NbNNTBOBbv6Z iRfgI0BFW/4R2Rtyx40OxLmBuNzmh/L0JfY5rRSWboyD96n/iLAd/VjWSL5wE8bDifSx MKKw72XoLrBcARQbZh8h92auKTkDSFx//4h99v8vr8otpggRF66hOgCeoFhKeE0lit1v 796rxuoLRvvxKptuRIls9oaSh+/bgK23EUvCYPn/tkcr1MyIapYc4ZvjmYZIRFGVUNnq pbLW36a6ewMIfcq3DZWLpXbXIYAXnJpQgAUJeyx6fNjuGbPnfS8lkZrKnvj3S8c3Mc7A QYrg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p13-20020a62ab0d000000b004fa3a8e0016si7802561pff.205.2022.03.21.15.09.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 15:09:43 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A74893620C4; Mon, 21 Mar 2022 14:30:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239891AbiCRRvf (ORCPT + 99 others); Fri, 18 Mar 2022 13:51:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239808AbiCRRvH (ORCPT ); Fri, 18 Mar 2022 13:51:07 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7DA2818BCE4; Fri, 18 Mar 2022 10:49: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 4AC9D1515; Fri, 18 Mar 2022 10:49: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 9F2AA3F7B4; Fri, 18 Mar 2022 10:49:41 -0700 (PDT) From: James Morse To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, james.morse@arm.com, catalin.marinas@arm.com Subject: [stable:PATCH v4.19.235 10/22] arm64: entry: Move trampoline macros out of ifdef'd section Date: Fri, 18 Mar 2022 17:48:30 +0000 Message-Id: <20220318174842.2321061-11-james.morse@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220318174842.2321061-1-james.morse@arm.com> References: <20220318174842.2321061-1-james.morse@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 a13f7d30b7fa..03c45538a93f 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -933,12 +933,7 @@ ENDPROC(el0_svc) .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 add \tmp, \tmp, #(PAGE_SIZE + RESERVED_TTBR0_SIZE) @@ -1029,6 +1024,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