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: 130198 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2762324edc; Thu, 1 Mar 2018 04:57:47 -0800 (PST) X-Google-Smtp-Source: AG47ELv6JrB8RiXiSw9/xLw93AD27UqOW6iGa1GtNn+jBC6IacxEQ0XuvkQJtdDBXord+Wk2voIP X-Received: by 10.98.14.70 with SMTP id w67mr1862247pfi.1.1519909067130; Thu, 01 Mar 2018 04:57:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519909067; cv=none; d=google.com; s=arc-20160816; b=dkmcUhmkN9Ne1Hm98Emht9IICnQ3weQ+2PyzJXgxnytTjeTrqLM9POAExjS4//5R9I lc55nOzAafjz5K0JdnQ5BJBswUplYB8FcI8a/J0yKwHrj8zrLvBz+tr4UJeyuan96M4D MlOQ+NBzAXpkm9dAwOVNeNRxFtwbd3fMS8wkI2qXFzemeJTB0NP8BiI8/qCFffD1HtP2 T33qNY6GJW0RpbozKYk0AFihjLuOq9LcLS/3QaiSQvdmAY1GC9h8Pa5vIL3nmwCwKUHH rhDk1S+5lUPViaSfoK7Oh/aI6bCZU0y6wzlHGIo2UE3rCUh8jagq80dZLxT7hxK3DWhp CktA== 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 m8si2431103pgc.663.2018.03.01.04.57.46; Thu, 01 Mar 2018 04:57:47 -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 S1030896AbeCAM5o (ORCPT + 28 others); Thu, 1 Mar 2018 07:57:44 -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(+) -- 2.7.4 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) || \