Skip to contentSkip to conversation

kernel: cobalt: Fix up elf_hwcap

PATCH In review Greg Gallagher 2 participants 8 messages Jan 27, 2021 – Feb 1, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 kernel: cobalt: Fix up elf_hwcap

Update elf_hwcap to ELF_HWCAP, this will work for newer 5.4 kernels

---
 kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h +1 -1
index b7e3f52f2..291c9e5f0 100644
@@ -23,7 +23,7 @@
 #include <asm/xenomai/uapi/fptest.h>
 #include <asm/hwcap.h>
 
-#define have_fp (elf_hwcap & HWCAP_FP)
+#define have_fp (ELF_HWCAP & HWCAP_FP)
 
 static inline int fp_kernel_supported(void)
 {
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 kernel: cobalt: Remove header file for newer kernels

5.4 kernels do not have compiler.h, only include this header file for kernels older then 5.4

---
 kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h | 4 ++++
 1 file changed, 4 insertions(+)
kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h +4 -0
index 7444cc823..17be10339 100644
@@ -29,7 +29,11 @@
 #define XNARCH_HOST_TICK_IRQ __ipipe_hrtimer_irq
 
 #include <asm/barrier.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
 #include <asm/compiler.h>
+#endif
+
 #include <asm/cmpxchg.h>
 #include <asm/switch_to.h>
 #include <asm/system_misc.h>
Signature · 1 line
2.25.1
#4 lore raw
In reply to Greg Gallagher
Quoted 2 lines · Greg Gallagher via Xenomai

Update elf_hwcap to ELF_HWCAP, this will work for newer 5.4 kernels

I assume you mean "also work" - or does it break on certain older kernels? Just asking before consulting our CI. ;)

Quoted 11 lines
---
 kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h +0 -0
index b7e3f52f2..291c9e5f0 100644

kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h line 29

Quoted 8 lines
kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h +1 -1
@@ -23,7 +23,7 @@
 #include <asm/xenomai/uapi/fptest.h>
 #include <asm/hwcap.h>
 
-#define have_fp (elf_hwcap & HWCAP_FP)
+#define have_fp (ELF_HWCAP & HWCAP_FP)
 
 static inline int fp_kernel_supported(void)
 {

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#2 lore raw

Re: [PATCH 2/2] kernel: cobalt: Remove header file for newer kernels

In reply to Greg Gallagher
Quoted 14 lines · Greg Gallagher via Xenomai

5.4 kernels do not have compiler.h, only include this header file for kernels older then 5.4

---
 kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h | 4 ++++
 1 file changed, 4 insertions(+)
kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h +0 -0
index 7444cc823..17be10339 100644
@@ -29,7 +29,11 @@
 #define XNARCH_HOST_TICK_IRQ __ipipe_hrtimer_irq

kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h line 39

Quoted 10 lines
kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h +4 -0
 
 #include <asm/barrier.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
 #include <asm/compiler.h>
+#endif
+
 #include <asm/cmpxchg.h>
 #include <asm/switch_to.h>
 #include <asm/system_misc.h>

How about fixing arm as well at this chance? Same pattern.

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#5 lore raw
In reply to Jan Kiszka
Quoted 7 lines · Jan Kiszka via Xenomai
Quoted 2 lines · Greg Gallagher via Xenomai

Update elf_hwcap to ELF_HWCAP, this will work for newer 5.4 kernels

I assume you mean "also work" - or does it break on certain older kernels? Just asking before consulting our CI. ;)

...and the same pattern exists on ARM.

Jan

Quoted 22 lines
Quoted 11 lines
---
 kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h +0 -0
index b7e3f52f2..291c9e5f0 100644

kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h line 29

Quoted 8 lines
kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h +1 -1
@@ -23,7 +23,7 @@
 #include <asm/xenomai/uapi/fptest.h>
 #include <asm/hwcap.h>
 
