Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp367079img; Mon, 18 Mar 2019 05:07:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1iehR9sho1X1URqnqaIaPW4i01UTEkiG0QkckpGQLBAaG+DMhMoN8LriinYFmmCQ1vw/b X-Received: by 2002:a17:902:b618:: with SMTP id b24mr18714772pls.73.1552910824873; Mon, 18 Mar 2019 05:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552910824; cv=none; d=google.com; s=arc-20160816; b=QrT1qVtui/HxPbFWsqM1fwR+pr2HB444ZsRblRy8KbqtdBLWQKfSGP9PlLO84iGqid OcPNMyySJZXDscoESNJ5SQ2hGvL7MQmc3JN+JBzwtV4wOgpAFJ5EUBmcxu2o2C7tjbwV J7CyTU5EnYbWv0g8uGWt1AyxL+D2Y6SttuhRfjFRvPu01tJabbGwaBx4MVZa2FABFmo+ 2edqCNb7nvmwivga0dLysMcj64jEbF0OMv/pwC7a8kR5exSgxjQceHiQ4gIl8dCVlkAQ kp/HGbHGELEpuuvFb41nlzfFFJVgHlN9eNdYR9Ph9+UcskdMJdYGjNMiv03mTVTQgQPK 5YBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=m6hD2qT/+udUegYQUjSHnB+77tpi5THKW+wYk5CZwws=; b=MlUYkVoikrUivxgQTighdWUIvbRkcV2THcC0bQtjgJljX0nsBNLFMQUEYPkKUH7JeD 7Psmj77z9kRGQFF67ffzaG+3yM89kifRQFVkNIsXKOJSIb/QptyQwwGSyq8UEj3RPp2b PlDspTePQQ40KUoY4PqjKaMI5wdeUCA9AZJkFl3sUmu9WU3dgbg45zJ0MBljQFSeVVEe 8FYI8XtbD/+5bKLISxsIGJFXMCzZF5kI2vtEal480NNdac2VSOzvJEM7DkwPShWADi7h VlR4rNMCJOGxcKZWPumgVWnHMTjO2y5sL7+LIhsOW6BSONXRLHCZOnCw0d+0Ov3aXcaZ 8JQQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61si9310193plz.177.2019.03.18.05.06.49; Mon, 18 Mar 2019 05:07:04 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726935AbfCRMGN (ORCPT + 99 others); Mon, 18 Mar 2019 08:06:13 -0400 Received: from foss.arm.com ([217.140.101.70]:32918 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726504AbfCRMGN (ORCPT ); Mon, 18 Mar 2019 08:06:13 -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 BCCFD1650; Mon, 18 Mar 2019 05:06:12 -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 ESMTPSA id 64A7D3F614; Mon, 18 Mar 2019 05:06:11 -0700 (PDT) Date: Mon, 18 Mar 2019 12:06:06 +0000 From: Mark Rutland To: "Zhang, Lei" , Catalin Marinas Cc: "Okamoto, Takayuki" , Will Deacon , James Morse , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [RESEND PATCH] Make Fujitsu Erratum 010001 patch can be applied on A64FX v1r0 Message-ID: <20190318120454.GA3697@lakrids.cambridge.arm.com> References: <5FA513F682BE7F4EAAB8EE035D5B08E44E9363CC@G01JPEXMBKW02> <20190315151241.GC48314@lakrids.cambridge.arm.com> <8898674D84E3B24BA3A2D289B872026A6A35627D@G01JPEXMBKW03> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8898674D84E3B24BA3A2D289B872026A6A35627D@G01JPEXMBKW03> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 18, 2019 at 03:05:09AM +0000, Zhang, Lei wrote: > Thanks for your comments. > I also have considered to use MIDR_CPU_VAR_REV macro, > but the implication of (~MIDR_CPU_VAR_REV(1, 0)) is "NOT v1r0". > I think it may cause confusion, so I choose the > simple way (~(0x1 << MIDR_VARIANT_SHIFT)). I think that either way is just as confusing, and the fact we're assigning it to a mask (of bits to preserve) should make this clear. For consistency, I'd prefer to use MIDR_CPU_VAR_REV(). Catalin, are you happy to take the below as a fix for v5.1? Thanks, Mark. ---->8---- From 6439e9c0b1525e9d4c7be65552e6f2b1f9d1dbe0 Mon Sep 17 00:00:00 2001 From: "Okamoto, Takayuki" Date: Fri, 15 Mar 2019 12:22:36 +0000 Subject: [PATCH] arm64: apply workaround on A64FX v1r0 Fujitsu erratum 010001 applies to A64FX v0r0 and v1r0, and we try to handle either by masking MIDR with MIDR_FUJITSU_ERRATUM_010001_MASK before comparing it to MIDR_FUJITSU_ERRATUM_010001. Unfortunately, MIDR_FUJITSU_ERRATUM_010001 is constructed incorrectly using MIDR_VARIANT(), which is intended to extract the variant field from MIDR_EL1, rather than generate the field in-place. This results in MIDR_FUJITSU_ERRATUM_010001 being all-ones, and we only match A64FX v0r0. This patch uses MIDR_CPU_VAR_REV() to generate an in-place mask for the variant field, ensuring the we match both v0r0 and v1r0. Fixes: 3e32131abc311a5c ("arm64: Add workaround for Fujitsu A64FX erratum 010001") Signed-off-by: Zhang Lei [Mark: use MIDR_CPU_VAR_REV(), reword commit message] Signed-off-by: Mark Rutland --- arch/arm64/include/asm/cputype.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h index 2afb1338b48a..f3b659587a36 100644 --- a/arch/arm64/include/asm/cputype.h +++ b/arch/arm64/include/asm/cputype.h @@ -129,7 +129,7 @@ /* Fujitsu Erratum 010001 affects A64FX 1.0 and 1.1, (v0r0 and v1r0) */ #define MIDR_FUJITSU_ERRATUM_010001 MIDR_FUJITSU_A64FX -#define MIDR_FUJITSU_ERRATUM_010001_MASK (~MIDR_VARIANT(1)) +#define MIDR_FUJITSU_ERRATUM_010001_MASK (~MIDR_CPU_VAR_REV(1, 0)) #define TCR_CLEAR_FUJITSU_ERRATUM_010001 (TCR_NFD1 | TCR_NFD0) #ifndef __ASSEMBLY__ -- 2.11.0