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: 9683139 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 544A860138 for ; Sun, 16 Apr 2017 20:28:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4290127B81 for ; Sun, 16 Apr 2017 20:28:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36C7B27CF3; Sun, 16 Apr 2017 20:28:58 +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 [65.50.211.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 AFE6C27B81 for ; Sun, 16 Apr 2017 20:28:57 +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=iqdULbc/mpYqrONySMlEZ24fraoyPe0vJ2IS7wsmZHE=; b=jjqb14J8rHfEVkfMhcgAoZxsVb oV9V8kST5NwfPc/FtQFikeypz1TFSGXDJy9peS34G5hRE5jRK1kOVis+8BFyNS3J6F2X3Ms60VI+n p2H214CROQ3X8DcGAi1H6+cziz22JNnEFASqfj/dRbP1Kc+2PCCMYN9Gue1zeYmypwHwTLdvbFQB8 FucdEBZF5RsTvTyXNpd/wJ2nMu4ppGLE8J3pXbgwlraAQBw3itpZll1v+YYZk06bNPEUxxDsBbwlj Oh77uOCrT7iBtUoRSvgxfoXExlLgrui52mPPWTMtc+LtU/zBixWRchutf6r8LrV23U951ZW201AkJ rtMWUGJA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1czqn3-00072U-84; Sun, 16 Apr 2017 20:28:57 +0000 Received: from mail-wr0-x234.google.com ([2a00:1450:400c:c0c::234]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1czqmK-0005sp-Nw for linux-arm-kernel@lists.infradead.org; Sun, 16 Apr 2017 20:28:16 +0000 Received: by mail-wr0-x234.google.com with SMTP id z109so74466353wrb.1 for ; Sun, 16 Apr 2017 13:27:55 -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=BUSj4zR9oT1dD4nbTOOmbUNzTUXiQbZFqLjcDzI/V/85jXqpzuVgc1RiiOnLDhwhwK cYE5GIM+GTm7yWEjwXXTZVefN1n9R1g1F2Dk/ZKUqDbw7tNixd5Z5YYC3q63YuXlSNl3 NV3q0d0E8MoOZ9Nz0UqB2niLpLKMGmMkhYS0OWPq2R9Cp0uS+BxwGP3BHZ8OmymTFvMO i04JGidjUllPLuVIASTbCIFX4nUJ5TsHEBteUJyGT/vZvp7lrA1GVLeaClO3DZS2FUOs kr0DEcU+lvlaEFDobJvrggskh+fT92RgWVUiglbvoXMPi8RWFmeEsE7Po8/Hwt/b/EoS YZag== X-Gm-Message-State: AN3rC/4i9PF/jbcZXb7QsIUd6uJCS1HRK33uM7vfxx/kSX7FiKadijQh RWPyUoJsVynTp37p 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170416_132813_278467_3350F396 X-CRM114-Status: GOOD ( 10.66 ) 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: Mark Rutland , Suzuki K Poulose , Marc Zyngier , Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, Robert Richter , James Morse , Christopher Covington , Andre Przywara , "moderated list:ARM64 PORT AARCH64 ARCHITECTURE" 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 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(+) 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) || \