Skip to contentSkip to conversation

[4.14] arm/ipipe: Fix IPIPE_TRAP_UNDEFINSTR reporting

PATCH Applied Jan Kiszka 2 participants 3 messages Nov 30, 2018 – Dec 1, 2018 Arm (32-bit)

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 [4.14] arm/ipipe: Fix IPIPE_TRAP_UNDEFINSTR reporting

Something moved the value of this constant but didn't update the hard-coded instances. Fix this and avoid future problems by using the proper symbolic value.

That just requires harding asm/ipipe_base.h for assembly use.

---
 arch/arm/include/asm/ipipe_base.h | 6 ++++++
 arch/arm/kernel/entry-armv.S      | 5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)
arch/arm/include/asm/ipipe_base.h +6 -0
index 34de7a0402aa..3cf11a0242a2 100644
@@ -23,10 +23,14 @@
 #ifndef __ASM_ARM_IPIPE_BASE_H
 #define __ASM_ARM_IPIPE_BASE_H
 
+#ifndef __ASSEMBLY__
 #include <asm-generic/ipipe.h>
+#endif
 
 #ifdef CONFIG_IPIPE
 
+#ifndef __ASSEMBLY__
+
 #ifdef CONFIG_SMP
 
 extern unsigned __ipipe_first_ipi;
@@ -72,6 +76,8 @@ unsigned __ipipe_processor_id(void);
 #define ipipe_processor_id()  (0)
 #endif /* !CONFIG_IPIPE */
 
+#endif /* !__ASSEMBLY__ */
+
 #define IPIPE_TRAP_MAYDAY        0	/* Internal recovery trap */
 
 /* ARM traps */
arch/arm/kernel/entry-armv.S +3 -2
index 3569b3174372..311308e15485 100644
@@ -35,6 +35,7 @@
 #include "entry-header.S"
 #include <asm/entry-macro-multi.S>
 #include <asm/probes.h>
+#include <asm/ipipe_base.h>
 
 /*
  * Interrupt handling.
@@ -291,7 +292,7 @@ __und_svc:
 #endif
 
 #ifdef CONFIG_IPIPE
-	mov	r0, #7				@ r0 = IPIPE_TRAP_UNDEFINSTR
+	mov	r0, #IPIPE_TRAP_UNDEFINSTR
 	mov	r1, sp				@ r1 = &regs
 	bl	__ipipe_notify_trap		@ branch to trap handler
 	cmp	r0, #0
@@ -519,7 +520,7 @@ __und_usr:
 	usr_entry uaccess=0
 
 #ifdef CONFIG_IPIPE
-	mov	r0, #7				@ r0 = IPIPE_TRAP_UNDEFINSTR
+	mov	r0, #IPIPE_TRAP_UNDEFINSTR
 	mov	r1, sp				@ r1 = &regs
 	bl	__ipipe_notify_trap		@ branch to trap handler
 	cmp	r0, #0
Signature · 1 line
2.16.4
author
#1 lore raw
Quoted 8 lines · Jan Kiszka via Xenomai

Something moved the value of this constant but didn't update the hard-coded instances. Fix this and avoid future problems by using the proper symbolic value.

That just requires harding asm/ipipe_base.h for assembly use.

---

Just checked: This is a regression of 4.14 over previous versions.

Quoted 63 lines
  arch/arm/include/asm/ipipe_base.h | 6 ++++++
  arch/arm/kernel/entry-armv.S      | 5 +++--
  2 files changed, 9 insertions(+), 2 deletions(-)
arch/arm/include/asm/ipipe_base.h +6 -0
index 34de7a0402aa..3cf11a0242a2 100644
@@ -23,10 +23,14 @@
  #ifndef __ASM_ARM_IPIPE_BASE_H
  #define __ASM_ARM_IPIPE_BASE_H
 
+#ifndef __ASSEMBLY__
  #include <asm-generic/ipipe.h>
+#endif
 
  #ifdef CONFIG_IPIPE
 
+#ifndef __ASSEMBLY__
+
  #ifdef CONFIG_SMP
 
  extern unsigned __ipipe_first_ipi;
@@ -72,6 +76,8 @@ unsigned __ipipe_processor_id(void);
  #define ipipe_processor_id()  (0)
  #endif /* !CONFIG_IPIPE */
 
+#endif /* !__ASSEMBLY__ */
+
  #define IPIPE_TRAP_MAYDAY        0	/* Internal recovery trap */
 
  /* ARM traps */
arch/arm/kernel/entry-armv.S +3 -2
index 3569b3174372..311308e15485 100644
@@ -35,6 +35,7 @@
  #include "entry-header.S"
  #include <asm/entry-macro-multi.S>
  #include <asm/probes.h>
+#include <asm/ipipe_base.h>
 
  /*
   * Interrupt handling.
@@ -291,7 +292,7 @@ __und_svc:
  #endif
 
  #ifdef CONFIG_IPIPE
-	mov	r0, #7				@ r0 = IPIPE_TRAP_UNDEFINSTR
+	mov	r0, #IPIPE_TRAP_UNDEFINSTR
  	mov	r1, sp				@ r1 = &regs
  	bl	__ipipe_notify_trap		@ branch to trap handler
  	cmp	r0, #0
@@ -519,7 +520,7 @@ __und_usr:
  	usr_entry uaccess=0
 
  #ifdef CONFIG_IPIPE
-	mov	r0, #7				@ r0 = IPIPE_TRAP_UNDEFINSTR
+	mov	r0, #IPIPE_TRAP_UNDEFINSTR
  	mov	r1, sp				@ r1 = &regs
  	bl	__ipipe_notify_trap		@ branch to trap handler
  	cmp	r0, #0
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
#2 lore raw
Quoted 5 lines · Jan Kiszka
Quoted 4 lines · Jan Kiszka via Xenomai

Something moved the value of this constant but didn't update the hard-coded instances. Fix this and avoid future problems by using the proper symbolic value.

Quoted 7 lines
Quoted 4 lines

That just requires harding asm/ipipe_base.h for assembly use.

---

Just checked: This is a regression of 4.14 over previous versions.

Merged, thanks.

Signature · 1 line
Philippe.