Received: by 10.192.165.156 with SMTP id m28csp230671imm; Tue, 17 Apr 2018 09:11:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx48z50a5UXaIP7OxTRRA1HdgnGXGJBeZqsE++uA07N8e/XGxqIsf1R0bOQ0VdfmZj7N3xr8V X-Received: by 10.99.169.1 with SMTP id u1mr2337080pge.251.1523981492631; Tue, 17 Apr 2018 09:11:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523981492; cv=none; d=google.com; s=arc-20160816; b=xtvhbSdZlFWODz68tvNzvnCZcAA8rlw/HCKoypnxNrCrpQb82UWl5wjAnF0DLfl19F 9Xum6T3gm9q6JKIpWG3cHg0sYn5oGd1z3Ha8N/YxWHjMRndTBV+yUaMQErk019HE69m3 ty4IvQD8URsixd9QFUG/QJs9qqEJEPmJHrAKBrUbGBJ4XawC28tL0kq7Thbes1v4/XJ/ yX2XEjGwykyql9dEI3ogXUS03iKt2Hwk5STVfrwms/QL9ZeZlMX5XDSjFBb0fIfqNlHw /D4l+5j4DiDnPxlUt6CP7WN8+Itq88mLn/855cZ8Czw6ggyM/s1a3MArhwC5fLKfrFFa TKww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=CCT+Nym4+qNTeS9bPdvhuesU+KvOx6nEVl38fOmR/18=; b=w0bhojZOF69D5zfm+nq/+A+n/JpCBK7gzTX6/PKsvWXhcIQqP5ikbbpjwxq9OIfALF 8MhkEuktiYEkpcQ1d3oyM2ksuHEZJ0wdQedwt7UfVLyRklpeGUXvZuUv43C7OTT+yhXW ajITVTwMxxquc56nWUj4EoUGMLKRB0TK85BI18svWdoBuklRYRvPm+ziq7G4RJsISkWl +q/kVSXXSP0UJHe3aH+P+Ifjc8HdlAYOlWvv99yVj6+nITm5kePRqJzI4DwhIJxQMMph OLXhtoVg5u8B+VJvWR+pxU3J6S5rX5/g63TU2C8oflTixllRewq95hbXUSq29hIC0L0q 5+/w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14-v6si4783206plk.535.2018.04.17.09.11.17; Tue, 17 Apr 2018 09:11:32 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755486AbeDQQIj (ORCPT + 99 others); Tue, 17 Apr 2018 12:08:39 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35542 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755077AbeDQQIg (ORCPT ); Tue, 17 Apr 2018 12:08:36 -0400 Received: from localhost (unknown [46.44.180.42]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9BB44E66; Tue, 17 Apr 2018 16:08:35 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Will Deacon , Mark Rutland , Andre Przywara , Dave Martin , Suzuki K Poulose , Catalin Marinas , Greg Hackmann Subject: [PATCH 4.9 20/66] arm64: Run enable method for errata work arounds on late CPUs Date: Tue, 17 Apr 2018 17:58:53 +0200 Message-Id: <20180417155646.726727900@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180417155645.868055442@linuxfoundation.org> References: <20180417155645.868055442@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mark Rutland From: Suzuki K Poulose commit 55b35d070c2534dfb714b883f3c3ae05d02032da 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: Mark Rutland [v4.9 backport] Tested-by: Greg Hackmann Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/cpu_errata.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -143,15 +143,18 @@ void verify_local_cpu_errata_workarounds { 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)