All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] [PATCH 1/2] hal/x86: fix kernel-space FPU with 4.1 kernel
@ 2016-10-24 17:39 Henning Schild
  2016-10-24 17:39 ` [Xenomai] [PATCH 2/2] Revert "hal/x86: forbid compilation with Linux 4.0+" Henning Schild
  2016-10-25 13:26 ` [Xenomai] [PATCH 1/2] hal/x86: fix kernel-space FPU with 4.1 kernel Philippe Gerum
  0 siblings, 2 replies; 7+ messages in thread
From: Henning Schild @ 2016-10-24 17:39 UTC (permalink / raw)
  To: xenomai

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 <henning.schild@siemens.com>
---
 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. */
-- 
2.7.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-10-26 12:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-24 17:39 [Xenomai] [PATCH 1/2] hal/x86: fix kernel-space FPU with 4.1 kernel Henning Schild
2016-10-24 17:39 ` [Xenomai] [PATCH 2/2] Revert "hal/x86: forbid compilation with Linux 4.0+" Henning Schild
2016-10-25 13:26 ` [Xenomai] [PATCH 1/2] hal/x86: fix kernel-space FPU with 4.1 kernel Philippe Gerum
2016-10-25 15:37   ` Henning Schild
2016-10-25 16:54     ` Philippe Gerum
2016-10-26  9:41       ` Henning Schild
2016-10-26 12:57         ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.