Skip to contentSkip to conversation

cobalt/arch/arm: fptest: Add missing SIMD register clobbering

PATCH In review Jan Kiszka 2 participants 4 messages Oct 6, 2021 – Oct 8, 2021

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 cobalt/arch/arm: fptest: Add missing SIMD register clobbering

From: Jan Kiszka <[email protected]>

This caused troubles with modern gcc that starts to use those regs for other purposes. Seen with gcc-10 on Debian 11 e.g.

---
 kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h +6 -1
index b81d109933..d5c2c7515b 100644
@@ -32,7 +32,12 @@ static inline void fp_regs_set(int features, unsigned int val)
 		/* vldm %0!, {d0-d15},
 		   AKA fldmiax %0!, {d0-d15} */
 		__asm__ __volatile__("ldc p11, cr0, [%0],#32*4":
-				     "=r"(i): "0"(&e[0]): "memory");
+				     "=r"(i)
+				     : "0"(&e[0])
+				     : "d0", "d1", "d2", "d3", "d4", "d5",
+				       "d6", "d7", "d8", "d9", "d10", "d11",
+				       "d12", "d13", "d14", "d15",
+				       "memory");
 	}
 }
 
Signature · 1 line
2.31.1
#1 lore raw
Quoted 18 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

This caused troubles with modern gcc that starts to use those regs for other purposes. Seen with gcc-10 on Debian 11 e.g.

---
 kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h +0 -0
index b81d109933..d5c2c7515b 100644
@@ -32,7 +32,12 @@ static inline void fp_regs_set(int features, unsigned int val)
 		/* vldm %0!, {d0-d15},
 		   AKA fldmiax %0!, {d0-d15} */
 		__asm__ __volatile__("ldc p11, cr0, [%0],#32*4":

kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h static inline void fp_regs_set(int features, unsigned int val) · line 43

Quoted 10 lines
kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h +6 -1
-				     "=r"(i): "0"(&e[0]): "memory");
+				     "=r"(i)
+				     : "0"(&e[0])
+				     : "d0", "d1", "d2", "d3", "d4", "d5",
+				       "d6", "d7", "d8", "d9", "d10", "d11",
+				       "d12", "d13", "d14", "d15",
+				       "memory");
 	}
 }
 

Is that already applied to next? That should be one of the last missing pieces for porting xenomai-images to Debian 11.

The last unclear topic (AFAIR) is the ssh-key regeneration taking too long for some reason on ARM and Debian 11, but that should be a Debian specific issue and is hopefully not related to Xenomai itself.

author
#2 lore raw
Quoted 24 lines · Florian (T RDA IOT SES-DE)
Quoted 23 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

This caused troubles with modern gcc that starts to use those regs for other purposes. Seen with gcc-10 on Debian 11 e.g.

---
 kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h +4 -1
index b81d109933..d5c2c7515b 100644
@@ -32,7 +32,12 @@ static inline void fp_regs_set(int features, unsigned int val)
              /* vldm %0!, {d0-d15},
                 AKA fldmiax %0!, {d0-d15} */
              __asm__ __volatile__("ldc p11, cr0, [%0],#32*4":
-                                  "=r"(i): "0"(&e[0]): "memory");
+                                  "=r"(i)
+                                  : "0"(&e[0])
+                                  : "d0", "d1", "d2", "d3", "d4", "d5",
+                                    "d6", "d7", "d8", "d9", "d10", "d11",
Quoted 8 lines

kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h static inline void fp_regs_set(int features, unsigned int val) · line 43

Quoted 5 lines
kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h +2 -0
+                                    "d12", "d13", "d14", "d15",
+                                    "memory");
      }
 }
 

Is that already applied to next? That should be one of the last missing pieces for porting xenomai-images to Debian 11.

It's in next, right.

Quoted 5 lines

The last unclear topic (AFAIR) is the ssh-key regeneration taking too long for some reason on ARM and Debian 11, but that should be a Debian specific issue and is hopefully not related to Xenomai itself.

Right, now I recall. Interestingly, this does not show up on ARM (in QEMU) with the already ported jailhouse-images.

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#3 lore raw
Quoted 34 lines · Jan Kiszka
Quoted 24 lines · Florian (T RDA IOT SES-DE)
Quoted 23 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

This caused troubles with modern gcc that starts to use those regs for other purposes. Seen with gcc-10 on Debian 11 e.g.

---
 kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h +4 -1
index b81d109933..d5c2c7515b 100644
@@ -32,7 +32,12 @@ static inline void fp_regs_set(int features, unsigned int val)
              /* vldm %0!, {d0-d15},
                 AKA fldmiax %0!, {d0-d15} */
              __asm__ __volatile__("ldc p11, cr0, [%0],#32*4":
-                                  "=r"(i): "0"(&e[0]): "memory");
+                                  "=r"(i)
+                                  : "0"(&e[0])
+                                  : "d0", "d1", "d2", "d3", "d4", "d5",
+                                    "d6", "d7", "d8", "d9", "d10", "d11",
Quoted 8 lines

kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h static inline void fp_regs_set(int features, unsigned int val) · line 43

Quoted 5 lines
kernel/cobalt/arch/arm/include/asm/xenomai/uapi/fptest.h +2 -0
+                                    "d12", "d13", "d14", "d15",
+                                    "memory");
      }
 }
 

Is that already applied to next? That should be one of the last missing pieces for porting xenomai-images to Debian 11.

Quoted 1 line

It's in next, right.

Current CI shows me that this one qualifies for stable as well. Building stable with a recent gcc brings up the same issue.

Quoted 12 lines
Quoted 6 lines

The last unclear topic (AFAIR) is the ssh-key regeneration taking too long for some reason on ARM and Debian 11, but that should be a Debian specific issue and is hopefully not related to Xenomai itself.

Right, now I recall. Interestingly, this does not show up on ARM (in QEMU) with the already ported jailhouse-images.

Jan