Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1211945pxb; Wed, 6 Apr 2022 11:26:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLl9a1Hck/Zs4ndwJZVlopJHwvX83VueDqbxlp5zY6Hh5zuK4/PrxXwxEP5wuEq851hPKo X-Received: by 2002:aa7:81c6:0:b0:4fa:70a2:2063 with SMTP id c6-20020aa781c6000000b004fa70a22063mr10069711pfn.71.1649269610293; Wed, 06 Apr 2022 11:26:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649269610; cv=none; d=google.com; s=arc-20160816; b=ltnEz1ZvNqoUrehUlEkrWfM9jyor4zWwsrk9MF3KWTMeG34p3y3CK9DfERURCtXemi 80PqYuCq5T2hf2FLTTPxaiAD/aj+YA4XUhgXTJMsRI8u9oxzMMPSDiwoabVMixeXDYoK cyuLklsfR8yMDAM9h1hOubGq/aY/j/42G9DaZQD0VZeMhqgGblOVHZPMfzvJ+Tos2wcn EwKbABPIVlfgiV7amu55oubQZdXqmYP3kDuuWpiheuX5lERh4aqe8Dd6s6fmRjqftKxa vFIcru+S+dZ9eoKEny5hbFZlrnMqXVGQxySAwy5rrspKX1mD6bTCKsZM4i0oUiefSK+r 697g== 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=wYlyagPHPWDn28VQ5gmHPXEhYf5DNyqxZZjSzIzhuvw=; b=BSiNCltKEohARHVPV6YhhzI9E+YLE296lPSEgtGKtbI6UaCnc632uspwdY3sgaQqJH si+2LmGVCkOUAlZM2VB56C4VhgNM2QM80rHPVSX9FAGZbOHhpCnvORvaW4tNOpK0w5aC 0XpipDuLVX8Nml88fn7V2IYsXVhV+ajLRN7u9fxFbsHBZ9xPQayW7Eh4gSz2uNxEXEi2 V2CFzl0C8AP2grAAF4Vqq209H7AJVLd6O8pR24fta6XdwwBVovR67WkhcpN0V8zrQxs3 C+sdqZNSLpqaGHwta7mbLMDQMl9gq9SMB2sgq69fjq7hhQGT843bFsJBLNOxUpGgsdG6 lK8Q== 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 i6-20020a6561a6000000b003822513f7adsi14908688pgv.445.2022.04.06.11.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 11:26:50 -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 CABB21DE5A6; Wed, 6 Apr 2022 11:09:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240310AbiDFSKc (ORCPT + 99 others); Wed, 6 Apr 2022 14:10:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239775AbiDFSIJ (ORCPT ); Wed, 6 Apr 2022 14:08:09 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E4281196D70; Wed, 6 Apr 2022 09:46:29 -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 CB96F12FC; Wed, 6 Apr 2022 09:46:29 -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 2A7293F73B; Wed, 6 Apr 2022 09:46:29 -0700 (PDT) From: James Morse To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: James Morse , Catalin Marinas Subject: [stable:PATCH v4.9.309 31/43] arm64: entry: Move trampoline macros out of ifdef'd section Date: Wed, 6 Apr 2022 17:45:34 +0100 Message-Id: <20220406164546.1888528-31-james.morse@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220406164546.1888528-1-james.morse@arm.com> References: <0220406164217.1888053-1-james.morse@arm.com> <20220406164546.1888528-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 114922c1c3e3..9132400d6a9d 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -896,12 +896,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 @@ -980,6 +975,11 @@ __ni_sys_trace: .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