From patchwork Thu Mar 1 12:53:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 130199 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2762444edc; Thu, 1 Mar 2018 04:57:57 -0800 (PST) X-Google-Smtp-Source: AG47ELtBtwqivhpwZizTZe2i1cRMnoutP6ztBLqBILEvQeT3BUG7Ubgxf0l3o562Q5ugiAA9deN9 X-Received: by 10.99.112.20 with SMTP id l20mr1511829pgc.412.1519909077631; Thu, 01 Mar 2018 04:57:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519909077; cv=none; d=google.com; s=arc-20160816; b=JnI9zwHenqpfesYacaPr3DJwD5CtvT1/6Gdgp0TAmfhJi446+C3ueBDBFLPi2bcqkT pq5/1GVUlbhfCpzWOzWdorXsYGPdLpuspLFNaOA6kbc/XFPJxRDkcaK3Lj2OG52XsDhK 3OzQhLhHaaFPbM+GowUOpUG17vI5/bpyvH7jz4ziCXDjUqXPGjRhzfHJC6NfWnFqVI41 fV+s2EnartI/8E54RYrWOlZIA/kI93W8Ro1+5NPVMvgLu3sg5/PdMfJpHquFxKrIf7R+ gS1d0WCuzJFVuGpuUqej91b/B79+iNRba2BuyGNBTSfiFtKp2n0dq00Fd7MWNRkbm8rS ayJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=zPqSNl85WyC76XW1VxDfQh//hh1Bpcs4lU5Fv1YTRJ0=; b=XsTsuOezolIpezf+cC73vK7shYCGpjbOluRsEHSSwK+kp29KhKOs9DgMvgqNPIJ9YS ITUfIjzdlCUA0DqQ5bocvl3yzgEiE3/oYlObQYcLXIyrHNCi7hdzSgBJY+niN651L3gl XtKLTcvlDvehoxQfOMtYrj9Irr51vndIu9P7uJrdQgRYPbXii5lC4mAlPF9tV8CZXJai JXxv66AvepEmdPbIlVLjpFqHw/y6NQgqgVJj02t0Bqmx2OzM1Hohwnm3Bj4LmFtX7sEX kY8QgmSMWwY57nMsUzIizGbGz1lyzQtO87deBo/ijyeuWEYF1IgSGChRSvVkTEavR0Y0 iICw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RMB40iPH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w62si2442652pgd.573.2018.03.01.04.57.57; Thu, 01 Mar 2018 04:57:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RMB40iPH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030909AbeCAM5y (ORCPT + 28 others); Thu, 1 Mar 2018 07:57:54 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:44073 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030602AbeCAM5v (ORCPT ); Thu, 1 Mar 2018 07:57:51 -0500 Received: by mail-pf0-f196.google.com with SMTP id 17so2396797pfw.11 for ; Thu, 01 Mar 2018 04:57:51 -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=RMB40iPHOPC/sqXJgaYtq5AMH0hSeRu+UcbZkc4e6/xt5Cw/Y2oaDugnEC3sKmG/zZ o04lRqh/27Gd5X+/nW+KF7UO6ejVsz0fHnRWKl4YNk+9Muko30PiaJAMjFblZiaRX9ez f0D1U/YUKbe/GWk3KG2QxXdDWbJyztF1Q72vU= 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=torthYo3+Ts2PDzYq1CRfW5CYZMXVws/OWEukHeBLLqoskmmvVjDUI++TSCVmxFXwT kbb78289St2tgSGgbn4qwTxZg5Sjj7R8u/q1LvUskXD4N/PL8XKUIqC2IYCsSQrWA+ze G9HkeO+80gWdgACtjZuo3X2LQ3cG1ySmxb5TDvgsQoLhn4cOTv2JfoSFL09lk0kQiP9f obAAsgRCnFMlcPV3gfpQAmfJg8fcSR0R7/1VeDLnAYNP90DDtf+mLoOzOMdrqGio5uSf GHWjlXQNSDk7R3G0wU5SX73iZMqFE2q/Lile5pc+qnOoeHEmHUqj8gR33fyEzzee3mFr tD3w== X-Gm-Message-State: APf1xPBeTQvpzYfCtwNKxnUkIm9vpMc+bfYb7gB5bUZYnbEDhZmDECMI a+0m0JNO1wgIJ89HgHmsdB7xIA== X-Received: by 10.101.69.4 with SMTP id n4mr1512030pgq.184.1519909070967; Thu, 01 Mar 2018 04:57:50 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id x4sm2289655pfb.46.2018.03.01.04.57.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Mar 2018 04:57:50 -0800 (PST) From: Alex Shi To: Marc Zyngier , Will Deacon , Ard Biesheuvel , Catalin Marinas , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Suzuki K Poulose , Mark Rutland , Andre Przywara , Dave Martin , Alex Shi Subject: [PATCH 20/45] arm64: Run enable method for errata work arounds on late CPUs Date: Thu, 1 Mar 2018 20:53:57 +0800 Message-Id: <1519908862-11425-21-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519908862-11425-1-git-send-email-alex.shi@linaro.org> References: <1519908862-11425-1-git-send-email-alex.shi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4 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)