Skip to contentSkip to conversation

cobalt/x86: adapt fpu code with Linux kernel upstream

PATCH In review Fino Meng 3 participants 3 messages Sep 17, 2020

lore
Share & tools
lore

Fino Meng

author
#0 lore raw

PATCH 1/4 cobalt/x86: adapt fpu code with Linux kernel upstream

---
 kernel/cobalt/arch/x86/thread.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
kernel/cobalt/arch/x86/thread.c +5 -1
index ba807ac1e..c33ad832f 100644
@@ -26,6 +26,10 @@
 #include <asm/mmu_context.h>
 #include <asm/processor.h>
 
+#ifdef IPIPE_X86_FPU_EAGER
+extern void fpu__initialize(struct fpu *fpu);
+#endif
+
 static struct kmem_cache *xstate_cache;
 
 #ifdef IPIPE_X86_FPU_EAGER
@@ -472,7 +476,7 @@ void xnarch_leave_root(struct xnthread *root)
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
 	/* restore current's fpregs */
 	__cpu_invalidate_fpregs_state();
-	switch_fpu_finish(&current->thread.fpu, smp_processor_id());
+	switch_fpu_finish(&current->thread.fpu);
 #else
 	/* mark current thread as not owning the FPU anymore */
 	if (fpregs_active())
Signature · 1 line
2.20.1
#1 lore raw
Quoted 13 lines

Sent: Friday, September 18, 2020 12:53 AM

---
kernel/cobalt/arch/x86/thread.c | 6 +++++-

1 file changed, 5 insertions(+), 1 deletion(-)

kernel/cobalt/arch/x86/thread.c line 31

Quoted 6 lines
kernel/cobalt/arch/x86/thread.c +3 -0
@@ -26,6 +26,10 @@
 #include <asm/mmu_context.h>
 #include <asm/processor.h>
 
+#ifdef IPIPE_X86_FPU_EAGER
+extern void fpu__initialize(struct fpu *fpu); #endif
+

I sent the patch by "mutt -H 0001-cobalt-x86-adapt-fpu-code-with-Linux-kernel-upstream.patch", but seems the received content is not match with my local patch:

+#ifdef IPIPE_X86_FPU_EAGER
+extern void fpu__initialize(struct fpu *fpu);
+#endif
+

However I failed to config git send-email, will continue to try tomorrow. the 4 patches are for the Xenomai core part of kernel 5.4's porting.

Quoted 14 lines
kernel/cobalt/arch/x86/thread.c +1 -2
 static struct kmem_cache *xstate_cache;
 
 #ifdef IPIPE_X86_FPU_EAGER
@@ -472,7 +476,7 @@ void xnarch_leave_root(struct xnthread *root)  #if LINUX_VERSION_CODE >=
 KERNEL_VERSION(4,14,0)
 	/* restore current's fpregs */
 	__cpu_invalidate_fpregs_state();
-	switch_fpu_finish(&current->thread.fpu, smp_processor_id());
+	switch_fpu_finish(&current->thread.fpu);
 #else
 	/* mark current thread as not owning the FPU anymore */
 	if (fpregs_active())
--

2.20.1

#2 lore raw

Hi,

Quoted 27 lines · Fino via Xenomai
Quoted 12 lines

Sent: Friday, September 18, 2020 12:53 AM

---
kernel/cobalt/arch/x86/thread.c | 6 +++++-

1 file changed, 5 insertions(+), 1 deletion(-)

kernel/cobalt/arch/x86/thread.c line 31

Quoted 6 lines
kernel/cobalt/arch/x86/thread.c +3 -0
@@ -26,6 +26,10 @@
 #include <asm/mmu_context.h>
 #include <asm/processor.h>
 
+#ifdef IPIPE_X86_FPU_EAGER
+extern void fpu__initialize(struct fpu *fpu); #endif
+

I sent the patch by "mutt -H 0001-cobalt-x86-adapt-fpu-code-with-Linux-kernel-upstream.patch", but seems the received content is not match with my local patch:

kernel/cobalt/arch/x86/thread.c +4 -0
+#ifdef IPIPE_X86_FPU_EAGER
+extern void fpu__initialize(struct fpu *fpu);
+#endif
+
Quoted 3 lines

However I failed to config git send-email, will continue to try tomorrow. the 4 patches are for the Xenomai core part of kernel 5.4's porting.

Make sure to post to [email protected], not [email protected] in --to. You have been talking to Mailman so far...

Signature · 1 line
Philippe.