From patchwork Sun Apr 16 20:26:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 97463 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1086809qgf; Sun, 16 Apr 2017 13:28:15 -0700 (PDT) X-Received: by 10.98.219.197 with SMTP id f188mr1643261pfg.109.1492374495216; Sun, 16 Apr 2017 13:28:15 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b69si8923242pfl.158.2017.04.16.13.28.14; Sun, 16 Apr 2017 13:28:15 -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; dkim=pass header.i=@linaro.org; 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 S1756829AbdDPU16 (ORCPT + 15 others); Sun, 16 Apr 2017 16:27:58 -0400 Received: from mail-wr0-f178.google.com ([209.85.128.178]:33383 "EHLO mail-wr0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756794AbdDPU1z (ORCPT ); Sun, 16 Apr 2017 16:27:55 -0400 Received: by mail-wr0-f178.google.com with SMTP id l28so74356966wre.0 for ; Sun, 16 Apr 2017 13:27:54 -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; bh=KeUFUzQp+X2X0yI8boEnB2zM0O6bp0b2kimtsvHQ6hI=; b=VLo6BI23l5+O+NLWihO9m+nfaE1FPNdvC0xlC3SbXhRwA40xRM+vTR83vtH2uIr/qL 2gnYmv4KPPuyFWNLqEq7x+EK7rRIB/QFKfd0itXUropuA29q8K4aJL4wqORaOxovPd6h O8Z4phtXA1kfqygGnJGuXCBTRs0Tx9skHWUOE= 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=KeUFUzQp+X2X0yI8boEnB2zM0O6bp0b2kimtsvHQ6hI=; b=fW5qkfyNVQuXef+HQG4TWa+Nl3khQlodGlRSyu0lwmkdfqYCOFX/tVgkJa3mruU380 SLgybQ15mdfyuK05b2KS2i9VwsUQRSsclsUwxzDWTMtOe3vft7nYWni0G655tFWUQalb F5MPojYN3SnmrIQFJeYfo0ar3dR7fjaMz+6ekWgxJB3tq99G1Rr4OzHjLxUoJg5MTyDX 719rKsTowPFxw1p11TN/oaahbtG4yUr9voK9j33rgRkQXOo5Vj2OZJ09wH88fncc+RIZ AVvTWq8WgOAcCKXg7wW1QuX+LOb/DKkj9Isk8Z2IUHIaATY5H4euMdi81XSoNBl2DkPk tYfA== X-Gm-Message-State: AN3rC/6GfD7A+cbCWYeV5/mzpoYV51wXTmNkHuTMT9MaCyWYYDWyVD2a JXolaa5nreaApJ3b X-Received: by 10.223.141.140 with SMTP id o12mr17262676wrb.69.1492374474123; Sun, 16 Apr 2017 13:27:54 -0700 (PDT) Received: from mai.lan ([2001:41d0:fe90:b800:20c0:6248:a385:db35]) by smtp.gmail.com with ESMTPSA id 81sm7732196wmj.9.2017.04.16.13.27.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Apr 2017 13:27:53 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Marc Zyngier , Mark Rutland , Catalin Marinas , Will Deacon , Suzuki K Poulose , Andre Przywara , Christopher Covington , James Morse , Robert Richter , linux-arm-kernel@lists.infradead.org (moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)) Subject: [PATCH 04/29] arm64: cpu_errata: Allow an erratum to be match for all revisions of a core Date: Sun, 16 Apr 2017 22:26:54 +0200 Message-Id: <1492374441-23336-4-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1492374441-23336-1-git-send-email-daniel.lezcano@linaro.org> References: <20170416202542.GV2078@mai> <1492374441-23336-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc Zyngier 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 --- arch/arm64/kernel/cpu_errata.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.7.4 diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index f6cc67e..2be1d1c 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) || \