From patchwork Mon Feb 26 08:19:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 10241557 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 68A4F60386 for ; Mon, 26 Feb 2018 08:34:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52D0829BEB for ; Mon, 26 Feb 2018 08:34:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45C9B29BFC; Mon, 26 Feb 2018 08:34:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B710529BEB for ; Mon, 26 Feb 2018 08:34:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=p/l/mR2N2qSlApo9mQPnnHwevmDETrDMKwyue1WSons=; b=VT0L9HubCUr49R0nENXlvodosq yUnjyDf+2pkRPU8fHSakRTXUZuFZih44dDcyluoQPTu1LOxHPeJRQmRGe1X1Np2f0RdCqyS5lqxEW 2DW2m2JG9gT7ljBf+qyncDeIYTAXDMA7FAPzZZue6r8D/8pKZtlCIgdT1P6QfXFOwK5iQKzlSrqFb vMzQl8i/C71aT83FRLiUkVs2DkAzh6BC2EcSjAYa6BkGyNpZ6YP6stON5HsoewALbmCOgyGSHIlnm C2h3/5iM10rLqSF5u0dLqlBuBySr7nVd/8tahM1nsk8KXbH+zC+KP/Se1a8pWoQ0Aj6zHF4XwKTzn EPuoJ9cw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eqEER-0001Mm-Ir; Mon, 26 Feb 2018 08:33:59 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eqE4f-0001lR-Ub for linux-arm-kernel@bombadil.infradead.org; Mon, 26 Feb 2018 08:23:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zPqSNl85WyC76XW1VxDfQh//hh1Bpcs4lU5Fv1YTRJ0=; b=NJRldFopXI3yqHaE0xJcig03m /OMT8P0Zrf+Q0KMZ4qr1Z8CQVnsfPB4zsCYpBAovHGWFvmbxhb0DXuf517ikkObvPpKGE9GFt1R0W lYrL0qsNgW3OCxKqhtWw8TZ0hadUO+bNLPbFxNo2TIHgAB0X0KEin/s7CaT/JPY+oShSWe/475Fcz evwMLlPhV4Ad+CCHPHndvL0pteNBsKtbLU+keeAeXbXS/ufuRpjyeT6ZJoQVDZdUqDMFiu2728/Yx z9jCMKUGr/DgIehjmKfIDzre07KsoWGO6MHmT+KV+q/sj0MPhQgv3aEcDP/xrsCjTc1bjWB26mXCE uDop8FQAw==; Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]) by merlin.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eqE4c-0003Uw-8v for linux-arm-kernel@lists.infradead.org; Mon, 26 Feb 2018 08:23:51 +0000 Received: by mail-pg0-x241.google.com with SMTP id q27so4311415pgn.8 for ; Mon, 26 Feb 2018 00:23:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zPqSNl85WyC76XW1VxDfQh//hh1Bpcs4lU5Fv1YTRJ0=; b=KDWmoSqWRpgPXOtDS87zbO1parC+aWPWEmMrTJNlXcMiRczSZo/OOvbh1VPNpMuwxg 7v2ODO9ISyamLeGUekYilApPW2HQB89TMbVyFN0Jq0h2vYG6Gj2q3Wpb1T9qmZmj8La2 Ed0iqoaMU0PcjP85X3dG6y0dVASeYBMXgv1vs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zPqSNl85WyC76XW1VxDfQh//hh1Bpcs4lU5Fv1YTRJ0=; b=ZqWkOWQ812USn31qvxPf60nvrjjuvpTXVQdNBw3A6LHUd26QpDBFuVY9bQ2v7yjgL4 O03hZo75g9CsN4kWXMQ5VZvSiRPTFiRd06U+7QjtB1wUGyiSp6Wcd9htajuLS07CCfBn PAMqK/a+VS9sxTg76ARjr52Qmp2lQbZ3rgR3nO6jy6y4X2K1B9kqQ4MlvHQj8J82SRc4 DzbnSvNGgLL8R1DaMMIC8foYVLPvEUU7KEv7Nv8AAjUQwUwqHzRZvboDh+gfQQtvoQ44 qU8wo27GSCPnngyk4tIqjAOBjJgBJ074SSrMzon1AJUJ07y8NVRADdkWGEcfVDLn8Sg3 yJHA== X-Gm-Message-State: APf1xPDwuQ7njlHgfw+iEFqRQbXPFsIlQIX/3TvYJrFHBNOA/jH9eN4i iio0y12V832N+J4S6oRLGt4vkg== X-Google-Smtp-Source: AH8x225zbjfj+k+6AaVbAOxALAf+p4lc8xlqiTIo5f/1rnSTe/nf2Pp1IizLfyuZciAhphltDta5+A== X-Received: by 10.98.25.10 with SMTP id 10mr9661936pfz.136.1519633414159; Mon, 26 Feb 2018 00:23:34 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id o86sm1422706pfi.87.2018.02.26.00.23.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Feb 2018 00:23:33 -0800 (PST) From: Alex Shi To: Marc Zyngier , Will Deacon , Ard Biesheuvel , Catalin Marinas , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 20/52] arm64: Run enable method for errata work arounds on late CPUs Date: Mon, 26 Feb 2018 16:19:54 +0800 Message-Id: <1519633227-29832-21-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519633227-29832-1-git-send-email-alex.shi@linaro.org> References: <1519633227-29832-1-git-send-email-alex.shi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180226_032350_328441_FA64F731 X-CRM114-Status: GOOD ( 16.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Andre Przywara , Dave Martin , Suzuki K Poulose MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Suzuki K Poulose commit 55b35d070c25 upstream. When a CPU is brought up after we have finalised the system wide capabilities (i.e, features and errata), we make sure the new CPU doesn't need a new errata work around which has not been detected already. However we don't run enable() method on the new CPU for the errata work arounds already detected. This could cause the new CPU running without potential work arounds. It is upto the "enable()" method to decide if this CPU should do something about the errata. Fixes: commit 6a6efbb45b7d95c84 ("arm64: Verify CPU errata work arounds on hotplugged CPU") Cc: Will Deacon Cc: Mark Rutland Cc: Andre Przywara Cc: Dave Martin Signed-off-by: Suzuki K Poulose Signed-off-by: Catalin Marinas Signed-off-by: Will Deacon Signed-off-by: Alex Shi --- arch/arm64/kernel/cpu_errata.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index c66a673c..8de43799 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -150,15 +150,18 @@ void verify_local_cpu_errata_workarounds(void) { const struct arm64_cpu_capabilities *caps = arm64_errata; - for (; caps->matches; caps++) - if (!cpus_have_cap(caps->capability) && - caps->matches(caps, SCOPE_LOCAL_CPU)) { + for (; caps->matches; caps++) { + if (cpus_have_cap(caps->capability)) { + if (caps->enable) + caps->enable((void *)caps); + } else if (caps->matches(caps, SCOPE_LOCAL_CPU)) { pr_crit("CPU%d: Requires work around for %s, not detected" " at boot time\n", smp_processor_id(), caps->desc ? : "an erratum"); cpu_die_early(); } + } } void update_cpu_errata_workarounds(void)