Received: by 10.223.185.116 with SMTP id b49csp2250047wrg; Thu, 15 Feb 2018 08:45:17 -0800 (PST) X-Google-Smtp-Source: AH8x224di5hAdoq4MmCYuZbhu/4WXPB2IyAs0Wo5N2VKk4PpqmDzK/8o+HwGaZ1/pGtnDl0tAd0z X-Received: by 10.99.186.88 with SMTP id l24mr2644301pgu.369.1518713117851; Thu, 15 Feb 2018 08:45:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518713117; cv=none; d=google.com; s=arc-20160816; b=e6SgxExveCNo2mA2e0RbkDEHzvPCmLYsac91VAb1Xv+gs7QHoOUHnVB1eYLMKz3edE +cWRT3ZVZ+Bf8+D3Gr/pFV6yFmMGBiCzr3nvqJfwiWPEcWDU0UNOMRKMoZuhJ7WmkhVU xRcKk3CPkiVGTy+zfWu9RhPSmNfo+9tSYZCe6Fs+Uxui3o75Xz62UnBFsJk6n0n09Zov wrBlZVoLT30WopDFhUvvhzBRVLbzfeeX1+EoGpD+atdImifhhDLrcyqBuZ2F42wGeyVT yMoSic9qYMyNCR9v3Wdsaj3pKZ9wTlIQmzFz7TBBx7FWFlzh49tqvoqYU1Oe8um87B7B lqxg== 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=lvW4o0UOYDqD+vn616zwcR8QP1OyP3aQ5xfRsFuoAa4=; b=fL0P+J6Zca+8BZTcIjZaGft3C34mmWXAbA0kIkV+VMpwBDLDqcS6kjOAq5TJEsyxJI 7IHoBxFzu2WR6m/8ta69QmgZOd4WDizhU+w766jLoei02/mGWj2cWXvr792jZxoj7ASb T24XGLfQa8d41U+YeTft1w9hhmtgBrjX1uPesdOU7NV28nMfai/sj9N8I8IUPzrXWw1R wYLw1Ra2ze6Oa0f2aYwnYLvTS1FJ5xsuYeH+oviSE7vlsFBnsn3ogj7kr0C5go6b5X8f BXxeXmTtEBPOOT1JuC6jMa773rBDe73+gFdCHLCVBUFH9OTTN0XJtucUfCp9jdNeiox/ OjKw== 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 f9si954177pgc.170.2018.02.15.08.45.03; Thu, 15 Feb 2018 08:45:17 -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; 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 S1423893AbeBOPlQ (ORCPT + 99 others); Thu, 15 Feb 2018 10:41:16 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:60332 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423873AbeBOPlL (ORCPT ); Thu, 15 Feb 2018 10:41:11 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7316F116B; Thu, 15 Feb 2018 15:41:10 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Will Deacon , Mark Rutland , Andre Przywara , Dave Martin , Suzuki K Poulose , Catalin Marinas Subject: [PATCH 4.15 059/202] [Variant 2/Spectre-v2] arm64: Run enable method for errata work arounds on late CPUs Date: Thu, 15 Feb 2018 16:15:59 +0100 Message-Id: <20180215151716.386570101@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@linuxfoundation.org> User-Agent: quilt/0.65 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.15-stable review patch. If anyone has any objections, please let me know. ------------------ 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: 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 @@ -221,15 +221,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)