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: 10251403 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 AFE3760211 for ; Thu, 1 Mar 2018 13:30:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D974212BE for ; Thu, 1 Mar 2018 13:30:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 927FB21FAD; Thu, 1 Mar 2018 13:30:58 +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 07171212D5 for ; Thu, 1 Mar 2018 13:30:57 +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=uMweNaKnKkPcqRPx4KZMhkM49N +cT8KGw7OOWv33INOqKeWpPm1WFvkbxG0rcOjI4TTRdTF0okIQDACCeOd5whm9nkjrCc9UEZ7KEEx tmzG+JpJruPWMsnSZ7DJZ7E9gph7zKvHoluZkQqQegBe+pXTT8EDPUC0NuJLR/sdCYBd7lF9z3RFl xZUUtGjf55tu/vk+fRWTzl06zg/zeP0PfOOFirJYUuzcClt1am2zAdcI85Iuw7I1FLPAeABqIYXYI avikDcTd4VlzyLwn6oCJ1q5w5vJNgHI3lr2ybL9dNZVk3bvrWO9HU3DMMLHYAajKLCM5eGneei+YS QrqX1SjQ==; 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 1erOIK-0003np-1P; Thu, 01 Mar 2018 13:30:48 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1erO0W-0005Ub-77 for linux-arm-kernel@bombadil.infradead.org; Thu, 01 Mar 2018 13:12:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=WF4F4ODRoHmhOKSNTdy36+8et OK0mAbwS5RkPkO9jBFDrAtC/4LHA90fdVpxdDGYh8nbRXNN3gfMNQAjCNE09ZaLcwRStG7kA6zwfe rr6qw2PYnUZAo27VaH81IV83XlLnRw53dzx8a+5lY/j8XSPiLFkFliwztAdNLZnUeMwyQo79E6QYa z97oGhiDVlEMbuvr2KjstQ0S0ngc2eAB79G6snFBlTGUT5ajwyWLTjrHDYK+1WRbgsFB14dYsG0ET McQdTbO9tUBNfo9l9nIijTdKJkH710i1O2wqWbBWj9sDYK7myhCohEojTj06ltU2hKw2sKsW9/Yxh mtaaP0ZmQ==; Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1erNmc-00055J-KX for linux-arm-kernel@lists.infradead.org; Thu, 01 Mar 2018 12:58:04 +0000 Received: by mail-pf0-x244.google.com with SMTP id x1so523532pfh.7 for ; Thu, 01 Mar 2018 04:57:52 -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=PTCpCLjVbLIneYv8ecKwdHmdJ8b+szZu5Ux9benPnaEI4vo6rmFQnnWpLrxNjGq9Cx Zzuhqsa7Bkz0tM1CXCkAoinv8FUO3RZAsUcwm2IGS0xuH5W0/qEnE7oUTF+emzEHTN9H mUONpv6joivvLnMJ7v+3gz34XbkFgfTD2nMGOO+/dzosetKdHQguPRRtKELWda3FW9Bo a7SVDPMhD8zlhjUyJdlXwq9QXgcmZLKu8/beZhwZfEgFfYzov/6UAsWAapL87SXJoqAP yEox1gFa6jy/PtUmDijt0IN9lZXH+yZpdR6HZGQBe00Hm/hbPo4yS3/Hu4uQwicqD3hb vJSA== X-Gm-Message-State: APf1xPC1GF3dUfja/9aSVAoIo8jI7mGvofeDLvyEqUHIW1zmI+OVURoS obMV1+otEnb+56vCbkY8D15v/Q== X-Google-Smtp-Source: AG47ELsJvYuchbiD6Wc34ARdbng3MN1tTspN9l3MKVycqgyaT+4f2g2veQIyUu3anVE/iVwlWHGIjw== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180301_125802_666322_50334202 X-CRM114-Status: GOOD ( 17.75 ) 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 , Alex Shi , 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)