Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1209545pxb; Wed, 6 Apr 2022 11:23:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpdKyDe2XnFjVXkFO+wAAlfcH1wcMGKnaOEuRomu2YnGUwRxE0OO8o28vljm3T0R+nVabX X-Received: by 2002:a17:90b:713:b0:1c6:c8f5:6138 with SMTP id s19-20020a17090b071300b001c6c8f56138mr11473779pjz.138.1649269390738; Wed, 06 Apr 2022 11:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649269390; cv=none; d=google.com; s=arc-20160816; b=kH3yXJopWGhup1y2KYyv88Z9VNauiPUSHlmsj+Iddef0tw4YFS5c/iExONrPFt/6hz jffM8UMfsapdVM5vqoM/Awq7DewqrYk43FDr4HYEI0wfC0hhs7eDvhgX2SVAU2Bk8YVO vsNP6XXjVFXgc9Zl5JWKG7x7EvTq1uwU/7aqXzl9/vfWXbP3yzKZpLgDJcs8u6H+7qdI RjY78jZPoGSud1ti4HBvh3l4lhFHwwSjRWQ4Zm6e31uLNnKrllcT/1XmYY68MZDbvjJm CH08Jln6aKdjLYnoK9YvxX02lB0+bZZ7KQHB5OyP5ZKzbMex1aT953yA6cr0xRp88bZJ kXSQ== 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=6U8GzLUJqetcOfZRzlnzecjbvglIMbzDIR3Pfi8fyos=; b=RCOnVHYOEkm1nqNH+T0kysY34NZeLfY9/P7J+N54pbxVJG2TMlnJVNE7t2CJgtVxnJ PfI3CFHGN59cz/+kCx+9FuO/W7zMyt03XT99ezBHLdA3DkCqL8pH+Xjr6c5pp+nYBkra s6Eh64HAkjdDRpF+SahF2aWAEF6gWwdojqQgh0HVAL07tiRYzCTOJsznwpEcanZSAW6c 4K6MnsF6Ed0zPmXW8Epc6X7LoengQsTDKfOKThATjzybo824QTmzLNXdK2rO8mN9lcwl j+ioasfsblXBkHi+9AlOpghk1t3KE6koQYB0FUUF/qZxbY+bKLfwPHiBh5/9AE1mg3W7 K+fQ== 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:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k69-20020a638448000000b003816043ee35si15716314pgd.42.2022.04.06.11.23.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 11:23:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 C5CAF5DE40; Wed, 6 Apr 2022 11:06:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239802AbiDFSIK (ORCPT + 99 others); Wed, 6 Apr 2022 14:08:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240386AbiDFSHu (ORCPT ); Wed, 6 Apr 2022 14:07:50 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1DD101786B0; Wed, 6 Apr 2022 09:46:07 -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 DF5E512FC; Wed, 6 Apr 2022 09:46:06 -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 3E1813F73B; Wed, 6 Apr 2022 09:46:06 -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 05/43] arm64: capabilities: Move errata work around check on boot CPU Date: Wed, 6 Apr 2022 17:45:08 +0100 Message-Id: <20220406164546.1888528-5-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 From: Suzuki K Poulose [ Upstream commit 5e91107b06811f0ca147cebbedce53626c9c4443 ] We trigger CPU errata work around check on the boot CPU from smp_prepare_boot_cpu() to make sure that we run the checks only after the CPU feature infrastructure is initialised. While this is correct, we can also do this from init_cpu_features() which initilises the infrastructure, and is called only on the Boot CPU. This helps to consolidate the CPU capability handling to cpufeature.c. No functional changes. Cc: Will Deacon Cc: Catalin Marinas Cc: Mark Rutland Reviewed-by: Dave Martin Signed-off-by: Suzuki K Poulose Signed-off-by: Will Deacon Signed-off-by: Ard Biesheuvel Signed-off-by: Greg Kroah-Hartman Signed-off-by: James Morse --- arch/arm64/kernel/cpufeature.c | 5 +++++ arch/arm64/kernel/smp.c | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 8e037a519e02..65779a1644d1 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -476,6 +476,11 @@ void __init init_cpu_features(struct cpuinfo_arm64 *info) init_cpu_ftr_reg(SYS_MVFR2_EL1, info->reg_mvfr2); } + /* + * Run the errata work around checks on the boot CPU, once we have + * initialised the cpu feature infrastructure. + */ + update_cpu_errata_workarounds(); } static void update_cpu_ftr_reg(struct arm64_ftr_reg *reg, u64 new) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 13b9c20a84b5..ea4aedb6bbdc 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -444,12 +444,6 @@ void __init smp_prepare_boot_cpu(void) jump_label_init(); cpuinfo_store_boot_cpu(); save_boot_cpu_run_el(); - /* - * Run the errata work around checks on the boot CPU, once we have - * initialised the cpu feature infrastructure from - * cpuinfo_store_boot_cpu() above. - */ - update_cpu_errata_workarounds(); } static u64 __init of_get_cpu_mpidr(struct device_node *dn) -- 2.30.2