Received: by 10.223.185.116 with SMTP id b49csp3488874wrg; Mon, 26 Feb 2018 00:25:08 -0800 (PST) X-Google-Smtp-Source: AH8x226xWVP2NSw0AmabjWRLofDz3/BmDgO8T5yeDEOmTofWxfNGeLCkVFq8Fg9q2cYNIc0CL0J1 X-Received: by 10.98.210.70 with SMTP id c67mr9778234pfg.164.1519633507879; Mon, 26 Feb 2018 00:25:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519633507; cv=none; d=google.com; s=arc-20160816; b=QSFU705uBXC4TcA9iz92CzRiEFKgMyQMJB+wAAbiqdgfJ6y7tBoWWdTRPRuDTl2kzI 2z8Dsofm884sZonse3r3stiLv76KtpVXNoBVZPRUYR6iOm1Heyh//uQQGE9yCjeEaHXX CORfTVE8a7e2rUiKBqCovmL9BLjK/Jk7+dORvCPxiqPGM+GC9Yo11xCiLBj1tRVUhqCI arlkHXwT6X0z3x1EJwBO5apypgrARjxtw6F04Fsyjc56MU+d3b5q5DPulp6v88hE9WMH yVW3aH9vqyh8jlRz4bpf0QJ3z58A1DOeKAJYRw93cO7a7jpyg318nRtpSI+n/ggDWq5C 6T8w== 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:to:from:dkim-signature:arc-authentication-results; bh=lZSZ7mN/jhpd6MgLblCtRDrj6c7/jUPbXNYPUP0WgH0=; b=AJYBqzGgKEgPHeL1O1BFVNrSvO6vKnWOxrxle7Zrelf9xKV8lM9wiRi/kE6FYyfBUb BPhAs5j4O6OtsDFGnh8wi6s4eSe8TY5F65RXKAnyHqFBigFx9I0MwlfY5RtNA8Y62Ht5 5WCsDooqHljBT9/5NrMLDTr0W9feTiYqthPIuS0ADOhkwxY7hbnTS9sUva81MX5FIo9r xYs6zwtnXgIFc8XTNwCNBoT81dfCJ3stKXEZa1mIuonlO10SWHIkVxJWHa/TD/rK2QNq 1sozVbyPLRM8AguG1Q8JT6usFuTxIa0u0LpBLmP3zHWez5E8UUpPoFXOxi8Um0FPPHYV wGTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C0FlJHD/; 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 15-v6si43248pld.618.2018.02.26.00.24.53; Mon, 26 Feb 2018 00:25:07 -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=C0FlJHD/; 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 S1752533AbeBZIXb (ORCPT + 99 others); Mon, 26 Feb 2018 03:23:31 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33282 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752317AbeBZIX0 (ORCPT ); Mon, 26 Feb 2018 03:23:26 -0500 Received: by mail-pf0-f194.google.com with SMTP id q13so6223074pff.0 for ; Mon, 26 Feb 2018 00:23:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=lZSZ7mN/jhpd6MgLblCtRDrj6c7/jUPbXNYPUP0WgH0=; b=C0FlJHD/X8UDYz8E8ZjLvGAnsiBI0Q2HPR3JReFTRfeB7pziFNxym5iMJwS9I6YgcT 3WGC1QFl29hNlpFY678mRq/Sv+tJuaHM13JZLhinQduhf+yW3HzhiyRaCofA7P5km2Z5 dYCKmOqr/w9OPen3fvnEVWsELg0hgewaLIX7I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=lZSZ7mN/jhpd6MgLblCtRDrj6c7/jUPbXNYPUP0WgH0=; b=WR9+ABLlfoKW/JP7HIOttsQk+jMKvxGyocgt2KY9ziZsJ27K/NKu6Zrin5/kSRBssZ DGliZSQeqDDmsApy0jZMIjhFW90kwyNXNCQdNJpmpVY6inEKkXDtRV3o6aOmVjAdaqv0 EMHxqVHE2qBX9ePkP/jcIf/J+gcu7+r4yO98qfZkhGlV+QNucrltkKL5Uxs6I+e1XGKa NeQkz9OZnJdcZYH6Hu/C4ZygS9ywuor5VqbEpTjuo7k4E7FuBsWPr7W3pCn9SQR1NKyH uuJsiICC7m7LBVCzHdnBXA9RaJ71Rp61JnuE30QiI0F71rAXi/X08ernTwGZy7+Lr3G3 HbQA== X-Gm-Message-State: APf1xPBritQKo+hnO75TUqrgZ0ci6Gp3byERX39bKgakvbGjTg1QVuG/ 1roTrffJOanLZKm6+IwzVYtMDA== X-Received: by 10.167.129.67 with SMTP id d3mr9821874pfn.108.1519633405731; Mon, 26 Feb 2018 00:23:25 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id o86sm1422706pfi.87.2018.02.26.00.23.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Feb 2018 00:23:25 -0800 (PST) From: Alex Shi To: Marc Zyngier , Will Deacon , Ard Biesheuvel , Catalin Marinas , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 19/52] arm64: cpu_errata: Allow an erratum to be match for all revisions of a core Date: Mon, 26 Feb 2018 16:19:53 +0800 Message-Id: <1519633227-29832-20-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519633227-29832-1-git-send-email-alex.shi@linaro.org> References: <1519633227-29832-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: Marc Zyngier commit 06f1494f837 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: Alex Shi --- 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 b75e917..c66a673c 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -53,6 +53,13 @@ static int cpu_enable_trap_ctr_access(void *__unused) .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) || \ -- 2.7.4