From patchwork Fri Jun 14 03:08:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10994181 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E4F4214C0 for ; Fri, 14 Jun 2019 03:20:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4281212BE for ; Fri, 14 Jun 2019 03:20:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6D8E27968; Fri, 14 Jun 2019 03:20:54 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 B9B96212BE for ; Fri, 14 Jun 2019 03:20:53 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=Q9Rk73Kon5lXCfq74/aKT62c7D8QFQ0UCrFGAKna/NE=; b=n/feId4KIe3C/I oDU/yx0+jWkBEzZJP1jGNxH2fvtpOg38fkEU3zxFwbJLj1tlNciExbiFOHAXPULXHSxwBbm2Mwwfo iMvk8eiM6imy+NjGWZUx76Gv6MM+SPTBJkS6HKKMfw7bgwEVVjalkqMnUg1hKAely88Fp988l9HR+ O/lkSciPG3kRYKCktEPDqN8fx6bcbVm1ejZmiREoYu9RqYzYE7vRjG8cdP3UAw4l/WX3RWenEVHCM SW62j5cbRkA+znLeV7VN+MVIkXXMGo0alLqsyW/jbwm75/Aw1xMZHBi3nR2/wrB1jWsTCfy/gH1+I X/h6hvqQFnjjZFfFRXVw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbclj-0001Kd-Qg; Fri, 14 Jun 2019 03:20:47 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hbceB-0000gV-Hw for linux-arm-kernel@lists.infradead.org; Fri, 14 Jun 2019 03:13:03 +0000 Received: by mail-pg1-x543.google.com with SMTP id f21so682951pgi.3 for ; Thu, 13 Jun 2019 20:12:59 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=y7D7di+hWLJT4S7T0euG3Tl4lwmsE/s4d/bbuco5Z4Y=; b=tn9ttUjCo/EPvIMutHSe21ptFw26CO8lMLTifKPIv38gL7+JQt+HP8TJghUQmKKFpp ZpLfHPaBsCa8fyB29TufhWsnLm1JxOkQqGXQjeEfNqHl3WjYf9Hi3tk2zMM/90BPaJCv PK4MM1eqbM5VvFktAiQ4S8uIcW3nVE8Sb0TcB9CJLZ+2C9LNRmiSvf4Gcy/TutPKIDJO 6oRlTUHT+FdhBjMC+pgPt/ZadHh8hc8RVYcm5dPXTdWWLOaiaxFcRx7YhawcoLH7lJEs Z1PptH6hyBln/IZcxEGZcPwBuo4jSo3oywpV2aRUTn9Gn40jGiSFEryl9gCr02qIa/Ut I4ag== 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:mime-version:content-transfer-encoding; bh=y7D7di+hWLJT4S7T0euG3Tl4lwmsE/s4d/bbuco5Z4Y=; b=tmCejZmMFKrRn4SpXiDlAtPeIIR+RVTfP48zCFv6pNik6D2SJnznM8XBRgZdBF2QDe Ng2L4s/npj1pGioge2bsZlj34SQWTHQsNx3sMStVwwnWvL1e/Hts9s1njHX+81R+r5n7 uZ5AmcwHV4q3VpUllZSlA9EHNoFPu9GxjFdti0uN8dK07SPh621uyo9EkJmx4Rze5UeU KCU7Q8+AcRUhUvvYalAOX8SJSkUVadlIGML98Cghk/hubcB363lZrFfq+trSHgt7TvCs XaijkDPRJkNMu6M4qi3fzV5cjEebMCn09cqtLlnNVqWVcAh1/mOltECsCeiLuB0I03uO sHPA== X-Gm-Message-State: APjAAAXoQ1OWBYOMTyq58nEJAB5FVk+yHw8um8e9we8MIVCJpEJSO9l4 DAwsCa9AqddVtdSl/3+DGXXW4plVjMg= X-Google-Smtp-Source: APXvYqy1XoUqM5zu1PsPirXi5eV1NLgcorVG8nNQhT9EvyDCcgAzjv4/LVlEZkfFxuFNSqYr80p4Ew== X-Received: by 2002:a63:140c:: with SMTP id u12mr33588467pgl.378.1560481978109; Thu, 13 Jun 2019 20:12:58 -0700 (PDT) Received: from localhost ([122.172.66.84]) by smtp.gmail.com with ESMTPSA id g5sm1064300pjt.14.2019.06.13.20.12.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 20:12:57 -0700 (PDT) From: Viresh Kumar To: linux-arm-kernel@lists.infradead.org, Julien Thierry Subject: [PATCH v4.4 24/45] arm64: cpu_errata: Allow an erratum to be match for all revisions of a core Date: Fri, 14 Jun 2019 08:38:07 +0530 Message-Id: <1b836bac823d576986a9e893e2d2509776ff3565.1560480942.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190613_201259_634460_7161F5F4 X-CRM114-Status: GOOD ( 10.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Marc Zyngier , Viresh Kumar , Will Deacon , stable@vger.kernel.org, mark.brown@arm.com, Catalin Marinas , Russell King 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: Marc Zyngier commit 06f1494f837da8997d670a1ba87add7963b08922 upstream. Some minor erratum may not be fixed in further revisions of a core, leading to a situation where the workaround needs to be updated each time an updated core is released. Introduce a MIDR_ALL_VERSIONS match helper that will work for all versions of that MIDR, once and for all. Acked-by: Thomas Gleixner Acked-by: Mark Rutland Acked-by: Daniel Lezcano Reviewed-by: Suzuki K Poulose Signed-off-by: Marc Zyngier Signed-off-by: Viresh Kumar --- arch/arm64/kernel/cpu_errata.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index 6c5e9e462629..c05135cd53fe 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -124,6 +124,13 @@ static void install_bp_hardening_cb(const struct arm64_cpu_capabilities *entry, .midr_range_min = min, \ .midr_range_max = max +#define MIDR_ALL_VERSIONS(model) \ + .def_scope = SCOPE_LOCAL_CPU, \ + .matches = is_affected_midr_range, \ + .midr_model = model, \ + .midr_range_min = 0, \ + .midr_range_max = (MIDR_VARIANT_MASK | MIDR_REVISION_MASK) + const struct arm64_cpu_capabilities arm64_errata[] = { #if defined(CONFIG_ARM64_ERRATUM_826319) || \ defined(CONFIG_ARM64_ERRATUM_827319) || \