Received: by 10.223.185.116 with SMTP id b49csp7392969wrg; Thu, 1 Mar 2018 04:59:05 -0800 (PST) X-Google-Smtp-Source: AG47ELvbcau9MCA00QkxU3vha51/cu9tXaXuebUMAosqvlWGLWTFWyHTRMw6ebTqvX+DV7Q5DlPj X-Received: by 10.98.224.65 with SMTP id f62mr1858967pfh.191.1519909145770; Thu, 01 Mar 2018 04:59:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519909145; cv=none; d=google.com; s=arc-20160816; b=XrBF1jTcA9o64h4xMAG/WWvvEX4CsSe1hzZQlMxMKhh1JBkVSFWHW748aoWPOALA6E yO3GUucXdOCx9h0KGu41fN9uOA7rW4f2/S7NTjx6cEswmzNpm3upn1mVoBkb0gC/Ixv8 hWgZAuVNfZb7uKD00PMfmMZftPqbJ/Jmo6YlIDy5VSuy8tu2VQPZW+u61JC6l8p71cJz cpmiiYx1X7hvbFdGPmtBTEZuuNoOo9hi2KHcnfxLBRt6AsOhjdZgI1B/15H0VZw7uqiT YbTgaUNUhWFhGpQJZmh1liUu3VMjdsXvcWfWRcRJEOvPHo7jciYsbaIP9mVI4q4tmycT v+QA== 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:dkim-signature:arc-authentication-results; bh=lZSZ7mN/jhpd6MgLblCtRDrj6c7/jUPbXNYPUP0WgH0=; b=izHA+q5YTSCd+eM2JJ+s56rs/9R3QITNyUHy0cTCaagSIg/4mt076NFNh75g2GM91M muANJHCBmY+4hZemAKpOG+4n6Nw4cBdaRGVIUX58hROej49AvU06LpukMa60wSbWg3SP 9rVEv2W83fz49idAq+B7Cgo+8SRjocYrCXI4L5uicktMCnzhJ7FeyvWsVXPweyiMwpp+ 95b2PkpSi/7Kk9tyQ+gn1k9mqXIIUpm9QgOfI9lWfw6t59ZmFeYzW2/qe8XgBfGBuWyo PD6fjA3eb0jFHVtsYIQW4jn5YMYAfYyPJuHwH/8RU9l4lZ+x3N559+An0Erq3STKOX10 u8ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WWRAREQN; 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 n10si49530pge.342.2018.03.01.04.58.50; Thu, 01 Mar 2018 04:59:05 -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=WWRAREQN; 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 S1030893AbeCAM5n (ORCPT + 99 others); Thu, 1 Mar 2018 07:57:43 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:40865 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030539AbeCAM5l (ORCPT ); Thu, 1 Mar 2018 07:57:41 -0500 Received: by mail-pg0-f65.google.com with SMTP id g2so2271374pgn.7 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=e15UZPn6XzR55JUGyOGwqQTg9vZpJs/GCEIqTwX5fkfJ1MJZy3fSQR7kDhZ5EvEOOq cZOjN0pFVJeSnw6steBgQ+n0MvN2mytn86wn2EGJWA5bkYgIrfrlks+t9IgCa1wychAi zwiL4ccReo7spszqzll6fzzm1VyRTNQaefmbNzS80LXNpATuT8xDb5FdoPjYkl9ZVvEb W0VyeU69pvnOSAy90WvRF91x6smNi1h1chgng3fRFiak9W/E3P/ORw4cDImsxuXPPDSR XjN+2467ejPK7qwj8AFfQ5HRh5DSl1SHfMXSS53sNHGNwbZucmBF1p4jliMKZH8DdJiN UwHA== X-Gm-Message-State: APf1xPArTweU8Qyyj5uE6s52QQUbWa9vDVHx3k0Jj31ynlOGJqdYHeE3 9GpOUwo7U18DaL++yhluzdDWEWRiuT8= 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 Cc: Alex Shi 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> 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