[3/3] ARM: errata 430973: move !ARCH_MULTIPLATFORM to Kconfig
diff mbox

Message ID 1437612483-30160-4-git-send-email-sre@kernel.org
State New
Headers show

Commit Message

Sebastian Reichel July 23, 2015, 12:48 a.m. UTC
Having the !ARCH_MULTIPLATFORM dependency in the Kconfig file results
in one option less to think about when configuring the kernel.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 arch/arm/Kconfig      | 1 +
 arch/arm/mm/proc-v7.S | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Russell King - ARM Linux July 23, 2015, 12:35 p.m. UTC | #1
On Thu, Jul 23, 2015 at 02:48:03AM +0200, Sebastian Reichel wrote:
> Having the !ARCH_MULTIPLATFORM dependency in the Kconfig file results
> in one option less to think about when configuring the kernel.

> -#if defined(CONFIG_ARM_ERRATA_430973) && !defined(CONFIG_ARCH_MULTIPLATFORM)
> +#ifdef CONFIG_ARM_ERRATA_430973
>  	teq	r3, #0x00100000			@ only present in r1p*
>  	mrceq	p15, 0, r0, c1, c0, 1		@ read aux control register
>  	orreq	r0, r0, #(1 << 6)		@ set IBE to 1

NAK.  Please read the mailing list history, I'm not repeating myself
again on this.  Thanks.
Sebastian Reichel July 24, 2015, 12:16 a.m. UTC | #2
Hi Russel,

On Thu, Jul 23, 2015 at 01:35:53PM +0100, Russell King - ARM Linux wrote:
> On Thu, Jul 23, 2015 at 02:48:03AM +0200, Sebastian Reichel wrote:
> > Having the !ARCH_MULTIPLATFORM dependency in the Kconfig file results
> > in one option less to think about when configuring the kernel.
> 
> > -#if defined(CONFIG_ARM_ERRATA_430973) && !defined(CONFIG_ARCH_MULTIPLATFORM)
> > +#ifdef CONFIG_ARM_ERRATA_430973
> >  	teq	r3, #0x00100000			@ only present in r1p*
> >  	mrceq	p15, 0, r0, c1, c0, 1		@ read aux control register
> >  	orreq	r0, r0, #(1 << 6)		@ set IBE to 1
> 
> NAK.  Please read the mailing list history, I'm not repeating myself
> again on this.  Thanks.

It's a bit hard to search the mailing list history without a bit
more information.

I guess you prefer to just add the !ARCH_MULTIPLATFORM dependency to
the Kconfig entry without removing the additional check in the code?

-- Sebastian
Russell King - ARM Linux July 26, 2015, 10:51 p.m. UTC | #3
On Fri, Jul 24, 2015 at 02:16:06AM +0200, Sebastian Reichel wrote:
> Hi Russel,
> 
> On Thu, Jul 23, 2015 at 01:35:53PM +0100, Russell King - ARM Linux wrote:
> > On Thu, Jul 23, 2015 at 02:48:03AM +0200, Sebastian Reichel wrote:
> > > Having the !ARCH_MULTIPLATFORM dependency in the Kconfig file results
> > > in one option less to think about when configuring the kernel.
> > 
> > > -#if defined(CONFIG_ARM_ERRATA_430973) && !defined(CONFIG_ARCH_MULTIPLATFORM)
> > > +#ifdef CONFIG_ARM_ERRATA_430973
> > >  	teq	r3, #0x00100000			@ only present in r1p*
> > >  	mrceq	p15, 0, r0, c1, c0, 1		@ read aux control register
> > >  	orreq	r0, r0, #(1 << 6)		@ set IBE to 1
> > 
> > NAK.  Please read the mailing list history, I'm not repeating myself
> > again on this.  Thanks.
> 
> It's a bit hard to search the mailing list history without a bit
> more information.

You were Cc'd on the previous round of review...

> I guess you prefer to just add the !ARCH_MULTIPLATFORM dependency to
> the Kconfig entry without removing the additional check in the code?

I was referring to the above change.

However, having discussed with Will Deacon and checked the manuals, I
think the change is okay after all: the auxillary control register is
banked on secure parts, and the bit we'll be trying to change will be
read-only in non-secure mode - and importantly won't fault.

So, the change is fine, thanks.
Sebastian Reichel July 27, 2015, 1:14 a.m. UTC | #4
Hi,

