Skip to contentSkip to conversation

Build error: versatile express

PATCH Nicolas Pitre 4 participants 6 messages Aug 12, 2013 – Aug 15, 2013 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 9 lines · Dave Martin
Quoted 5 lines · Russell King - ARM Linux

arch/arm/mach-vexpress/tc2_pm.c: In function 'tc2_pm_down.clone.0':
arch/arm/mach-vexpress/tc2_pm.c:200:1: error: fp cannot be used in asm here

This is caused by the assembly code in this file clobbering R11, which is incompatible with having CONFIG_FRAME_POINTER=y.

Is there any reason not to fix this just by pushing/popping r11 inside the asm and removing it from the clobber list?

That's most likely the best fix. What about this?

---- >8

From: Nicolas Pitre <[email protected]>
Date: Mon, 12 Aug 2013 12:47:13 -0400
Subject: [PATCH] ARM: vexpress/MCPM: fix cache disable sequence when
CONFIG_FRAME_POINTER=y

If CONFIG_FRAME_POINTER=y we hget the following error:

arch/arm/mach-vexpress/tc2_pm.c: In function 'tc2_pm_down':
arch/arm/mach-vexpress/tc2_pm.c:200:1: error: fp cannot be used in asm here

Let's fix that by explicitly preserving r11 on the stack and removing it from the clobber list.

arch/arm/mach-vexpress/dcscb.c +12 -4
index 85fffa702f..3a6384c6c4 100644
@@ -144,8 +144,13 @@ static void dcscb_power_down(void)
 		 * Let's do it in the safest possible way i.e. with
 		 * no memory access within the following sequence
 		 * including to the stack.
+		 *
+		 * Note: fp is preserved to the stack explicitly prior doing
+		 * this since adding it to the clobber list is incompatible
+		 * with having CONFIG_FRAME_POINTER=y.
 		 */
 		asm volatile(
+		"str	fp, [sp, #-4]! \n\t"
 		"mrc	p15, 0, r0, c1, c0, 0	@ get CR \n\t"
 		"bic	r0, r0, #"__stringify(CR_C)" \n\t"
 		"mcr	p15, 0, r0, c1, c0, 0	@ set CR \n\t"
@@ -156,9 +161,10 @@ static void dcscb_power_down(void)
 		"bic	r0, r0, #(1 << 6)	@ disable local coherency \n\t"
 		"mcr	p15, 0, r0, c1, c0, 1	@ set AUXCR \n\t"
 		"isb	\n\t"
-		"dsb	"
+		"dsb	\n\t"
+		"ldr	fp, [sp], #4"
 		: : : "r0","r1","r2","r3","r4","r5","r6","r7",
-		      "r9","r10","r11","lr","memory");
+		      "r9","r10","lr","memory");
 
 		/*
 		 * This is a harmless no-op.  On platforms with a real
@@ -182,6 +188,7 @@ static void dcscb_power_down(void)
 		 * Let's do it in the safest possible way as above.
 		 */
 		asm volatile(
+		"str	fp, [sp, #-4]! \n\t"
 		"mrc	p15, 0, r0, c1, c0, 0	@ get CR \n\t"
 		"bic	r0, r0, #"__stringify(CR_C)" \n\t"
 		"mcr	p15, 0, r0, c1, c0, 0	@ set CR \n\t"
@@ -192,9 +199,10 @@ static void dcscb_power_down(void)
 		"bic	r0, r0, #(1 << 6)	@ disable local coherency \n\t"
 		"mcr	p15, 0, r0, c1, c0, 1	@ set AUXCR \n\t"
 		"isb	\n\t"
-		"dsb	"
+		"dsb	\n\t"
+		"ldr	fp, [sp], #4"
 		: : : "r0","r1","r2","r3","r4","r5","r6","r7",
-		      "r9","r10","r11","lr","memory");
+		      "r9","r10","lr","memory");
 	}
 
 	__mcpm_cpu_down(cpu, cluster);
arch/arm/mach-vexpress/tc2_pm.c +12 -4
index dfb55d45b6..9419b1550a 100644
@@ -139,8 +139,13 @@ static void tc2_pm_down(u64 residency)
 		 * Let's do it in the safest possible way i.e. with
 		 * no memory access within the following sequence
 		 * including the stack.