-#define have_fp (elf_hwcap & HWCAP_FP)
+#define have_fp (ELF_HWCAP & HWCAP_FP)
 
 static inline int fp_kernel_supported(void)
 {

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#6 lore raw
Quoted 37 lines · Jan Kiszka
Quoted 7 lines · Jan Kiszka via Xenomai
Quoted 2 lines · Greg Gallagher via Xenomai

Update elf_hwcap to ELF_HWCAP, this will work for newer 5.4 kernels

I assume you mean "also work" - or does it break on certain older kernels? Just asking before consulting our CI. ;)

...and the same pattern exists on ARM.

Jan

Quoted 6 lines

Review

Quoted 6 lines
---
 kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h

Quoted 7 lines
Quoted 7 lines

index b7e3f52f2..291c9e5f0 100644

kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h +0 -0
@@ -23,7 +23,7 @@
 #include <asm/xenomai/uapi/fptest.h>
 #include <asm/hwcap.h>
 
Quoted 9 lines

kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h line 29

Quoted 6 lines
kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h +1 -1
-#define have_fp (elf_hwcap & HWCAP_FP)
+#define have_fp (ELF_HWCAP & HWCAP_FP)
 
 static inline int fp_kernel_supported(void)
 {

Jan

Quoted 4 lines

--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

No problem, ACK. I'll put a more meaningful commit message as well. I thought I changed that before I sent the patch.

-Greg

#3 lore raw

Re: [PATCH 2/2] kernel: cobalt: Remove header file for newer kernels

In reply to Jan Kiszka
Quoted 30 lines · Jan Kiszka
Quoted 1 line · Greg Gallagher via Xenomai

5.4 kernels do not have compiler.h, only include this header file for

kernels older then 5.4

Review

Quoted 7 lines
---
 kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h | 4 ++++
 1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h

Quoted 6 lines

index 7444cc823..17be10339 100644

kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h +0 -0
@@ -29,7 +29,11 @@
 #define XNARCH_HOST_TICK_IRQ __ipipe_hrtimer_irq

kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h line 39

Quoted 10 lines
kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h +4 -0
 
 #include <asm/barrier.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
 #include <asm/compiler.h>
+#endif
+
 #include <asm/cmpxchg.h>
 #include <asm/switch_to.h>
 #include <asm/system_misc.h>

How about fixing arm as well at this chance? Same pattern.

Quoted 6 lines

Jan

--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

ACK, will send up another patch shortly.

#7 lore raw
In reply to Greg Gallagher
Quoted 46 lines · Greg Gallagher
Quoted 37 lines · Jan Kiszka
Quoted 7 lines · Jan Kiszka via Xenomai
Quoted 2 lines · Greg Gallagher via Xenomai

Update elf_hwcap to ELF_HWCAP, this will work for newer 5.4 kernels

I assume you mean "also work" - or does it break on certain older kernels? Just asking before consulting our CI. ;)

...and the same pattern exists on ARM.

Jan

Quoted 6 lines

Review

Quoted 6 lines
---
 kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h

Quoted 7 lines
Quoted 7 lines

index b7e3f52f2..291c9e5f0 100644

kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h +0 -0
@@ -23,7 +23,7 @@
 #include <asm/xenomai/uapi/fptest.h>
 #include <asm/hwcap.h>
 
Quoted 9 lines

kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h line 29

Quoted 6 lines
kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h +1 -1
-#define have_fp (elf_hwcap & HWCAP_FP)
+#define have_fp (ELF_HWCAP & HWCAP_FP)
 
 static inline int fp_kernel_supported(void)
 {

Jan

Quoted 4 lines

--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

Quoted 5 lines

No problem, ACK. I'll put a more meaningful commit message as well. I thought I changed that before I sent the patch.

-Greg

These don't need to be updated on the arm (aarch32) side of things. I have that port running now and should have testing done this evening. I will update this patch with a better commit message.

-Greg