All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: Enable I$/D$/BrPredict based on config
@ 2012-05-03 21:00 Bryan Buckley
  2012-05-03 22:23 ` Måns Rullgård
  2012-05-03 22:51 ` Russell King - ARM Linux
  0 siblings, 2 replies; 7+ messages in thread
From: Bryan Buckley @ 2012-05-03 21:00 UTC (permalink / raw)
  To: linux-arm-kernel

Currently we only disable these bits based on config. Now we will
use this config option to explicitly enable these features at this
point regardless of what bootloader, other SW, or HW did before.

Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
---
 arch/arm/kernel/head.S |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 3bf0c7f..cec0de5 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -411,12 +411,18 @@ __enable_mmu:
 #endif
 #ifdef CONFIG_CPU_DCACHE_DISABLE
 	bic	r0, r0, #CR_C
+#else
+	orr	r0, r0, #CR_C
 #endif
 #ifdef CONFIG_CPU_BPREDICT_DISABLE
 	bic	r0, r0, #CR_Z
+#else
+	orr	r0, r0, #CR_Z
 #endif
 #ifdef CONFIG_CPU_ICACHE_DISABLE
 	bic	r0, r0, #CR_I
+#else
+	orr	r0, r0, #CR_I
 #endif
 #ifdef CONFIG_ARM_LPAE
 	mov	r5, #0
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] ARM: Enable I$/D$/BrPredict based on config
  2012-05-03 21:00 [PATCH] ARM: Enable I$/D$/BrPredict based on config Bryan Buckley
@ 2012-05-03 22:23 ` Måns Rullgård
  2012-05-03 22:48   ` Buckley, Bryan
  2012-05-03 22:51 ` Russell King - ARM Linux
  1 sibling, 1 reply; 7+ messages in thread
From: Måns Rullgård @ 2012-05-03 22:23 UTC (permalink / raw)
  To: linux-arm-kernel

Bryan Buckley <bryan.buckley@ti.com> writes:

> Currently we only disable these bits based on config. Now we will
> use this config option to explicitly enable these features at this
> point regardless of what bootloader, other SW, or HW did before.
>
> Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
> ---
>  arch/arm/kernel/head.S |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
> index 3bf0c7f..cec0de5 100644
> --- a/arch/arm/kernel/head.S
> +++ b/arch/arm/kernel/head.S
> @@ -411,12 +411,18 @@ __enable_mmu:
>  #endif
>  #ifdef CONFIG_CPU_DCACHE_DISABLE
>  	bic	r0, r0, #CR_C
> +#else
> +	orr	r0, r0, #CR_C
>  #endif
>  #ifdef CONFIG_CPU_BPREDICT_DISABLE
>  	bic	r0, r0, #CR_Z
> +#else
> +	orr	r0, r0, #CR_Z
>  #endif
>  #ifdef CONFIG_CPU_ICACHE_DISABLE
>  	bic	r0, r0, #CR_I
> +#else
> +	orr	r0, r0, #CR_I
>  #endif
>  #ifdef CONFIG_ARM_LPAE
>  	mov	r5, #0
> -- 

Caches and branch predictors may require implementation defined
invalidation before being enabled.

-- 
M?ns Rullg?rd
mans at mansr.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: Enable I$/D$/BrPredict based on config
  2012-05-03 22:23 ` Måns Rullgård
@ 2012-05-03 22:48   ` Buckley, Bryan
  2012-05-03 22:52     ` Russell King - ARM Linux
  2012-05-03 22:57     ` Måns Rullgård
  0 siblings, 2 replies; 7+ messages in thread
From: Buckley, Bryan @ 2012-05-03 22:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 3, 2012 at 5:23 PM, M?ns Rullg?rd <mans@mansr.com> wrote:
>
> Bryan Buckley <bryan.buckley@ti.com> writes:
>
> > Currently we only disable these bits based on config. Now we will
> > use this config option to explicitly enable these features at this
> > point regardless of what bootloader, other SW, or HW did before.
> >
> > Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
> > ---
> > ?arch/arm/kernel/head.S | ? ?6 ++++++
> > ?1 files changed, 6 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
> > index 3bf0c7f..cec0de5 100644
> > --- a/arch/arm/kernel/head.S
> > +++ b/arch/arm/kernel/head.S
> > @@ -411,12 +411,18 @@ __enable_mmu:
> > ?#endif
> > ?#ifdef CONFIG_CPU_DCACHE_DISABLE
> > ? ? ? bic ? ? r0, r0, #CR_C
> > +#else
> > + ? ? orr ? ? r0, r0, #CR_C
> > ?#endif
> > ?#ifdef CONFIG_CPU_BPREDICT_DISABLE
> > ? ? ? bic ? ? r0, r0, #CR_Z
> > +#else
> > + ? ? orr ? ? r0, r0, #CR_Z
> > ?#endif
> > ?#ifdef CONFIG_CPU_ICACHE_DISABLE
> > ? ? ? bic ? ? r0, r0, #CR_I
> > +#else
> > + ? ? orr ? ? r0, r0, #CR_I
> > ?#endif
> > ?#ifdef CONFIG_ARM_LPAE
> > ? ? ? mov ? ? r5, #0
> > --
>
> Caches and branch predictors may require implementation defined
> invalidation before being enabled.
>

True.. I was relying on going through arch/arm/boot/compressed/head.S
to do that for me. Was that unreasonable?

> --
> M?ns Rullg?rd
> mans at mansr.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: Enable I$/D$/BrPredict based on config
  2012-05-03 21:00 [PATCH] ARM: Enable I$/D$/BrPredict based on config Bryan Buckley
  2012-05-03 22:23 ` Måns Rullgård
