Re: [PATCH v3 0/1] arm64: Add workaround for Fujitsu A64FX erratum 010001

From: Will Deacon
Date: Wed Feb 13 2019 - 08:19:14 EST


On Tue, Feb 05, 2019 at 01:32:07PM +0000, Zhang, Lei wrote:
> > -----Original Message-----
> > From: linux-arm-kernel
> > [mailto:linux-arm-kernel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of
> > Will Deacon
> > Sent: Friday, February 01, 2019 7:52 PM
> > To: Zhang, Lei
> > Cc: 'Mark Rutland'; 'Catalin Marinas'; 'James Morse';
> > 'linux-kernel@xxxxxxxxxxxxxxx';
> > 'linux-arm-kernel@xxxxxxxxxxxxxxxxxxx'
> > Subject: Re: [PATCH v3 0/1] arm64: Add workaround for Fujitsu A64FX
> > erratum 010001
>
> > So I guess we should boot with NFD1 clear, and then set it only when we
> > realise we're not on an A64FX?
>
> In my patch, I do similar things at __cpu_setup which we
> set NFD1=1 on all processors except A64FX.
>
> Do you mean we would better to change the place where we
> set/clear NFD1?

Yes, I think we should keep the code as simple as we can:

- Don't set NFDx=1 in proc.S for any CPU
- Later, in C code, we can set the bit for any CPU that is not an affected
A64FX (this can be a simple MIDR check).

Does that work?

Will