diff mbox

[v2,1/2] ARM PJ4B: Add support for errata 4742

Message ID 20130604181030.GA18614@n2100.arm.linux.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Russell King - ARM Linux June 4, 2013, 6:10 p.m. UTC
On Tue, Jun 04, 2013 at 02:07:29PM -0400, Nicolas Pitre wrote:
> It could be nicer on the symbol table especially when debugging if the 
> pj4b was made into a separate branch table e.g.:
> 
> ENTRY(cpu_pj4b_switch_mm)
> 	b	cpu_v7_switch_mm
> ENDPROC(cpu_pj4b_switch_mm)
> 
> Otherwise the objdump output will always select the first symbol for any 
> given address in alphabetical order, masking away cpu_v7_switch_mm.

That adds unnecessary runtime expense.

> Alternatively, the following could be done:
> 
> #ifdef CONFIG_CPU_PJ4B
> 
> 	.equ	cpu_pj4b_switch_mm,	cpu_v7_switch_mm
> 	.equ	cpu_pj4b_set_pte_ex,	cpu_v7_set_pte_ex

No, that doesn't work.  I did forget a hunk from my patch though, which
needs the pj4b symbols to be global:

Comments

Nicolas Pitre June 4, 2013, 6:19 p.m. UTC | #1
On Tue, 4 Jun 2013, Russell King - ARM Linux wrote:

> On Tue, Jun 04, 2013 at 02:07:29PM -0400, Nicolas Pitre wrote:
> > Alternatively, the following could be done:
> > 
> > #ifdef CONFIG_CPU_PJ4B
> > 
> > 	.equ	cpu_pj4b_switch_mm,	cpu_v7_switch_mm
> > 	.equ	cpu_pj4b_set_pte_ex,	cpu_v7_set_pte_ex
> 
> No, that doesn't work.  I did forget a hunk from my patch though, which
> needs the pj4b symbols to be global:

	.macro globl_equ x, y
	.globl	x
	.equ	x, y
	.endm

	.globl_equ	cpu_pj4b_switch_mm,     cpu_v7_switch_mm
	.globl_equ	cpu_pj4b_set_pte_ex,	cpu_v7_set_pte_ex
	...


Nicolas
Russell King - ARM Linux June 4, 2013, 6:21 p.m. UTC | #2
On Tue, Jun 04, 2013 at 02:19:32PM -0400, Nicolas Pitre wrote:
> On Tue, 4 Jun 2013, Russell King - ARM Linux wrote:
> 
> > On Tue, Jun 04, 2013 at 02:07:29PM -0400, Nicolas Pitre wrote:
> > > Alternatively, the following could be done:
> > > 
> > > #ifdef CONFIG_CPU_PJ4B
> > > 
> > > 	.equ	cpu_pj4b_switch_mm,	cpu_v7_switch_mm
> > > 	.equ	cpu_pj4b_set_pte_ex,	cpu_v7_set_pte_ex
> > 
> > No, that doesn't work.  I did forget a hunk from my patch though, which
> > needs the pj4b symbols to be global:
> 
> 	.macro globl_equ x, y
> 	.globl	x
> 	.equ	x, y
> 	.endm
> 
> 	.globl_equ	cpu_pj4b_switch_mm,     cpu_v7_switch_mm
> 	.globl_equ	cpu_pj4b_set_pte_ex,	cpu_v7_set_pte_ex

Which is really no different from doing what I did.
Nicolas Pitre June 4, 2013, 6:32 p.m. UTC | #3
On Tue, 4 Jun 2013, Russell King - ARM Linux wrote:

> On Tue, Jun 04, 2013 at 02:19:32PM -0400, Nicolas Pitre wrote:
> > On Tue, 4 Jun 2013, Russell King - ARM Linux wrote:
> > 
> > > On Tue, Jun 04, 2013 at 02:07:29PM -0400, Nicolas Pitre wrote:
> > > > Alternatively, the following could be done:
> > > > 
> > > > #ifdef CONFIG_CPU_PJ4B
> > > > 
> > > > 	.equ	cpu_pj4b_switch_mm,	cpu_v7_switch_mm
> > > > 	.equ	cpu_pj4b_set_pte_ex,	cpu_v7_set_pte_ex
> > > 
> > > No, that doesn't work.  I did forget a hunk from my patch though, which
> > > needs the pj4b symbols to be global:
> > 
> > 	.macro globl_equ x, y
> > 	.globl	x
> > 	.equ	x, y
> > 	.endm
> > 
> > 	.globl_equ	cpu_pj4b_switch_mm,     cpu_v7_switch_mm
> > 	.globl_equ	cpu_pj4b_set_pte_ex,	cpu_v7_set_pte_ex
> 
> Which is really no different from doing what I did.

This can be wrapped inside #ifdef CONFIG_CPU_PJ4B clearing the symbol 
aliasing confusion I mentioned when not configured, and can be done in a 
single location instead of being spread all over.  Other than that, this 
is functionally equivalent to what you did indeed.


Nicolas
Gregory CLEMENT June 4, 2013, 7:04 p.m. UTC | #4
On 06/04/2013 08:32 PM, Nicolas Pitre wrote:
> On Tue, 4 Jun 2013, Russell King - ARM Linux wrote:
> 
>> On Tue, Jun 04, 2013 at 02:19:32PM -0400, Nicolas Pitre wrote:
>>> On Tue, 4 Jun 2013, Russell King - ARM Linux wrote:
>>>
>>>> On Tue, Jun 04, 2013 at 02:07:29PM -0400, Nicolas Pitre wrote:
>>>>> Alternatively, the following could be done:
>>>>>
>>>>> #ifdef CONFIG_CPU_PJ4B
>>>>>
>>>>> 	.equ	cpu_pj4b_switch_mm,	cpu_v7_switch_mm
>>>>> 	.equ	cpu_pj4b_set_pte_ex,	cpu_v7_set_pte_ex
>>>>
>>>> No, that doesn't work.  I did forget a hunk from my patch though, which
>>>> needs the pj4b symbols to be global:
>>>
>>> 	.macro globl_equ x, y
>>> 	.globl	x
>>> 	.equ	x, y
>>> 	.endm
>>>
>>> 	.globl_equ	cpu_pj4b_switch_mm,     cpu_v7_switch_mm
>>> 	.globl_equ	cpu_pj4b_set_pte_ex,	cpu_v7_set_pte_ex
>>
>> Which is really no different from doing what I did.
> 
> This can be wrapped inside #ifdef CONFIG_CPU_PJ4B clearing the symbol 
> aliasing confusion I mentioned when not configured, and can be done in a 
> single location instead of being spread all over.  Other than that, this 
> is functionally equivalent to what you did indeed.
> 
> 
Russell, Nicolas,

Thanks for both of you for help. As you both agree that your variants are functionally
equivalent and as the variant of Nicolas seems to be more easy to debug, I will
adopt Nicolas' version. Unless, there was a drawback you didn't mention yet.

Regards,

Gregory
diff mbox

Patch

diff --git a/arch/arm/include/asm/glue-proc.h b/arch/arm/include/asm/glue-proc.h
index ac1dd54..8017e94 100644
--- a/arch/arm/include/asm/glue-proc.h
+++ b/arch/arm/include/asm/glue-proc.h
@@ -230,6 +230,15 @@ 
 # endif
 #endif
 
+#ifdef CONFIG_CPU_PJ4B
+# ifdef CPU_NAME
+#  undef  MULTI_CPU
+#  define MULTI_CPU
+# else
+#  define CPU_NAME cpu_pj4b
+# endif
+#endif
+
 #ifndef MULTI_CPU
 #define cpu_proc_init			__glue(CPU_NAME,_proc_init)
 #define cpu_proc_fin			__glue(CPU_NAME,_proc_fin)