+		 *
+		 * Note: fp is preserved to the stack explicitly prior doing
+		 * this since adding it to the clobber list is incompatible
+		 * with having CONFIG_FRAME_POINTER=y.
 		 */
 		asm volatile(
+		"str	fp, [sp, #-4]! \n\t"
 		"mrc	p15, 0, r0, c1, c0, 0	@ get CR \n\t"
 		"bic	r0, r0, #"__stringify(CR_C)" \n\t"
 		"mcr	p15, 0, r0, c1, c0, 0	@ set CR \n\t"
@@ -151,9 +156,10 @@ static void tc2_pm_down(u64 residency)
 		"bic	r0, r0, #(1 << 6)	@ disable local coherency \n\t"
 		"mcr	p15, 0, r0, c1, c0, 1	@ set AUXCR \n\t"
 		"isb	\n\t"
-		"dsb	"
+		"dsb	\n\t"
+		"ldr	fp, [sp], #4"
 		: : : "r0","r1","r2","r3","r4","r5","r6","r7",
-		      "r9","r10","r11","lr","memory");
+		      "r9","r10","lr","memory");
 
 		cci_disable_port_by_cpu(mpidr);
 
@@ -174,6 +180,7 @@ static void tc2_pm_down(u64 residency)
 		 * Let's do it in the safest possible way as above.
 		 */
 		asm volatile(
+		"str	fp, [sp, #-4]! \n\t"
 		"mrc	p15, 0, r0, c1, c0, 0	@ get CR \n\t"
 		"bic	r0, r0, #"__stringify(CR_C)" \n\t"
 		"mcr	p15, 0, r0, c1, c0, 0	@ set CR \n\t"
@@ -184,9 +191,10 @@ static void tc2_pm_down(u64 residency)
 		"bic	r0, r0, #(1 << 6)	@ disable local coherency \n\t"
 		"mcr	p15, 0, r0, c1, c0, 1	@ set AUXCR \n\t"
 		"isb	\n\t"
-		"dsb	"
+		"dsb	\n\t"
+		"ldr	fp, [sp], #4"
 		: : : "r0","r1","r2","r3","r4","r5","r6","r7",
-		      "r9","r10","r11","lr","memory");
+		      "r9","r10","lr","memory");
 	}
 
 	__mcpm_cpu_down(cpu, cluster);
Quoted 15 lines

Since there are no "m" constraints or similar, there should be no implicit references to fp or sp inside the asm which would be disrupted by that.

We could #ifdef it on CONFIG_FRAME_POINTER, but that probably just uglifies the code for no real benefit.

FRAME_POINTER depends on !THUMB2_KERNEL, so we shouldn't hit the same issue with r7 in Thumb-2.

Cheers
---Dave

#2 lore raw
Quoted 23 lines · Nicolas Pitre
Quoted 9 lines · Dave Martin
Quoted 5 lines · Russell King - ARM Linux

arch/arm/mach-vexpress/tc2_pm.c: In function 'tc2_pm_down.clone.0':
arch/arm/mach-vexpress/tc2_pm.c:200:1: error: fp cannot be used in asm here

This is caused by the assembly code in this file clobbering R11, which is incompatible with having CONFIG_FRAME_POINTER=y.

Is there any reason not to fix this just by pushing/popping r11 inside the asm and removing it from the clobber list?

That's most likely the best fix. What about this?

---- >8

From: Nicolas Pitre <[email protected]>
Date: Mon, 12 Aug 2013 12:47:13 -0400
Subject: [PATCH] ARM: vexpress/MCPM: fix cache disable sequence when
CONFIG_FRAME_POINTER=y

If CONFIG_FRAME_POINTER=y we hget the following error:

Quoted 7 lines

arch/arm/mach-vexpress/tc2_pm.c: In function 'tc2_pm_down':
arch/arm/mach-vexpress/tc2_pm.c:200:1: error: fp cannot be used in asm here

Let's fix that by explicitly preserving r11 on the stack and removing it from the clobber list.

                             ^^^^^^^^^^^^^^^^^^^^^^

rmk+kernel at arm.linux.org.uk please

#3 lore raw
Quoted 27 lines · Russell King - ARM Linux
Quoted 26 lines · Nicolas Pitre
Quoted 9 lines · Dave Martin
Quoted 5 lines · Russell King - ARM Linux

arch/arm/mach-vexpress/tc2_pm.c: In function 'tc2_pm_down.clone.0':
arch/arm/mach-vexpress/tc2_pm.c:200:1: error: fp cannot be used in asm here

This is caused by the assembly code in this file clobbering R11, which is incompatible with having CONFIG_FRAME_POINTER=y.

Is there any reason not to fix this just by pushing/popping r11 inside the asm and removing it from the clobber list?

That's most likely the best fix. What about this?

---- >8

From: Nicolas Pitre <[email protected]>
Date: Mon, 12 Aug 2013 12:47:13 -0400
Subject: [PATCH] ARM: vexpress/MCPM: fix cache disable sequence when
CONFIG_FRAME_POINTER=y

If CONFIG_FRAME_POINTER=y we hget the following error:

arch/arm/mach-vexpress/tc2_pm.c: In function 'tc2_pm_down':
arch/arm/mach-vexpress/tc2_pm.c:200:1: error: fp cannot be used in asm here

Quoted 6 lines
Quoted 4 lines

Let's fix that by explicitly preserving r11 on the stack and removing it from the clobber list.

                             ^^^^^^^^^^^^^^^^^^^^^^

rmk+kernel at arm.linux.org.uk please

Sure.

By default I simply picked up the email address the report was sent with.

Nicolas

Reviewed-by
#4 lore raw
In reply to Nicolas Pitre
Quoted 6 lines · Nicolas Pitre
Quoted 4 lines · Dave Martin
Quoted 3 lines · Russell King - ARM Linux

arch/arm/mach-vexpress/tc2_pm.c: In function 'tc2_pm_down.clone.0':
arch/arm/mach-vexpress/tc2_pm.c:200:1: error: fp cannot be used in asm here

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

This is caused by the assembly code in this file clobbering R11, which is incompatible with having CONFIG_FRAME_POINTER=y.

Is there any reason not to fix this just by pushing/popping r11 inside the asm and removing it from the clobber list?

That's most likely the best fix. What about this?

Were we replacing these instances with the macro, or is that still in flight?

Anyway, if useful:

Cheers
---Dave

Quoted 145 lines

---- >8

From: Nicolas Pitre <[email protected]>
Date: Mon, 12 Aug 2013 12:47:13 -0400
Subject: [PATCH] ARM: vexpress/MCPM: fix cache disable sequence when
CONFIG_FRAME_POINTER=y

If CONFIG_FRAME_POINTER=y we hget the following error:

arch/arm/mach-vexpress/tc2_pm.c: In function 'tc2_pm_down':
arch/arm/mach-vexpress/tc2_pm.c:200:1: error: fp cannot be used in asm here

Let's fix that by explicitly preserving r11 on the stack and removing it from the clobber list.

arch/arm/mach-vexpress/dcscb.c +12 -4
index 85fffa702f..3a6384c6c4 100644
@@ -144,8 +144,13 @@ static void dcscb_power_down(void)
 		 * Let's do it in the safest possible way i.e. with
 		 * no memory access within the following sequence
 		 * including to the stack.
+		 *
+		 * Note: fp is preserved to the stack explicitly prior doing
+		 * this since adding it to the clobber list is incompatible
+		 * with having CONFIG_FRAME_POINTER=y.
 		 */
 		asm volatile(
+		"str	fp, [sp, #-4]! \n\t"
 		"mrc	p15, 0, r0, c1, c0, 0	@ get CR \n\t"
 		"bic	r0, r0, #"__stringify(CR_C)" \n\t"
 		"mcr	p15, 0, r0, c1, c0, 0	@ set CR \n\t"
@@ -156,9 +161,10 @@ static void dcscb_power_down(void)
 		"bic	r0, r0, #(1 << 6)	@ disable local coherency \n\t"
 		"mcr	p15, 0, r0, c1, c0, 1	@ set AUXCR \n\t"
 		"isb	\n\t"
-		"dsb	"
+		"dsb	\n\t"
+		"ldr	fp, [sp], #4"
 		: : : "r0","r1","r2","r3","r4","r5","r6","r7",
-		      "r9","r10","r11","lr","memory");
+		      "r9","r10","lr","memory");
 
 		/*
 		 * This is a harmless no-op.  On platforms with a real
@@ -182,6 +188,7 @@ static void dcscb_power_down(void)
 		 * Let's do it in the safest possible way as above.
 		 */
 		asm volatile(
+		"str	fp, [sp, #-4]! \n\t"
 		"mrc	p15, 0, r0, c1, c0, 0	@ get CR \n\t"
 		"bic	r0, r0, #"__stringify(CR_C)" \n\t"
 		"mcr	p15, 0, r0, c1, c0, 0	@ set CR \n\t"
@@ -192,9 +199,10 @@ static void dcscb_power_down(void)
 		"bic	r0, r0, #(1 << 6)	@ disable local coherency \n\t"
 		"mcr	p15, 0, r0, c1, c0, 1	@ set AUXCR \n\t"
 		"isb	\n\t"
-		"dsb	"
+		"dsb	\n\t"
+		"ldr	fp, [sp], #4"
 		: : : "r0","r1","r2","r3","r4","r5","r6","r7",
-		      "r9","r10","r11","lr","memory");
+		      "r9","r10","lr","memory");
 	}
 
 	__mcpm_cpu_down(cpu, cluster);
arch/arm/mach-vexpress/tc2_pm.c +12 -4
index dfb55d45b6..9419b1550a 100644
@@ -139,8 +139,13 @@ static void tc2_pm_down(u64 residency)
 		 * Let's do it in the safest possible way i.e. with
 		 * no memory access within the following sequence
 		 * including the stack.