@ 2012-05-03 22:51 ` Russell King - ARM Linux
  1 sibling, 0 replies; 7+ messages in thread
From: Russell King - ARM Linux @ 2012-05-03 22:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 03, 2012 at 04:00:25PM -0500, Bryan Buckley wrote:
> Currently we only disable these bits based on config. Now we will
> use this config option to explicitly enable these features at this
> point regardless of what bootloader, other SW, or HW did before.

NAK.  r0 comes from the CPU specific file.  It is up to the CPU
specific support file to decide what setting is appropriate.  For
example, a CPU not implementing the I bit will require this bit to
be preserved, rather than being explicitly written as one or zero.

The ifdefs here are just disable-overrides for that, primerily to allow
testing of new CPUs.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: Enable I$/D$/BrPredict based on config
  2012-05-03 22:48   ` Buckley, Bryan
@ 2012-05-03 22:52     ` Russell King - ARM Linux
  2012-05-03 22:57     ` Måns Rullgård
  1 sibling, 0 replies; 7+ messages in thread
From: Russell King - ARM Linux @ 2012-05-03 22:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 03, 2012 at 05:48:33PM -0500, Buckley, Bryan wrote:
> On Thu, May 3, 2012 at 5:23 PM, M?ns Rullg?rd <mans@mansr.com> wrote:
> >
> > Bryan Buckley <bryan.buckley@ti.com> writes:
> >
> > > Currently we only disable these bits based on config. Now we will
> > > use this config option to explicitly enable these features at this
> > > point regardless of what bootloader, other SW, or HW did before.
> > >
> > > Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
> > > ---
> > > ?arch/arm/kernel/head.S | ? ?6 ++++++
> > > ?1 files changed, 6 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
> > > index 3bf0c7f..cec0de5 100644
> > > --- a/arch/arm/kernel/head.S
> > > +++ b/arch/arm/kernel/head.S
> > > @@ -411,12 +411,18 @@ __enable_mmu:
> > > ?#endif
> > > ?#ifdef CONFIG_CPU_DCACHE_DISABLE
> > > ? ? ? bic ? ? r0, r0, #CR_C
> > > +#else
> > > + ? ? orr ? ? r0, r0, #CR_C
> > > ?#endif
> > > ?#ifdef CONFIG_CPU_BPREDICT_DISABLE
> > > ? ? ? bic ? ? r0, r0, #CR_Z
> > > +#else
> > > + ? ? orr ? ? r0, r0, #CR_Z
> > > ?#endif
> > > ?#ifdef CONFIG_CPU_ICACHE_DISABLE
> > > ? ? ? bic ? ? r0, r0, #CR_I
> > > +#else
> > > + ? ? orr ? ? r0, r0, #CR_I
> > > ?#endif
> > > ?#ifdef CONFIG_ARM_LPAE
> > > ? ? ? mov ? ? r5, #0
> > > --
> >
> > Caches and branch predictors may require implementation defined
> > invalidation before being enabled.
> 
> True.. I was relying on going through arch/arm/boot/compressed/head.S
> to do that for me. Was that unreasonable?

Yes, because that may not always be used.

Where that _is_ dealt with is in the CPU specific setup assembly code,
just as providing the CPU specific default value for the CPU control
register in r0 is done.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: Enable I$/D$/BrPredict based on config
  2012-05-03 22:48   ` Buckley, Bryan
  2012-05-03 22:52     ` Russell King - ARM Linux
@ 2012-05-03 22:57     ` Måns Rullgård
  2012-05-03 22:58       ` Buckley, Bryan
  1 sibling, 1 reply; 7+ messages in thread
From: Måns Rullgård @ 2012-05-03 22:57 UTC (permalink / raw)
  To: linux-arm-kernel

"Buckley, Bryan" <bryan.buckley@ti.com> writes:

