From patchwork Thu Mar 1 12:53:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 10251257 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 79A2260365 for ; Thu, 1 Mar 2018 13:02:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59D432909D for ; Thu, 1 Mar 2018 13:02:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 587A52917B; Thu, 1 Mar 2018 13:02:20 +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 BD8742909D for ; Thu, 1 Mar 2018 13:01:33 +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=+lRBkIM79DBOAoDtHU1rFZmdza7B1aREsMfiuayebAQ=; b=Ha/yCb01AS9POx1HAD/jCRhMO+ 6i1C7KRvNugqAX0tVmq0CQNTUuuIzjHgIEHeUxolj4PZBcoD6zoVAGv0Mqdq92r+ThqT5CRlm6hsN Bdb8+tMeXDUv1GQR9SQmCCHQAxjSY/rRQbRHSEXD56INkSwvOcLDjsuqcBTtBauqyxUVyLBdrRSwi 16P1KrcfgoEHUCIiq0Y2md0r4EFhwMsdzvK8pE3sP0t68A11g/woeWYXqFVCiLf2CHhN+l/FODObl oJYgdBd66zerYHQHfTVN7swhm+ZLuRfB7iha0CBdYcGqkUIjmJel9FiGVtCXiAr08kpjIWtH5Cg3A p/KKzT7A==; 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 1erNpo-0005Wk-Q4; Thu, 01 Mar 2018 13:01:20 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1erNmS-00020O-0G for linux-arm-kernel@lists.infradead.org; Thu, 01 Mar 2018 12:59:09 +0000 Received: by mail-pg0-x244.google.com with SMTP id g12so2278218pgs.0 for ; Thu, 01 Mar 2018 04:57:41 -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=lZSZ7mN/jhpd6MgLblCtRDrj6c7/jUPbXNYPUP0WgH0=; b=WWRAREQNZkTXQj5ciNBE0dkrJL69J0JdIyRLXcqz7OZT7uyyh1Z/zDSrQ0hZsZ/Zcj b6rOPe5OsZKGydbdlCCV7gG6rIisfdWuLqM6JqN2tDuhwG5+aw0oUtbv8eSIberXbxV+ 0A4Fcs/aNaKYt3FmEFvQ8SLhQenFY4BmX18og= 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=lZSZ7mN/jhpd6MgLblCtRDrj6c7/jUPbXNYPUP0WgH0=; b=S7UNhm+l5IQPtKvA5cqcizYLkUYk9tn3ENjamSUE4NRK8qyqJaXz+DOSCExo7/BTB3 ESfQLDKdudFE/b9dxO6xFae3Rx4JGfVTdjr4BFpEcy9KTbl6yIf6T57FyfPWfBlPm9hI fqy9reunUC2re8IvNVPsmxyMIWhKJVF1OLfVEkVgA4lBb50XxjoizYtfof2jc96z/8MD jY7ytcER6S4cOw7C79zRC5Gg8c1H6WpWjFBtraNO/ni5fbBRu4OySBZ1fyCza3IYqbvJ sycSIWDa8UrJsYN7vRBItuoUh8eLItbOhh9AfEsywB3RcHCCPfpJG2Kjj0N8rCuA0237 QZkw== X-Gm-Message-State: APf1xPBXVebMcO5NM70HFa/+YrXD1KkYKbYY/6OJvnjE98PofrbGdmgu N4OZ/9lhktCjKw/lx9uUJCxamA== X-Google-Smtp-Source: AG47ELvCLlCbu2SFGoWQllLo+c8u9JqBaGr56FokdSXP0rJKlv7lXO43JZlQxIZVxDvvWybfTZTSYQ== X-Received: by 10.101.85.71 with SMTP id t7mr1482928pgr.386.1519909061117; Thu, 01 Mar 2018 04:57:41 -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.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Mar 2018 04:57:40 -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 19/45] arm64: cpu_errata: Allow an erratum to be match for all revisions of a core Date: Thu, 1 Mar 2018 20:53:56 +0800 Message-Id: <1519908862-11425-20-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_045752_875624_B05FD614 X-CRM114-Status: GOOD ( 12.39 ) 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: Alex Shi 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: 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) || \