+		 *
+		 * Note: fp is preserved to the stack explicitly prior doing
+		 * this since adding it to the clobber list is incompatible
+		 * with having CONFIG_FRAME_POINTER=y.
 		 */
 		asm volatile(
+		"str	fp, [sp, #-4]! \n\t"
 		"mrc	p15, 0, r0, c1, c0, 0	@ get CR \n\t"
 		"bic	r0, r0, #"__stringify(CR_C)" \n\t"
 		"mcr	p15, 0, r0, c1, c0, 0	@ set CR \n\t"
@@ -151,9 +156,10 @@ static void tc2_pm_down(u64 residency)
 		"bic	r0, r0, #(1 << 6)	@ disable local coherency \n\t"
 		"mcr	p15, 0, r0, c1, c0, 1	@ set AUXCR \n\t"
 		"isb	\n\t"
-		"dsb	"
+		"dsb	\n\t"
+		"ldr	fp, [sp], #4"
 		: : : "r0","r1","r2","r3","r4","r5","r6","r7",
-		      "r9","r10","r11","lr","memory");
+		      "r9","r10","lr","memory");
 
 		cci_disable_port_by_cpu(mpidr);
 
@@ -174,6 +180,7 @@ static void tc2_pm_down(u64 residency)
 		 * Let's do it in the safest possible way as above.
 		 */
 		asm volatile(
+		"str	fp, [sp, #-4]! \n\t"
 		"mrc	p15, 0, r0, c1, c0, 0	@ get CR \n\t"
 		"bic	r0, r0, #"__stringify(CR_C)" \n\t"
 		"mcr	p15, 0, r0, c1, c0, 0	@ set CR \n\t"
@@ -184,9 +191,10 @@ static void tc2_pm_down(u64 residency)
 		"bic	r0, r0, #(1 << 6)	@ disable local coherency \n\t"
 		"mcr	p15, 0, r0, c1, c0, 1	@ set AUXCR \n\t"
 		"isb	\n\t"
-		"dsb	"
+		"dsb	\n\t"
+		"ldr	fp, [sp], #4"
 		: : : "r0","r1","r2","r3","r4","r5","r6","r7",
-		      "r9","r10","r11","lr","memory");
+		      "r9","r10","lr","memory");
 	}
 
 	__mcpm_cpu_down(cpu, cluster);
Quoted 11 lines

Since there are no "m" constraints or similar, there should be no implicit references to fp or sp inside the asm which would be disrupted by that.

We could #ifdef it on CONFIG_FRAME_POINTER, but that probably just uglifies the code for no real benefit.

Quoted 6 lines

FRAME_POINTER depends on !THUMB2_KERNEL, so we shouldn't hit the same issue with r7 in Thumb-2.

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#5 lore raw
Quoted 10 lines · Dave Martin
Quoted 9 lines · Nicolas Pitre
Quoted 7 lines · Dave Martin
Quoted 5 lines · Russell King - ARM Linux

arch/arm/mach-vexpress/tc2_pm.c: In function 'tc2_pm_down.clone.0':
arch/arm/mach-vexpress/tc2_pm.c:200:1: error: fp cannot be used in asm here

This is caused by the assembly code in this file clobbering R11, which is incompatible with having CONFIG_FRAME_POINTER=y.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Is there any reason not to fix this just by pushing/popping r11 inside the asm and removing it from the clobber list?

That's most likely the best fix. What about this?

Were we replacing these instances with the macro, or is that still in flight?

I've updated the macro patch accordingly. I prefer to submit that one separately.

Quoted 3 lines

Anyway, if useful:

Thanks.

Nicolas

#6 lore raw
Quoted 15 lines · Nicolas Pitre
Quoted 13 lines · Dave Martin
Quoted 12 lines · Nicolas Pitre
Quoted 9 lines · Dave Martin
Quoted 5 lines · Russell King - ARM Linux

arch/arm/mach-vexpress/tc2_pm.c: In function 'tc2_pm_down.clone.0':
arch/arm/mach-vexpress/tc2_pm.c:200:1: error: fp cannot be used in asm here

This is caused by the assembly code in this file clobbering R11, which is incompatible with having CONFIG_FRAME_POINTER=y.

Is there any reason not to fix this just by pushing/popping r11 inside the asm and removing it from the clobber list?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

That's most likely the best fix. What about this?

Were we replacing these instances with the macro, or is that still in flight?

I've updated the macro patch accordingly. I prefer to submit that one separately.

OK, sounds good

Cheers
---Dave

Quoted 14 lines
Quoted 4 lines

Anyway, if useful:

Thanks.

Nicolas

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel