Module: xenomai-2.6
Branch: master
Commit: e4daa5ec64db5d789630adcade997dc08416f0ea
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=e4daa5ec64db5d789630adcade997dc08416f0ea

Author: Henning Schild <[email protected]>
Date:   Mon Oct 24 19:39:00 2016 +0200

hal/x86: fix kernel-space FPU with 4.1 kernel

Starting at kernel 4.1 we have a per-cpu flag for kernel fpu and do not
abuse the flag of current anymore. This patch is a minimal fix for
something that is hard to get your head around, but xenomai 2.6 will not
go beyond 4.1. So not effort to fix or document what is going on ...

Signed-off-by: Henning Schild <[email protected]>

---

 include/asm-x86/bits/pod.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/asm-x86/bits/pod.h b/include/asm-x86/bits/pod.h
index 678720a..8a16713 100644
--- a/include/asm-x86/bits/pod.h
+++ b/include/asm-x86/bits/pod.h
@@ -58,6 +58,10 @@ static inline void xnarch_leave_root(xnarchtcb_t *rootcb)
        rootcb->spp = &current->thread.x86reg_sp;
        rootcb->ipp = &current->thread.rip;
 #endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
+       if (kernel_fpu_disabled())
+               wrap_clear_fpu_used(current);
+#endif
        rootcb->ts_usedfpu = !!wrap_test_fpu_used(current);
        rootcb->cr0_ts = (read_cr0() & 8) != 0;
        /* So that xnarch_save_fpu() will operate on the right FPU area. */


_______________________________________________
Xenomai-git mailing list
[email protected]
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to