> On Thu, May 3, 2012 at 5:23 PM, M?ns Rullg?rd <mans@mansr.com> wrote:
>>
>> Bryan Buckley <bryan.buckley@ti.com> writes:
>>
>> > Currently we only disable these bits based on config. Now we will
>> > use this config option to explicitly enable these features at this
>> > point regardless of what bootloader, other SW, or HW did before.
>> >
>> > Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
>> > ---
>> > ?arch/arm/kernel/head.S | ? ?6 ++++++
>> > ?1 files changed, 6 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
>> > index 3bf0c7f..cec0de5 100644
>> > --- a/arch/arm/kernel/head.S
>> > +++ b/arch/arm/kernel/head.S
>> > @@ -411,12 +411,18 @@ __enable_mmu:
>> > ?#endif
>> > ?#ifdef CONFIG_CPU_DCACHE_DISABLE
>> > ? ? ? bic ? ? r0, r0, #CR_C
>> > +#else
>> > + ? ? orr ? ? r0, r0, #CR_C
>> > ?#endif
>> > ?#ifdef CONFIG_CPU_BPREDICT_DISABLE
>> > ? ? ? bic ? ? r0, r0, #CR_Z
>> > +#else
>> > + ? ? orr ? ? r0, r0, #CR_Z
>> > ?#endif
>> > ?#ifdef CONFIG_CPU_ICACHE_DISABLE
>> > ? ? ? bic ? ? r0, r0, #CR_I
>> > +#else
>> > + ? ? orr ? ? r0, r0, #CR_I
>> > ?#endif
>> > ?#ifdef CONFIG_ARM_LPAE
>> > ? ? ? mov ? ? r5, #0
>> > --
>>
>> Caches and branch predictors may require implementation defined
>> invalidation before being enabled.
>
> True.. I was relying on going through arch/arm/boot/compressed/head.S
> to do that for me. Was that unreasonable?

I'd be inclined to qualify that as "other SW."  It is possible to start
the kernel without using that code, even if it is not typically done.

-- 
M?ns Rullg?rd
mans at mansr.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: Enable I$/D$/BrPredict based on config
  2012-05-03 22:57     ` Måns Rullgård
@ 2012-05-03 22:58       ` Buckley, Bryan
  0 siblings, 0 replies; 7+ messages in thread
From: Buckley, Bryan @ 2012-05-03 22:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 3, 2012 at 5:57 PM, M?ns Rullg?rd <mans@mansr.com> wrote:
> "Buckley, Bryan" <bryan.buckley@ti.com> writes:
>
>> On Thu, May 3, 2012 at 5:23 PM, M?ns Rullg?rd <mans@mansr.com> wrote:
>>>
>>> Bryan Buckley <bryan.buckley@ti.com> writes:
>>>
>>> > Currently we only disable these bits based on config. Now we will
>>> > use this config option to explicitly enable these features at this
>>> > point regardless of what bootloader, other SW, or HW did before.
>>> >
>>> > Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
>>> > ---
>>> > ?arch/arm/kernel/head.S | ? ?6 ++++++
>>> > ?1 files changed, 6 insertions(+), 0 deletions(-)
>>> >
>>> > diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
>>> > index 3bf0c7f..cec0de5 100644
>>> > --- a/arch/arm/kernel/head.S
>>> > +++ b/arch/arm/kernel/head.S
>>> > @@ -411,12 +411,18 @@ __enable_mmu:
>>> > ?#endif
>>> > ?#ifdef CONFIG_CPU_DCACHE_DISABLE
>>> > ? ? ? bic ? ? r0, r0, #CR_C
>>> > +#else
>>> > + ? ? orr ? ? r0, r0, #CR_C
>>> > ?#endif
>>> > ?#ifdef CONFIG_CPU_BPREDICT_DISABLE
>>> > ? ? ? bic ? ? r0, r0, #CR_Z
>>> > +#else
>>> > + ? ? orr ? ? r0, r0, #CR_Z
>>> > ?#endif
>>> > ?#ifdef CONFIG_CPU_ICACHE_DISABLE
>>> > ? ? ? bic ? ? r0, r0, #CR_I
>>> > +#else
>>> > + ? ? orr ? ? r0, r0, #CR_I
>>> > ?#endif
>>> > ?#ifdef CONFIG_ARM_LPAE
>>> > ? ? ? mov ? ? r5, #0
>>> > --
>>>
>>> Caches and branch predictors may require implementation defined
>>> invalidation before being enabled.
>>
>> True.. I was relying on going through arch/arm/boot/compressed/head.S
>> to do that for me. Was that unreasonable?
>
> I'd be inclined to qualify that as "other SW." ?It is possible to start
> the kernel without using that code, even if it is not typically done.
>

haha, yeah me too.

Thanks M?ns and Russel.

> --
> M?ns Rullg?rd
> mans at mansr.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-05-03 22:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-03 21:00 [PATCH] ARM: Enable I$/D$/BrPredict based on config Bryan Buckley
2012-05-03 22:23 ` Måns Rullgård
2012-05-03 22:48   ` Buckley, Bryan
2012-05-03 22:52     ` Russell King - ARM Linux
2012-05-03 22:57     ` Måns Rullgård
2012-05-03 22:58       ` Buckley, Bryan
2012-05-03 22:51 ` Russell King - ARM Linux

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.