Skip to contentSkip to conversation

ARM: NOMMU: Use instr_sync instead of plain isb in common code

PATCH New Vladimir Murzin 2 participants 3 messages Jun 18, 2018 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: NOMMU: Use instr_sync instead of plain isb in common code

Greg reported that commit 3c24121039c9d ("ARM: 8756/1: NOMMU: Postpone MPU activation till __after_proc_init") is causing breakage for the old Versatile platform in no-MMU mode (with out-of-tree patches):

AS arch/arm/kernel/head-nommu.o
arch/arm/kernel/head-nommu.S: Assembler messages:
arch/arm/kernel/head-nommu.S:180: Error: selected processor does not support `isb' in ARM mode scripts/Makefile.build:417: recipe for target 'arch/arm/kernel/head-nommu.o' failed make[2]: *** [arch/arm/kernel/head-nommu.o] Error 1
Makefile:1034: recipe for target 'arch/arm/kernel' failed
make[1]: *** [arch/arm/kernel] Error 2

Since the code is common for all NOMMU builds usage of the isb was a bad idea (please, note that isb also used in MPU related code which is fine because MPU has dependency on CPU_V7/CPU_V7M), instead use more robust instr_sync assembler macro.

Fixes 3c24121039c9 ("ARM: 8756/1: NOMMU: Postpone MPU activation till __after_proc_init")
---
 arch/arm/kernel/head-nommu.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/head-nommu.S +1 -1
index dd546d6..7a9b869 100644
@@ -177,7 +177,7 @@ M_CLASS(streq	r3, [r12, #PMSAv8_MAIR1])
 	bic	r0, r0, #CR_I
 #endif
 	mcr	p15, 0, r0, c1, c0, 0		@ write control reg
-	isb
+	instr_sync
 #elif defined (CONFIG_CPU_V7M)
 #ifdef CONFIG_ARM_MPU
 	ldreq	r3, [r12, MPU_CTRL]
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 ARM: NOMMU: Use instr_sync instead of plain isb in common code

Hi Vladimir,

Quoted 12 lines · Vladimir Murzin

Greg reported that commit 3c24121039c9d ("ARM: 8756/1: NOMMU: Postpone MPU activation till __after_proc_init") is causing breakage for the old Versatile platform in no-MMU mode (with out-of-tree patches):

AS arch/arm/kernel/head-nommu.o
arch/arm/kernel/head-nommu.S: Assembler messages:
arch/arm/kernel/head-nommu.S:180: Error: selected processor does not support `isb' in ARM mode scripts/Makefile.build:417: recipe for target 'arch/arm/kernel/head-nommu.o' failed make[2]: *** [arch/arm/kernel/head-nommu.o] Error 1
Makefile:1034: recipe for target 'arch/arm/kernel' failed
make[1]: *** [arch/arm/kernel] Error 2

Quoted 8 lines

Since the code is common for all NOMMU builds usage of the isb was a bad idea (please, note that isb also used in MPU related code which is fine because MPU has dependency on CPU_V7/CPU_V7M), instead use more robust instr_sync assembler macro.

Fixes 3c24121039c9 ("ARM: 8756/1: NOMMU: Postpone MPU activation till __after_proc_init")

Tested and working for me.

Thanks
Greg

Quoted 18 lines
---
  arch/arm/kernel/head-nommu.S | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/head-nommu.S +1 -1
index dd546d6..7a9b869 100644
@@ -177,7 +177,7 @@ M_CLASS(streq	r3, [r12, #PMSAv8_MAIR1])
  	bic	r0, r0, #CR_I
  #endif
  	mcr	p15, 0, r0, c1, c0, 0		@ write control reg
-	isb
+	instr_sync
  #elif defined (CONFIG_CPU_V7M)
  #ifdef CONFIG_ARM_MPU
  	ldreq	r3, [r12, MPU_CTRL]
#2 lore raw

PATCH 1/1 ARM: NOMMU: Use instr_sync instead of plain isb in common code

Hi Greg,

Quoted 20 lines · Greg Ungerer

Hi Vladimir,

Quoted 17 lines · Vladimir Murzin

Greg reported that commit 3c24121039c9d ("ARM: 8756/1: NOMMU: Postpone MPU activation till __after_proc_init") is causing breakage for the old Versatile platform in no-MMU mode (with out-of-tree patches):

?? AS????? arch/arm/kernel/head-nommu.o
arch/arm/kernel/head-nommu.S: Assembler messages:
arch/arm/kernel/head-nommu.S:180: Error: selected processor does not support `isb' in ARM mode scripts/Makefile.build:417: recipe for target 'arch/arm/kernel/head-nommu.o' failed make[2]: *** [arch/arm/kernel/head-nommu.o] Error 1
Makefile:1034: recipe for target 'arch/arm/kernel' failed
make[1]: *** [arch/arm/kernel] Error 2

Since the code is common for all NOMMU builds usage of the isb was a bad idea (please, note that isb also used in MPU related code which is fine because MPU has dependency on CPU_V7/CPU_V7M), instead use more robust instr_sync assembler macro.

Quoted 7 lines
Quoted 3 lines
Fixes 3c24121039c9 ("ARM: 8756/1: NOMMU: Postpone MPU activation till __after_proc_init")

Tested and working for me.

Great! It is in Russell's tracker now (patch 8775/1)

Cheers
Vladimir

Quoted 24 lines

Thanks
Greg

Quoted 18 lines

---
? arch/arm/kernel/head-nommu.S | 2 +-
? 1 file changed, 1 insertion(+), 1 deletion(-)

arch/arm/kernel/head-nommu.S +0 -0
index dd546d6..7a9b869 100644
@@ -177,7 +177,7 @@ M_CLASS(streq??? r3, [r12, #PMSAv8_MAIR1])

????? bic??? r0, r0, #CR_I
? #endif
????? mcr??? p15, 0, r0, c1, c0, 0??????? @ write control reg -??? isb
+??? instr_sync
? #elif defined (CONFIG_CPU_V7M)
? #ifdef CONFIG_ARM_MPU
????? ldreq??? r3, [r12, MPU_CTRL]