On Sun, Jul 26, 2015 at 11:51:45PM +0100, Russell King - ARM Linux wrote:
> On Fri, Jul 24, 2015 at 02:16:06AM +0200, Sebastian Reichel wrote:
> > On Thu, Jul 23, 2015 at 01:35:53PM +0100, Russell King - ARM Linux wrote:
> > > On Thu, Jul 23, 2015 at 02:48:03AM +0200, Sebastian Reichel wrote:
> > > > Having the !ARCH_MULTIPLATFORM dependency in the Kconfig file results
> > > > in one option less to think about when configuring the kernel.
> > > 
> > > > -#if defined(CONFIG_ARM_ERRATA_430973) && !defined(CONFIG_ARCH_MULTIPLATFORM)
> > > > +#ifdef CONFIG_ARM_ERRATA_430973
> > > >  	teq	r3, #0x00100000			@ only present in r1p*
> > > >  	mrceq	p15, 0, r0, c1, c0, 1		@ read aux control register
> > > >  	orreq	r0, r0, #(1 << 6)		@ set IBE to 1
> > > 
> > > NAK.  Please read the mailing list history, I'm not repeating myself
> > > again on this.  Thanks.
> > 
> > It's a bit hard to search the mailing list history without a bit
> > more information.
> 
> You were Cc'd on the previous round of review...

But that discussion was about removing the check alltogether iirc.
This patch does not remove the !ARCH_MULTIPLATFORM check. It just
*moves* it from the sourcecode to the errata's Kconfig entry.

The intention was to hide the Kconfig option on multiplatform
kernels, since it's completely useless there after the N900
boardcode has been changed (PATCH 1/3).

> > I guess you prefer to just add the !ARCH_MULTIPLATFORM dependency to
> > the Kconfig entry without removing the additional check in the code?
> 
> I was referring to the above change.
>
> However, having discussed with Will Deacon and checked the manuals, I
> think the change is okay after all: the auxillary control register is
> banked on secure parts, and the bit we'll be trying to change will be
> read-only in non-secure mode - and importantly won't fault.
>
> So, the change is fine, thanks.

I think you missed the part adding the !ARCH_MULTIPLATFORM
dependency in Kconfig for ARM_ERRATA_430973. I only removed
the check in the sourcecode, since it is no longer required
with the dependency being in Kconfig.

So I guess there are 3 options now:

 1. Add !ARCH_MULTIPLATFORM dependency to Kconfig,
    keep extra check in the sourcecode
 2. Add !ARCH_MULTIPLATFORM dependency to Kconfig,
    remove extra check in the sourcecode
 3. Remove !ARCH_MULTIPLATFORM dependency alltogether

I will send an appropriate patch, if you tell me your preferred
option.

-- Sebastian
Ben Dooks July 27, 2015, 9:59 a.m. UTC | #5
On 27/07/15 02:14, Sebastian Reichel wrote:
> Hi,
> 
> On Sun, Jul 26, 2015 at 11:51:45PM +0100, Russell King - ARM Linux 
> wrote:
>> On Fri, Jul 24, 2015 at 02:16:06AM +0200, Sebastian Reichel 
>> wrote:
>>> On Thu, Jul 23, 2015 at 01:35:53PM +0100, Russell King - ARM 
>>> Linux wrote:
>>>> On Thu, Jul 23, 2015 at 02:48:03AM +0200, Sebastian Reichel 
>>>> wrote:
>>>>> Having the !ARCH_MULTIPLATFORM dependency in the Kconfig 
>>>>> file results in one option less to think about when 
>>>>> configuring the kernel.
>>>> 
>>>>> -#if defined(CONFIG_ARM_ERRATA_430973) && 
>>>>> !defined(CONFIG_ARCH_MULTIPLATFORM) +#ifdef 
>>>>> CONFIG_ARM_ERRATA_430973 teq	r3, #0x00100000			@ only 
>>>>> present in r1p* mrceq	p15, 0, r0, c1, c0, 1		@ read aux 
>>>>> control register orreq	r0, r0, #(1 << 6)		@ set IBE to 1
>>>> 
>>>> NAK.  Please read the mailing list history, I'm not
>>>> repeating myself again on this.  Thanks.
>>> 
>>> It's a bit hard to search the mailing list history without a 
>>> bit more information.
>> 
>> You were Cc'd on the previous round of review...
> 
> But that discussion was about removing the check alltogether iirc.
>  This patch does not remove the !ARCH_MULTIPLATFORM check. It just
>  *moves* it from the sourcecode to the errata's Kconfig entry.
> 
> The intention was to hide the Kconfig option on multiplatform 
> kernels, since it's completely useless there after the N900 
> boardcode has been changed (PATCH 1/3).
> 
>>> I guess you prefer to just add the !ARCH_MULTIPLATFORM 
>>> dependency to the Kconfig entry without removing the
>>> additional check in the code?
>> 
>> I was referring to the above change.
>> 
>> However, having discussed with Will Deacon and checked the 
>> manuals, I think the change is okay after all: the auxillary 
>> control register is banked on secure parts, and the bit we'll be 
>> trying to change will be read-only in non-secure mode - and 
>> importantly won't fault.
>> 
>> So, the change is fine, thanks.
> 
> I think you missed the part adding the !ARCH_MULTIPLATFORM 
> dependency in Kconfig for ARM_ERRATA_430973. I only removed the 
> check in the sourcecode, since it is no longer required with the 
> dependency being in Kconfig.
> 
> So I guess there are 3 options now:
> 
> 1. Add !ARCH_MULTIPLATFORM dependency to Kconfig, keep extra check 
> in the sourcecode 2. Add !ARCH_MULTIPLATFORM dependency to Kconfig,
> remove extra check in the sourcecode 3. Remove !ARCH_MULTIPLATFORM
> dependency alltogether
> 
> I will send an appropriate patch, if you tell me your preferred 
> option.

This isn't the only place ARM_ERRATA_430973 is used, and if
you make it configurable on !ARCH_MULTIPLATFORM then it makes
it impossible to use a ARCH_MULTIPLATFORM kernel on something
that is an Cortex-A8.

See arch/arm/mm/proc-v7-2level.S
Russell King - ARM Linux July 27, 2015, 10:43 a.m. UTC | #6
On Mon, Jul 27, 2015 at 10:59:56AM +0100, Ben Dooks wrote:
> This isn't the only place ARM_ERRATA_430973 is used, and if
> you make it configurable on !ARCH_MULTIPLATFORM then it makes
> it impossible to use a ARCH_MULTIPLATFORM kernel on something
> that is an Cortex-A8.
> 
> See arch/arm/mm/proc-v7-2level.S

That has been fixed so that the BTAC/BTB always gets flushed on each
context switch for all Cortex-A8 CPUs, but none of the other v7 CPUs.
Sebastian Reichel July 27, 2015, 5:36 p.m. UTC | #7
Hi Ben,

On Mon, Jul 27, 2015 at 10:59:56AM +0100, Ben Dooks wrote:
> > I think you missed the part adding the !ARCH_MULTIPLATFORM 
> > dependency in Kconfig for ARM_ERRATA_430973. I only removed the 
> > check in the sourcecode, since it is no longer required with the 
> > dependency being in Kconfig.
> > 
> > So I guess there are 3 options now:
> > 
> > 1. Add !ARCH_MULTIPLATFORM dependency to Kconfig, keep extra check 
> > in the sourcecode 2. Add !ARCH_MULTIPLATFORM dependency to Kconfig,
> > remove extra check in the sourcecode 3. Remove !ARCH_MULTIPLATFORM
> > dependency alltogether
> > 
> > I will send an appropriate patch, if you tell me your preferred 
> > option.
> 
> This isn't the only place ARM_ERRATA_430973 is used, [...]

The dependency on ARM_ERRATA_430973 has been removed from
arch/arm/mm/proc-v7-2level.S in 4.1 (commit id e748994), so
that it always flushes. The only additional places are in the
Nokia N900 boardcode and the N900 pdata-quirk, which are
removed in PATCH 1/3.

So actually it is the only place.

-- Sebastian

Patch
diff mbox

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0e4929b..f0e2d92 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1066,6 +1066,7 @@  config ARM_ERRATA_411920
 config ARM_ERRATA_430973
 	bool "ARM errata: Stale prediction on replaced interworking branch"
 	depends on CPU_V7
+	depends on !ARCH_MULTIPLATFORM
 	help
 	  This option enables the workaround for the 430973 Cortex-A8
 	  r1p* erratum. If a code sequence containing an ARM/Thumb
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 0716bbe..494e844 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -294,7 +294,7 @@  __v7_ca17mp_setup:
  *  r9: MIDR
  */
 __ca8_errata:
-#if defined(CONFIG_ARM_ERRATA_430973) && !defined(CONFIG_ARCH_MULTIPLATFORM)
+#ifdef CONFIG_ARM_ERRATA_430973
 	teq	r3, #0x00100000			@ only present in r1p*
 	mrceq	p15, 0, r0, c1, c0, 1		@ read aux control register
 	orreq	r0, r0, #(1 << 6)		@ set IBE to 1