From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Mark Saiia <mark.saiia@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] fpu context switch issue
Date: Thu, 13 Nov 2008 12:11:12 +0100 [thread overview]
Message-ID: <491C0B50.6030507@domain.hid> (raw)
In-Reply-To: <67b6b3430811111432o1ca14e87w7ccab4ab95dd591e@domain.hid>
Mark Saiia wrote:
> I applied the patch to Xenomai-2.4.5 with kernel 2.6.26.3 and observed the
> erroneous behavior. I did the same with linux-2.6.27.5 and Xenomai r4372
> and noticed the same behavior. Please let me know if I can run additional
> tests, if you need any more information, or how to potentially fix this
> issue.
>
> Thank you,
Could you try the following patch ?
--
Gilles.
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index f422387..f9f213a 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -1159,6 +1159,8 @@ asmlinkage void math_state_restore(void)
struct task_struct *tsk = thread->task;
unsigned long flags;
+ local_irq_save_hw_cond(flags);
+#ifndef CONFIG_IPIPE
if (!tsk_used_math(tsk)) {
local_irq_enable();
/*
@@ -1173,8 +1175,11 @@ asmlinkage void math_state_restore(void)
}
local_irq_disable();
}
-
- local_irq_save_hw_cond(flags);
+#else /* CONFIG_IPIPE */
+ if (!tsk_used_math(tsk))
+ /* No alloc, can not fail. */
+ init_fpu(tsk)
+#endif /* CONFIG_IPIPE */
clts(); /* Allow maths ops (or we recurse) */
restore_fpu(tsk);
thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */
next prev parent reply other threads:[~2008-11-13 11:11 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-03 0:35 [Xenomai-help] fpu context switch issue Steven Seeger
2008-11-03 10:10 ` Gilles Chanteperdrix
2008-11-03 14:21 ` Steven Seeger
2008-11-03 17:04 ` Gilles Chanteperdrix
2008-11-03 20:37 ` Mark Saiia
2008-11-04 8:30 ` Gilles Chanteperdrix
2008-11-08 16:56 ` Gilles Chanteperdrix
2008-11-11 0:07 ` Mark Saiia
2008-11-11 11:21 ` Gilles Chanteperdrix
2008-11-11 17:43 ` Steven Seeger
2008-11-11 22:32 ` Mark Saiia
2008-11-11 22:39 ` Gilles Chanteperdrix
2008-11-13 11:11 ` Gilles Chanteperdrix [this message]
2008-11-14 3:59 ` Mark Saiia
2008-11-14 8:42 ` Gilles Chanteperdrix
2008-11-17 17:27 ` Mark Saiia
2008-11-17 18:54 ` Steven Seeger
2008-11-19 18:51 ` Steven Seeger
2008-11-20 12:43 ` Gilles Chanteperdrix
2008-11-20 13:51 ` Steven Seeger
2008-11-21 17:03 ` Mark Saiia
2008-11-21 17:07 ` Gilles Chanteperdrix
2008-11-26 10:47 ` Gilles Chanteperdrix
2008-11-12 13:48 ` Steven Seeger
2008-11-12 13:52 ` Gilles Chanteperdrix
2008-11-12 13:53 ` Steven Seeger
2008-11-04 9:55 ` Gilles Chanteperdrix
2008-11-04 15:38 ` Steven Seeger
2008-11-04 17:29 ` Mark Saiia
2008-11-04 18:59 ` Gilles Chanteperdrix
2008-11-04 19:01 ` Gilles Chanteperdrix
2008-11-04 21:29 ` Steven Seeger
2008-11-05 17:47 ` Mark Saiia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=491C0B50.6030507@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=mark.saiia@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.