From patchwork Thu Apr 12 11:11:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 133219 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1572104ljb; Thu, 12 Apr 2018 04:13:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx48j2uosSrSzLACpu00TN0YI0KSXXpAOFPoyqqTZ9OqNq83ANLm3bpbVj4UXAYQHoGec08Fa X-Received: by 10.99.111.197 with SMTP id k188mr384053pgc.10.1523531589893; Thu, 12 Apr 2018 04:13:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523531589; cv=none; d=google.com; s=arc-20160816; b=v6AO1+xvHAgh5o3IdJmjoCOTTHxTCUAVpDDiiryhizmLK5bXEbMYlGbEFaU39aHwA/ urQjVvO/+Xo1zw+gJH0zySQ+FqpDazzU2OgsRWEP1Wb3EH/o+qraMJ8SQ+6nkCY76cmR m9m2n8WXhXlV54zyWvLHwLvrd220nDS/eM8WnhtbjEBAh3+SEGiF/znUswgbidUdP9ya hqDg44EFtOq5CyyhDYYNuWvvFMf58y+LF5fvgYd6DWC5EYqDaikjYFNiv88qE8O2NfeO uwLp2rgu18xqJXVvcrUT5fYfEkLoSHUCoEOzaPzs5GU6hG6qq8Zk3almt2zgqYas9mT/ BLgg== 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:cc:to:from:arc-authentication-results; bh=HbuK8ms/LTlC4bw7C56QnzDMCZWpbC8xmMRVzVEZRY4=; b=IVAU+sPxji1IxeyHX17dxqZg3HG7YFT/2F6uJoFepF2z1Ou6j+jA3r0RvuJ5rEcswa sNJO7NTHpcMGpFDTmkM0SGCsccOavtyjJpHaRvDVzSmMW63JlqQ/7BEwEsslo4cCh2qm UZbxhge3T2jazXzi51LxEyLlvxDPT5xOHI+aMRUjtWX6gTcEv7SeBFp69N624p0/LGl0 q68J18NipVxcKUwYvSGWpOnrMx4ygyR7J4OdkaDvpWhSP4FFSPVxsF0Wh3DqrGdA19EW MNj7DBWtGxTazIMywWvm+RTig03rjoBzUL6T4wxQmH5jZBhe8jUGzjD9vYOlV3C34OqX YtJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 bg3-v6si3001807plb.118.2018.04.12.04.13.09; Thu, 12 Apr 2018 04:13:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752853AbeDLLNJ (ORCPT + 11 others); Thu, 12 Apr 2018 07:13:09 -0400 Received: from foss.arm.com ([217.140.101.70]:59526 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752125AbeDLLNI (ORCPT ); Thu, 12 Apr 2018 07:13:08 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 90DBE80D; Thu, 12 Apr 2018 04:13:08 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id EA51E3F24A; Thu, 12 Apr 2018 04:13:06 -0700 (PDT) From: Mark Rutland To: stable@vger.kernel.org Cc: mark.brown@linaro.org, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, will.deacon@arm.com, catalin.marinas@arm.com, ghackmann@google.com, shankerd@codeaurora.org Subject: [PATCH v4.9.y 24/42] arm64: cpu_errata: Allow an erratum to be match for all revisions of a core Date: Thu, 12 Apr 2018 12:11:20 +0100 Message-Id: <20180412111138.40990-25-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180412111138.40990-1-mark.rutland@arm.com> References: <20180412111138.40990-1-mark.rutland@arm.com> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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: Mark Rutland [v4.9 backport] --- arch/arm64/kernel/cpu_errata.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.11.0 diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index 3884c4398597..b9fcbd155df2 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -127,6 +127,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) || \