All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] fpu context switch issue
@ 2008-11-03  0:35 Steven Seeger
  2008-11-03 10:10 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 33+ messages in thread
From: Steven Seeger @ 2008-11-03  0:35 UTC (permalink / raw)
  To: xenomai


[-- Attachment #1.1: Type: text/plain, Size: 674 bytes --]

I'm having a weird issue. Sometimes when I run the attached program I
see one of the "shouldn't see this" printouts. However, it only fails if
I also link in another userspace library that doesn't do anything. (No
libraries are being called here.)

 

I've had issues with a couple of other xenomai apps. I get a nan on a
double operation sometimes right after the app first loads, and then
it's ok after that. This error in the attached program always happens on
the first call in the higher priority task (started second.)

 

Running 2.4.5 with 2.6.26.3 and also 2.6.25.9. AMD Geode LX800 board.

 

Any suggestions?


Thanks,

Steven

 

 


[-- Attachment #1.2: Type: text/html, Size: 4698 bytes --]

[-- Attachment #2: double_test.cpp --]
[-- Type: application/octet-stream, Size: 931 bytes --]

#include <sys/mman.h>
#include <iostream>
#include <native/task.h>

static RT_TASK task,task2;

void func(void*)
{
    volatile double min = 10.0;
    volatile double val = 25.0;
    run[0] = true;
    
    for(;;)
    {
        if(val > min) {
            
        }
        else std::cout << "shouldn't see this " << min << ' ' << val << std::endl;
        
        rt_task_sleep(100000);
    }
    
}

void func2(void*)
{
    volatile double min = 5.0;
    volatile double val = 20.0;
    
    run[1] = true;
    
    for(;;)
    {
        if(val > min) {
            
        }
        else std::cout << "shouldn't see this " << min << ' ' << val << std::endl;
        
        rt_task_sleep(100000);
    }
}

int main()
{
    mlockall(MCL_CURRENT | MCL_FUTURE);
    
    rt_task_spawn(&task, "dummy", 40, 50, 0, func, 0);
    rt_task_spawn(&task2, "dummy2", 40, 60, 0, func2, 0);
    
    usleep(500000);
    
    return 0;
}

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

* Re: [Xenomai-help] fpu context switch issue
  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
  0 siblings, 1 reply; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-03 10:10 UTC (permalink / raw)
  To: Steven Seeger; +Cc: xenomai

Steven Seeger wrote:
> I'm having a weird issue. Sometimes when I run the attached program I
> see one of the "shouldn't see this" printouts. However, it only fails if
> I also link in another userspace library that doesn't do anything. (No
> libraries are being called here.)

Some libraries do things when loaded, even if no function is called: if
a C++ library declares a global or static object with a non trivial
constructor, the constructor is run when the library is loaded. The same
goes for C functions declared with the "constructor" attribute.

> 
>  
> 
> I've had issues with a couple of other xenomai apps. I get a nan on a
> double operation sometimes right after the app first loads, and then
> it's ok after that. This error in the attached program always happens on
> the first call in the higher priority task (started second.)
> 
>  
> 
> Running 2.4.5 with 2.6.26.3 and also 2.6.25.9. AMD Geode LX800 board.

Could you try to run the "switchtest" program, and see if it has bugs
too ? Also, do you see the "fxsr" flag in /proc/cpuinfo ?

-- 
                                                 Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-03 10:10 ` Gilles Chanteperdrix
@ 2008-11-03 14:21   ` Steven Seeger
  2008-11-03 17:04     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 33+ messages in thread
From: Steven Seeger @ 2008-11-03 14:21 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Hi Gilles. Thank you for getting back to me.

I do not see "fxsr" in /proc/cpuinfo. I checked around with Google and
it seems this chip doesn't have FXSR support. Do I need to do something
else in this case? We are currently using a new board. I will check
/proc/cpuinfo on the old board and see if it says FXSR. We never had
this problem with the old board.

I understand that some libraries do things on startup, but this one
doesn't seem to. In fact, linking that library in only adds 8 bytes to
the code. Very strange. I really think it would fail even without
linking that in but I can't produce it. I have other apps that are more
complicated but do not use that library that also have issues with
doubles on startup.

I also realized I didn't remove access to the run variable when I
attached the code. That variable is obviously not being used. 

I will post the results of switchtest later today. Thank you for the
suggestion.

Steven

> -----Original Message-----
> From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> Sent: Monday, November 03, 2008 3:10 AM
> To: Steven Seeger
> Cc: xenomai@xenomai.org
> Subject: Re: [Xenomai-help] fpu context switch issue
> 
> Steven Seeger wrote:
> > I'm having a weird issue. Sometimes when I run the attached program
I
> > see one of the "shouldn't see this" printouts. However, it only
fails
> if
> > I also link in another userspace library that doesn't do anything.
> (No
> > libraries are being called here.)
> 
> Some libraries do things when loaded, even if no function is called:
if
> a C++ library declares a global or static object with a non trivial
> constructor, the constructor is run when the library is loaded. The
> same
> goes for C functions declared with the "constructor" attribute.
> 
> >
> >
> >
> > I've had issues with a couple of other xenomai apps. I get a nan on
a
> > double operation sometimes right after the app first loads, and then
> > it's ok after that. This error in the attached program always
happens
> on
> > the first call in the higher priority task (started second.)
> >
> >
> >
> > Running 2.4.5 with 2.6.26.3 and also 2.6.25.9. AMD Geode LX800
board.
> 
> Could you try to run the "switchtest" program, and see if it has bugs
> too ? Also, do you see the "fxsr" flag in /proc/cpuinfo ?
> 
> --
>                                                  Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-03 14:21   ` Steven Seeger
@ 2008-11-03 17:04     ` Gilles Chanteperdrix
  2008-11-03 20:37       ` Mark Saiia
  0 siblings, 1 reply; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-03 17:04 UTC (permalink / raw)
  To: Steven Seeger; +Cc: xenomai

Steven Seeger wrote:
> Hi Gilles. Thank you for getting back to me.
> 
> I do not see "fxsr" in /proc/cpuinfo. I checked around with Google and
> it seems this chip doesn't have FXSR support. Do I need to do something
> else in this case? We are currently using a new board. I will check
> /proc/cpuinfo on the old board and see if it says FXSR. We never had
> this problem with the old board.

No, the fact that you have no support for FXSR is not a problem, it was
just a question to try and reproduce the issue you face.

-- 
                                                 Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-03 17:04     ` Gilles Chanteperdrix
@ 2008-11-03 20:37       ` Mark Saiia
  2008-11-04  8:30         ` Gilles Chanteperdrix
  2008-11-04  9:55         ` Gilles Chanteperdrix
  0 siblings, 2 replies; 33+ messages in thread
From: Mark Saiia @ 2008-11-03 20:37 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 1565 bytes --]

Hello,

The switchtest output is as follows.  This was run on 2.4.5 with 2.6.26.3
AMD Geode LX800 board.
In order to get it to run, I had to remove modprobe xeno_native from my
start-up script.  I don't know if that is an expected requirement prior to
running the test.

== Testing FPU check routines...
r0: 1 != 2
r1: 1 != 2
r2: 1 != 2
r3: 1 != 2
r4: 1 != 2
r5: 1 != 2
r6: 1 != 2
r7: 1 != 2
== FPU check routines: OK.
== Threads: sleeper_ufps-0 rtk-1 rtk-2 rtk_fp-3 rtk_fp-4 rtk_fp_ufpp-5
rtk_fp_ufpp-6 rtup-7 rtup-8 rtup_ufpp-9 rtup_ufpp-10 rtus-11 rtus-12
rtus_ufps-13 rtus_ufps-14 rtuo-15 rtuo-16 rtuo_ufpp-17 rtuo_ufpp-18
rtuo_ufps-19 rtuo_ufps-20 rtuo_ufpp_ufps-21 rtuo_ufpp_ufps-22
RTT|  00:00:01
RTH|ctx switches|-------total
RTD|       17250|       17250
RTD|       17250|       34500
RTD|       17250|       51750
RTD|       17250|       69000
RTD|       17273|       86273
RTD|       17273|      103546
RTD|       17273|      120819
RTD|       17250|      138069
RTD|       17250|      155319
RTD|       17273|      172592
RTD|       17250|      189842
RTD|       17250|      207092
RTD|       17273|      224365
RTD|       17273|      241638
RTD|       17273|      258911
RTD|       17250|      276161
RTD|       17250|      293411
RTD|       17250|      310661
RTD|       17273|      327934
RTD|       17273|      345207
RTD|       17250|      362457

Thanks in advance for any help.

Mark Saiia



>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
>

[-- Attachment #2: Type: text/html, Size: 3304 bytes --]

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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-03 20:37       ` Mark Saiia
@ 2008-11-04  8:30         ` Gilles Chanteperdrix
  2008-11-08 16:56           ` Gilles Chanteperdrix
  2008-11-04  9:55         ` Gilles Chanteperdrix
  1 sibling, 1 reply; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-04  8:30 UTC (permalink / raw)
  To: Mark Saiia; +Cc: xenomai

Mark Saiia wrote:
> Hello,
> 
> The switchtest output is as follows.  This was run on 2.4.5 with 2.6.26.3
> AMD Geode LX800 board.
> In order to get it to run, I had to remove modprobe xeno_native from my
> start-up script.  I don't know if that is an expected requirement prior to
> running the test.
> 
> == Testing FPU check routines...
> r0: 1 != 2
> r1: 1 != 2
> r2: 1 != 2
> r3: 1 != 2
> r4: 1 != 2
> r5: 1 != 2
> r6: 1 != 2
> r7: 1 != 2
> == FPU check routines: OK.
> == Threads: sleeper_ufps-0 rtk-1 rtk-2 rtk_fp-3 rtk_fp-4 rtk_fp_ufpp-5
> rtk_fp_ufpp-6 rtup-7 rtup-8 rtup_ufpp-9 rtup_ufpp-10 rtus-11 rtus-12
> rtus_ufps-13 rtus_ufps-14 rtuo-15 rtuo-16 rtuo_ufpp-17 rtuo_ufpp-18
> rtuo_ufps-19 rtuo_ufps-20 rtuo_ufpp_ufps-21 rtuo_ufpp_ufps-22
> RTT|  00:00:01
> RTH|ctx switches|-------total
> RTD|       17250|       17250
> RTD|       17250|       34500
> RTD|       17250|       51750
> RTD|       17250|       69000
> RTD|       17273|       86273
> RTD|       17273|      103546
> RTD|       17273|      120819
> RTD|       17250|      138069
> RTD|       17250|      155319
> RTD|       17273|      172592
> RTD|       17250|      189842
> RTD|       17250|      207092
> RTD|       17273|      224365
> RTD|       17273|      241638
> RTD|       17273|      258911
> RTD|       17250|      276161
> RTD|       17250|      293411
> RTD|       17250|      310661
> RTD|       17273|      327934
> RTD|       17273|      345207
> RTD|       17250|      362457
> 
> Thanks in advance for any help.
> 
> Mark Saiia


Hi,

It seems you do not get the same error with switchtest as you get with
your test program. I had a look at linux fpu handling, and it seems to
be very different from Xenomai fpu handling. I need to dig a little bit
more, but will send you a patch soon.

Regards.

-- 
					    Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-03 20:37       ` Mark Saiia
  2008-11-04  8:30         ` Gilles Chanteperdrix
@ 2008-11-04  9:55         ` Gilles Chanteperdrix
  2008-11-04 15:38           ` Steven Seeger
  1 sibling, 1 reply; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-04  9:55 UTC (permalink / raw)
  To: Mark Saiia; +Cc: xenomai

Mark Saiia wrote:
> Hello,
> 
> The switchtest output is as follows.  This was run on 2.4.5 with 2.6.26.3
> AMD Geode LX800 board.
> In order to get it to run, I had to remove modprobe xeno_native from my
> start-up script.  I don't know if that is an expected requirement prior to
> running the test.

Just to understand what I am doing, would you, or anybody else, have a
datasheet from AMD with the details of Geode FPU handling ?

-- 
                                                 Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-04  9:55         ` Gilles Chanteperdrix
@ 2008-11-04 15:38           ` Steven Seeger
  2008-11-04 17:29             ` Mark Saiia
  2008-11-04 19:01             ` Gilles Chanteperdrix
  0 siblings, 2 replies; 33+ messages in thread
From: Steven Seeger @ 2008-11-04 15:38 UTC (permalink / raw)
  To: Gilles Chanteperdrix, Mark Saiia; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 911 bytes --]

Hi Gilles. Please let me know if this is ok. This is the datasheet for
the part. 

Steven



> -----Original Message-----
> From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> Sent: Tuesday, November 04, 2008 2:55 AM
> To: Mark Saiia
> Cc: Steven Seeger; xenomai@xenomai.org
> Subject: Re: [Xenomai-help] fpu context switch issue
> 
> Mark Saiia wrote:
> > Hello,
> >
> > The switchtest output is as follows.  This was run on 2.4.5 with
> 2.6.26.3
> > AMD Geode LX800 board.
> > In order to get it to run, I had to remove modprobe xeno_native from
> my
> > start-up script.  I don't know if that is an expected requirement
> prior to
> > running the test.
> 
> Just to understand what I am doing, would you, or anybody else, have a
> datasheet from AMD with the details of Geode FPU handling ?
> 
> --
>                                                  Gilles.

[-- Attachment #2: 33234G_LX_databook.pdf --]
[-- Type: application/octet-stream, Size: 5388787 bytes --]

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

* Re: [Xenomai-help] fpu context switch issue
  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
  1 sibling, 1 reply; 33+ messages in thread
From: Mark Saiia @ 2008-11-04 17:29 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]

I've noticed the same erroneous behavior when CONFIG_XENO_HW_FPU is enabled
and when it is disabled.  I don't know if this information is relevant or
not.  Is this expected behavior?

Mark Saiia


On Tue, Nov 4, 2008 at 7:38 AM, Steven Seeger <
sseeger@domain.hid> wrote:

> Hi Gilles. Please let me know if this is ok. This is the datasheet for
> the part.
>
> Steven
>
>
>
> > -----Original Message-----
> > From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> > Sent: Tuesday, November 04, 2008 2:55 AM
> > To: Mark Saiia
> > Cc: Steven Seeger; xenomai@xenomai.org
> > Subject: Re: [Xenomai-help] fpu context switch issue
> >
> > Mark Saiia wrote:
> > > Hello,
> > >
> > > The switchtest output is as follows.  This was run on 2.4.5 with
> > 2.6.26.3
> > > AMD Geode LX800 board.
> > > In order to get it to run, I had to remove modprobe xeno_native from
> > my
> > > start-up script.  I don't know if that is an expected requirement
> > prior to
> > > running the test.
> >
> > Just to understand what I am doing, would you, or anybody else, have a
> > datasheet from AMD with the details of Geode FPU handling ?
> >
> > --
> >                                                  Gilles.
>

[-- Attachment #2: Type: text/html, Size: 2029 bytes --]

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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-04 17:29             ` Mark Saiia
@ 2008-11-04 18:59               ` Gilles Chanteperdrix
  0 siblings, 0 replies; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-04 18:59 UTC (permalink / raw)
  To: Mark Saiia; +Cc: xenomai

Mark Saiia wrote:
> I've noticed the same erroneous behavior when CONFIG_XENO_HW_FPU is enabled
> and when it is disabled.  I don't know if this information is relevant or
> not.  Is this expected behavior?

No, it should not happen when disabled, you should see messages saying
"Invalid use of FPU in Xenomai context at xxxxxx" on the kernel console.
That is probably another bug. Is it possible for you to run your example
without Xenomai at all ? Just to be sure that we do not hit a Linux bug.

-- 
					    Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-04 15:38           ` Steven Seeger
  2008-11-04 17:29             ` Mark Saiia
@ 2008-11-04 19:01             ` Gilles Chanteperdrix
  2008-11-04 21:29               ` Steven Seeger
  1 sibling, 1 reply; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-04 19:01 UTC (permalink / raw)
  To: Steven Seeger; +Cc: xenomai

Steven Seeger wrote:
> Hi Gilles. Please let me know if this is ok. This is the datasheet for
> the part. 

Ok, thanks. Unfortunately, the text about finit or fninit is not very
detailed. I will try to send a patch anyway.

-- 
					    Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-04 19:01             ` Gilles Chanteperdrix
@ 2008-11-04 21:29               ` Steven Seeger
  2008-11-05 17:47                 ` Mark Saiia
  0 siblings, 1 reply; 33+ messages in thread
From: Steven Seeger @ 2008-11-04 21:29 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Gilles,

Thanks for your effort. Is there a way to make a contribution to the
Xenomai project? I should really get the company I'm helping to do that.
I have tried to do more to find information on those instructions for
the LX800 but I can't find anything.

Steven

> -----Original Message-----
> From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> Sent: Tuesday, November 04, 2008 12:01 PM
> To: Steven Seeger
> Cc: Mark Saiia; xenomai@xenomai.org
> Subject: Re: [Xenomai-help] fpu context switch issue
> 
> Steven Seeger wrote:
> > Hi Gilles. Please let me know if this is ok. This is the datasheet
> for
> > the part.
> 
> Ok, thanks. Unfortunately, the text about finit or fninit is not very
> detailed. I will try to send a patch anyway.
> 
> --
> 					    Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-04 21:29               ` Steven Seeger
@ 2008-11-05 17:47                 ` Mark Saiia
  0 siblings, 0 replies; 33+ messages in thread
From: Mark Saiia @ 2008-11-05 17:47 UTC (permalink / raw)
  To: Steven Seeger; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 362 bytes --]

I modified the example to use pthreads instead of Xenomai and did not
observe the erroneous behavior.  I kept the same Makefile so all the same
libraries were linked in, the only alteration was in the code.  (I was using
the same Xenomai patched kernel).  Furthermore, I did not observe any error
messages in the kernel log when FPU was disabled.

Thanks,

Mark

[-- Attachment #2: Type: text/html, Size: 402 bytes --]

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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-04  8:30         ` Gilles Chanteperdrix
@ 2008-11-08 16:56           ` Gilles Chanteperdrix
  2008-11-11  0:07             ` Mark Saiia
  0 siblings, 1 reply; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-08 16:56 UTC (permalink / raw)
  To: Mark Saiia; +Cc: xenomai

Gilles Chanteperdrix wrote:
> Mark Saiia wrote:
>> Hello,
>>
>> The switchtest output is as follows.  This was run on 2.4.5 with 2.6.26.3
>> AMD Geode LX800 board.
>> In order to get it to run, I had to remove modprobe xeno_native from my
>> start-up script.  I don't know if that is an expected requirement prior to
>> running the test.
>>
>> == Testing FPU check routines...
>> r0: 1 != 2
>> r1: 1 != 2
>> r2: 1 != 2
>> r3: 1 != 2
>> r4: 1 != 2
>> r5: 1 != 2
>> r6: 1 != 2
>> r7: 1 != 2
>> == FPU check routines: OK.
>> == Threads: sleeper_ufps-0 rtk-1 rtk-2 rtk_fp-3 rtk_fp-4 rtk_fp_ufpp-5
>> rtk_fp_ufpp-6 rtup-7 rtup-8 rtup_ufpp-9 rtup_ufpp-10 rtus-11 rtus-12
>> rtus_ufps-13 rtus_ufps-14 rtuo-15 rtuo-16 rtuo_ufpp-17 rtuo_ufpp-18
>> rtuo_ufps-19 rtuo_ufps-20 rtuo_ufpp_ufps-21 rtuo_ufpp_ufps-22
>> RTT|  00:00:01
>> RTH|ctx switches|-------total
>> RTD|       17250|       17250
>> RTD|       17250|       34500
>> RTD|       17250|       51750
>> RTD|       17250|       69000
>> RTD|       17273|       86273
>> RTD|       17273|      103546
>> RTD|       17273|      120819
>> RTD|       17250|      138069
>> RTD|       17250|      155319
>> RTD|       17273|      172592
>> RTD|       17250|      189842
>> RTD|       17250|      207092
>> RTD|       17273|      224365
>> RTD|       17273|      241638
>> RTD|       17273|      258911
>> RTD|       17250|      276161
>> RTD|       17250|      293411
>> RTD|       17250|      310661
>> RTD|       17273|      327934
>> RTD|       17273|      345207
>> RTD|       17250|      362457
>>
>> Thanks in advance for any help.
>>
>> Mark Saiia
> 
> 
> Hi,
> 
> It seems you do not get the same error with switchtest as you get with
> your test program. I had a look at linux fpu handling, and it seems to
> be very different from Xenomai fpu handling. I need to dig a little bit
> more, but will send you a patch soon.

Here comes the promised patch.

Index: include/asm-x86/bits/pod_32.h
===================================================================
--- include/asm-x86/bits/pod_32.h	(revision 4355)
+++ include/asm-x86/bits/pod_32.h	(working copy)
@@ -194,16 +194,37 @@ static inline void xnarch_init_thread(xn
 static inline void xnarch_init_fpu(xnarchtcb_t * tcb)
 {
 	struct task_struct *task = tcb->user_task;
+	x86_fpu_state *fpup = tcb->fpup;
 	/* Initialize the FPU for a task. This must be run on behalf of the
 	   task. */
 
-	__asm__ __volatile__("clts; fninit");
+	if (cpu_has_fxsr) {
+		struct i837_fxsave_struct *fx = &fpup->fxsave;
 
-	if (cpu_has_xmm) {
-		unsigned long __mxcsr = 0x1f80UL & 0xffbfUL;
-		__asm__ __volatile__("ldmxcsr %0"::"m"(__mxcsr));
-	}
+		memset(fx, 0, sizeof(*fx));
+		fx->cwd = 0x37f;
+		if (cpu_has_xmm) {
+			unsigned long __mxcsr = 0x1f80UL & 0xffbfUL;
+			fx->mxcsr = __mxcsr;
+		}
+
+		clts();
+
+		__asm__ __volatile__("fxrstor %0": /* no output */ :"m"(*fx));
+	} else {
+		struct i387_fsave_struct *fp = &fpup->fsave;
+
+		memset(fp, 0, sizeof(*fp));
+		fp->cwd = 0xffff037fu;
+		fp->swd = 0xffff0000u;
+		fp->twd = 0xffffffffu;
+		fp->fos = 0xffff0000u;
+		
+		clts();
 
+		__asm__ __volatile__("frstor %0": /* no output */ :"m"(*fp));
+	}
+	
 	if (task) {
 		/* Real-time shadow FPU initialization: tell Linux that this
 		   thread initialized its FPU hardware. The fpu usage bit is



-- 
					    Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-08 16:56           ` Gilles Chanteperdrix
@ 2008-11-11  0:07             ` Mark Saiia
  2008-11-11 11:21               ` Gilles Chanteperdrix
  0 siblings, 1 reply; 33+ messages in thread
From: Mark Saiia @ 2008-11-11  0:07 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 7142 bytes --]

Hello,

The patch would not apply cleanly(rejected Hunk) against 2.4.5
w/linux2.6.26.3 or svn 4368 w/linux2.6.26.7.

I edited pod_32.h to try and incorporate the changes listed in the patch.

Building with both Xenomai/Linux combinations gives the following errors.
include/asm/xenomai/bits/pod_32.h: In function 'xnarch_init_fpu':
include/asm/xenomai/bits/pod_32.h:220: error: 'x86_fpu_state' undeclared
(first use in this function)
include/asm/xenomai/bits/pod_32.h:220: error: (Each undeclared identifier is
reported only once
include/asm/xenomai/bits/pod_32.h:220: error: for each function it appears
in.)
include/asm/xenomai/bits/pod_32.h:220: error: 'fpup' undeclared (first use
in this function)
include/asm/xenomai/bits/pod_32.h:229: error: dereferencing pointer to
incomplete type
include/asm/xenomai/bits/pod_32.h:229: error: dereferencing pointer to
incomplete type
include/asm/xenomai/bits/pod_32.h:229: error: dereferencing pointer to
incomplete type
include/asm/xenomai/bits/pod_32.h:229: error: dereferencing pointer to
incomplete type
include/asm/xenomai/bits/pod_32.h:229: error: dereferencing pointer to
incomplete type
include/asm/xenomai/bits/pod_32.h:229: error: dereferencing pointer to
incomplete type
include/asm/xenomai/bits/pod_32.h:230: error: dereferencing pointer to
incomplete type
include/asm/xenomai/bits/pod_32.h:233: error: dereferencing pointer to
incomplete type
include/asm/xenomai/bits/pod_32.h:238: error: dereferencing pointer to
incomplete type
include/asm/xenomai/bits/pod_32.h:238: error: memory input 0 is not directly
addressable


My init_fpu function looks like this, which I believe corresponds to your
patch.

       struct task_struct *task = tcb->user_task;
       x86_fpu_state *fpup = tcb->fpup;

       /* Initialize the FPU for a task. This must be run on behalf of the
       task. */

       if (cpu_has_fxsr) {
               struct i837_fxsave_struct *fx = &fpup->fxsave;

               memset(fx, 0, sizeof(*fx));
               fx->cwd = 0x37f;
               if (cpu_has_xmm) {
                       unsigned long __mxcsr = 0x1f80UL & 0xffbfUL;
                       fx->mxcsr = __mxcsr;
               }

               clts();

               __asm__ __volatile__("fxrstor %0": /* no output */
:"m"(*fx));
       } else {
               struct i387_fsave_struct *fp = &fpup->fsave;

               memset(fp, 0, sizeof(*fp));
               fp->cwd = 0xffff037fu;
               fp->swd = 0xffff0000u;
               fp->twd = 0xffffffffu;
               fp->fos = 0xffff0000u;

               clts();

               __asm__ __volatile__("frstor %0": /* no output */ :"m"(*fp));
       }
        if (task) {
        /* Real-time shadow FPU initialization: tell Linux that this
           thread initialized its FPU hardware. The fpu usage bit is
           necessary for xnarch_save_fpu to save the FPU state at next
           switch. */
        xnarch_set_fpu_init(task);
        wrap_set_fpu_used(task);
    }

Please let me know, if I did anything incorrectly, or if the patch was not
completely posted.


Thanks for your work,

Mark


On Sat, Nov 8, 2008 at 8:56 AM, Gilles Chanteperdrix <
gilles.chanteperdrix@xenomai.org> wrote:

> Gilles Chanteperdrix wrote:
> > Mark Saiia wrote:
> >> Hello,
> >>
> >> The switchtest output is as follows.  This was run on 2.4.5 with
> 2.6.26.3
> >> AMD Geode LX800 board.
> >> In order to get it to run, I had to remove modprobe xeno_native from my
> >> start-up script.  I don't know if that is an expected requirement prior
> to
> >> running the test.
> >>
> >> == Testing FPU check routines...
> >> r0: 1 != 2
> >> r1: 1 != 2
> >> r2: 1 != 2
> >> r3: 1 != 2
> >> r4: 1 != 2
> >> r5: 1 != 2
> >> r6: 1 != 2
> >> r7: 1 != 2
> >> == FPU check routines: OK.
> >> == Threads: sleeper_ufps-0 rtk-1 rtk-2 rtk_fp-3 rtk_fp-4 rtk_fp_ufpp-5
> >> rtk_fp_ufpp-6 rtup-7 rtup-8 rtup_ufpp-9 rtup_ufpp-10 rtus-11 rtus-12
> >> rtus_ufps-13 rtus_ufps-14 rtuo-15 rtuo-16 rtuo_ufpp-17 rtuo_ufpp-18
> >> rtuo_ufps-19 rtuo_ufps-20 rtuo_ufpp_ufps-21 rtuo_ufpp_ufps-22
> >> RTT|  00:00:01
> >> RTH|ctx switches|-------total
> >> RTD|       17250|       17250
> >> RTD|       17250|       34500
> >> RTD|       17250|       51750
> >> RTD|       17250|       69000
> >> RTD|       17273|       86273
> >> RTD|       17273|      103546
> >> RTD|       17273|      120819
> >> RTD|       17250|      138069
> >> RTD|       17250|      155319
> >> RTD|       17273|      172592
> >> RTD|       17250|      189842
> >> RTD|       17250|      207092
> >> RTD|       17273|      224365
> >> RTD|       17273|      241638
> >> RTD|       17273|      258911
> >> RTD|       17250|      276161
> >> RTD|       17250|      293411
> >> RTD|       17250|      310661
> >> RTD|       17273|      327934
> >> RTD|       17273|      345207
> >> RTD|       17250|      362457
> >>
> >> Thanks in advance for any help.
> >>
> >> Mark Saiia
> >
> >
> > Hi,
> >
> > It seems you do not get the same error with switchtest as you get with
> > your test program. I had a look at linux fpu handling, and it seems to
> > be very different from Xenomai fpu handling. I need to dig a little bit
> > more, but will send you a patch soon.
>
> Here comes the promised patch.
>
> Index: include/asm-x86/bits/pod_32.h
> ===================================================================
> --- include/asm-x86/bits/pod_32.h       (revision 4355)
> +++ include/asm-x86/bits/pod_32.h       (working copy)
> @@ -194,16 +194,37 @@ static inline void xnarch_init_thread(xn
>  static inline void xnarch_init_fpu(xnarchtcb_t * tcb)
>  {
>        struct task_struct *task = tcb->user_task;
> +       x86_fpu_state *fpup = tcb->fpup;
>        /* Initialize the FPU for a task. This must be run on behalf of the
>           task. */
>
> -       __asm__ __volatile__("clts; fninit");
> +       if (cpu_has_fxsr) {
> +               struct i837_fxsave_struct *fx = &fpup->fxsave;
>
> -       if (cpu_has_xmm) {
> -               unsigned long __mxcsr = 0x1f80UL & 0xffbfUL;
> -               __asm__ __volatile__("ldmxcsr %0"::"m"(__mxcsr));
> -       }
> +               memset(fx, 0, sizeof(*fx));
> +               fx->cwd = 0x37f;
> +               if (cpu_has_xmm) {
> +                       unsigned long __mxcsr = 0x1f80UL & 0xffbfUL;
> +                       fx->mxcsr = __mxcsr;
> +               }
> +
> +               clts();
> +
> +               __asm__ __volatile__("fxrstor %0": /* no output */
> :"m"(*fx));
> +       } else {
> +               struct i387_fsave_struct *fp = &fpup->fsave;
> +
> +               memset(fp, 0, sizeof(*fp));
> +               fp->cwd = 0xffff037fu;
> +               fp->swd = 0xffff0000u;
> +               fp->twd = 0xffffffffu;
> +               fp->fos = 0xffff0000u;
> +
> +               clts();
>
> +               __asm__ __volatile__("frstor %0": /* no output */
> :"m"(*fp));
> +       }
> +
>        if (task) {
>                /* Real-time shadow FPU initialization: tell Linux that this
>                   thread initialized its FPU hardware. The fpu usage bit is
>
>
>
> --
>                                             Gilles.
>

[-- Attachment #2: Type: text/html, Size: 12050 bytes --]

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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-11  0:07             ` Mark Saiia
@ 2008-11-11 11:21               ` Gilles Chanteperdrix
  2008-11-11 17:43                 ` Steven Seeger
  0 siblings, 1 reply; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-11 11:21 UTC (permalink / raw)
  To: Mark Saiia; +Cc: xenomai


Mark Saiia wrote:
> Hello,
>
> The patch would not apply cleanly(rejected Hunk) against 2.4.5
> w/linux2.6.26.3 or svn 4368 w/linux2.6.26.7.
> (...)
> Please let me know, if I did anything incorrectly, or if the patch was not
> completely posted.

No, I probably made the patch against 2.6.27, I did not test it. Could you
try the patch you made ?

-- 
                    Gilles.



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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-11 11:21               ` Gilles Chanteperdrix
@ 2008-11-11 17:43                 ` Steven Seeger
  2008-11-11 22:32                   ` Mark Saiia
  2008-11-12 13:48                   ` Steven Seeger
  0 siblings, 2 replies; 33+ messages in thread
From: Steven Seeger @ 2008-11-11 17:43 UTC (permalink / raw)
  To: Gilles Chanteperdrix, Mark Saiia; +Cc: xenomai

The problem was you declared x86_fpu_state instead of x86_fpustate. No
big deal.

Steven

> -----Original Message-----
> From: xenomai-help-bounces@domain.hid [mailto:xenomai-help-
> bounces@domain.hid] On Behalf Of Gilles Chanteperdrix
> Sent: Tuesday, November 11, 2008 4:21 AM
> To: Mark Saiia
> Cc: xenomai@xenomai.org
> Subject: Re: [Xenomai-help] fpu context switch issue
> 
> 
> Mark Saiia wrote:
> > Hello,
> >
> > The patch would not apply cleanly(rejected Hunk) against 2.4.5
> > w/linux2.6.26.3 or svn 4368 w/linux2.6.26.7.
> > (...)
> > Please let me know, if I did anything incorrectly, or if the patch
> was not
> > completely posted.
> 
> No, I probably made the patch against 2.6.27, I did not test it. Could
> you
> try the patch you made ?
> 
> --
>                     Gilles.
> 
> 
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help


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

* Re: [Xenomai-help] fpu context switch issue
  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
  2008-11-12 13:48                   ` Steven Seeger
  1 sibling, 2 replies; 33+ messages in thread
From: Mark Saiia @ 2008-11-11 22:32 UTC (permalink / raw)
  To: Steven Seeger; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 321 bytes --]

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,

Mark

[-- Attachment #2: Type: text/html, Size: 386 bytes --]

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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-11 22:32                   ` Mark Saiia
@ 2008-11-11 22:39                     ` Gilles Chanteperdrix
  2008-11-13 11:11                     ` Gilles Chanteperdrix
  1 sibling, 0 replies; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-11 22:39 UTC (permalink / raw)
  To: Mark Saiia; +Cc: xenomai

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.

So, fninit is not the culprit. What could happen is that we do not
really get an FPU fault upon first access to the FPU. To know this, we
should test the state of the ts bit before the first use of FPU in each
thread.

I will send a patch to do this.

-- 
					    Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-11 17:43                 ` Steven Seeger
  2008-11-11 22:32                   ` Mark Saiia
@ 2008-11-12 13:48                   ` Steven Seeger
  2008-11-12 13:52                     ` Gilles Chanteperdrix
  1 sibling, 1 reply; 33+ messages in thread
From: Steven Seeger @ 2008-11-12 13:48 UTC (permalink / raw)
  To: Gilles Chanteperdrix, Mark Saiia; +Cc: xenomai

Gilles, I am not sure why Mark didn't email the list yesterday. However,
the patch did not work. We still observe the behavior as described. :(
We never had this issue on our Geode GX1 board. The LX800 should be a
better chip. I continue to tell them to not touch anything with the word
"Geode" on it but for some reason they continue to do so.

Steven



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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-12 13:48                   ` Steven Seeger
@ 2008-11-12 13:52                     ` Gilles Chanteperdrix
  2008-11-12 13:53                       ` Steven Seeger
  0 siblings, 1 reply; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-12 13:52 UTC (permalink / raw)
  To: Steven Seeger; +Cc: xenomai

Steven Seeger wrote:
> Gilles, I am not sure why Mark didn't email the list yesterday. However,
> the patch did not work. We still observe the behavior as described. :(
> We never had this issue on our Geode GX1 board. The LX800 should be a
> better chip. I continue to tell them to not touch anything with the word
> "Geode" on it but for some reason they continue to do so.

I received Mark mail and even answered:

https://mail.gna.org/public/xenomai-help/2008-11/msg00100.html

-- 
                                                 Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-12 13:52                     ` Gilles Chanteperdrix
@ 2008-11-12 13:53                       ` Steven Seeger
  0 siblings, 0 replies; 33+ messages in thread
From: Steven Seeger @ 2008-11-12 13:53 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

That's weird. I wonder why I didn't get a copy on the list? I just found
the copy to me. Perhaps I should check my inbox instead of my xenomai
folder. :) Sorry.

Steven

> -----Original Message-----
> From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> Sent: Wednesday, November 12, 2008 6:52 AM
> To: Steven Seeger
> Cc: Mark Saiia; xenomai@xenomai.org
> Subject: Re: [Xenomai-help] fpu context switch issue
> 
> Steven Seeger wrote:
> > Gilles, I am not sure why Mark didn't email the list yesterday.
> However,
> > the patch did not work. We still observe the behavior as
> described. :(
> > We never had this issue on our Geode GX1 board. The LX800 should be
a
> > better chip. I continue to tell them to not touch anything with the
> word
> > "Geode" on it but for some reason they continue to do so.
> 
> I received Mark mail and even answered:
> 
> https://mail.gna.org/public/xenomai-help/2008-11/msg00100.html
> 
> --
>                                                  Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-11 22:32                   ` Mark Saiia
  2008-11-11 22:39                     ` Gilles Chanteperdrix
@ 2008-11-13 11:11                     ` Gilles Chanteperdrix
  2008-11-14  3:59                       ` Mark Saiia
  1 sibling, 1 reply; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-13 11:11 UTC (permalink / raw)
  To: Mark Saiia; +Cc: xenomai

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() */



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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-13 11:11                     ` Gilles Chanteperdrix
@ 2008-11-14  3:59                       ` Mark Saiia
  2008-11-14  8:42                         ` Gilles Chanteperdrix
  0 siblings, 1 reply; 33+ messages in thread
From: Mark Saiia @ 2008-11-14  3:59 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 2108 bytes --]

Gilles,

No noticeable difference using 2.4.5 w/ 2.6.26.3.  I was testing using the
app we first noticed the behavior on.  I will run the simple test program
tomorrow, but fully expect to see the erroneous behavior.  I also had the
chance to test the patch on a GX1 board, and noticed the error as well. We
have a version of the app, that I was testing today, running on 2.6.23.12 w/
Xenomai svn of around February 2008 (I don't have the revision number in
front of me at the moment) that works properly.

Thanks,

Mark


On Thu, Nov 13, 2008 at 3:11 AM, Gilles Chanteperdrix <
gilles.chanteperdrix@xenomai.org> wrote:

> 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() */
>
>

[-- Attachment #2: Type: text/html, Size: 3303 bytes --]

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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-14  3:59                       ` Mark Saiia
@ 2008-11-14  8:42                         ` Gilles Chanteperdrix
  2008-11-17 17:27                           ` Mark Saiia
  0 siblings, 1 reply; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-14  8:42 UTC (permalink / raw)
  To: Mark Saiia; +Cc: xenomai

Mark Saiia wrote:
> Gilles,
> 
> No noticeable difference using 2.4.5 w/ 2.6.26.3.  I was testing using the
> app we first noticed the behavior on.  I will run the simple test program
> tomorrow, but fully expect to see the erroneous behavior.  I also had the
> chance to test the patch on a GX1 board, and noticed the error as well. We
> have a version of the app, that I was testing today, running on 2.6.23.12 w/
> Xenomai svn of around February 2008 (I don't have the revision number in
> front of me at the moment) that works properly.

Could you test 2.6.23 with Xenomai 2.4.5? This way we would know if we
are looking for a problem in the I-pipe patch or in Xenomai.

-- 
					    Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  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
  0 siblings, 2 replies; 33+ messages in thread
From: Mark Saiia @ 2008-11-17 17:27 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]

Just a quick update.  I haven't had a chance to do as you suggested (2.6.23
w/2.4.5), but will get to it when I have a chance.  My previous post was
incorrect.  The older version of the app was somewhat different.  We
recreated the environment that was on on the app backup flash with Xenomai
2.6.23.12 w/ Xenomai r3415.  The newer version of the app still  exhibits
floating point errors on this older platform.  Yet we ran the simple test
program numerous times on the older platform and did not see any incorrect
behavior.  I am attempting to make a determination as to what in the larger
app causes the floating point issue to arise.

Mark

On Fri, Nov 14, 2008 at 12:42 AM, Gilles Chanteperdrix <
gilles.chanteperdrix@xenomai.org> wrote:

> Mark Saiia wrote:
> > Gilles,
> >
> > No noticeable difference using 2.4.5 w/ 2.6.26.3.  I was testing using
> the
> > app we first noticed the behavior on.  I will run the simple test program
> > tomorrow, but fully expect to see the erroneous behavior.  I also had the
> > chance to test the patch on a GX1 board, and noticed the error as well.
> We
> > have a version of the app, that I was testing today, running on
> 2.6.23.12 w/
> > Xenomai svn of around February 2008 (I don't have the revision number in
> > front of me at the moment) that works properly.
>
> Could you test 2.6.23 with Xenomai 2.4.5? This way we would know if we
> are looking for a problem in the I-pipe patch or in Xenomai.
>
> --
>                                             Gilles.
>

[-- Attachment #2: Type: text/html, Size: 2192 bytes --]

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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-17 17:27                           ` Mark Saiia
@ 2008-11-17 18:54                             ` Steven Seeger
  2008-11-19 18:51                             ` Steven Seeger
  1 sibling, 0 replies; 33+ messages in thread
From: Steven Seeger @ 2008-11-17 18:54 UTC (permalink / raw)
  To: Mark Saiia, Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 1919 bytes --]

Could this be a problem with the xenomai handles (or handled) userspace
threads? Is it worth seeing if we can recreate this problem in kernel
threads in insmod?

 

Steven

 

From: Mark Saiia [mailto:mark.saiia@domain.hid
Sent: Monday, November 17, 2008 10:27 AM
To: Gilles Chanteperdrix
Cc: Steven Seeger; xenomai@xenomai.org
Subject: Re: [Xenomai-help] fpu context switch issue

 

Just a quick update.  I haven't had a chance to do as you suggested
(2.6.23 w/2.4.5), but will get to it when I have a chance.  My previous
post was incorrect.  The older version of the app was somewhat
different.  We recreated the environment that was on on the app backup
flash with Xenomai 2.6.23.12 w/ Xenomai r3415.  The newer version of the
app still  exhibits floating point errors on this older platform.  Yet
we ran the simple test program numerous times on the older platform and
did not see any incorrect behavior.  I am attempting to make a
determination as to what in the larger app causes the floating point
issue to arise.

Mark

On Fri, Nov 14, 2008 at 12:42 AM, Gilles Chanteperdrix
<gilles.chanteperdrix@xenomai.org> wrote:

Mark Saiia wrote:
> Gilles,
>
> No noticeable difference using 2.4.5 w/ 2.6.26.3.  I was testing using
the
> app we first noticed the behavior on.  I will run the simple test
program
> tomorrow, but fully expect to see the erroneous behavior.  I also had
the
> chance to test the patch on a GX1 board, and noticed the error as
well. We
> have a version of the app, that I was testing today, running on
2.6.23.12 w/
> Xenomai svn of around February 2008 (I don't have the revision number
in
> front of me at the moment) that works properly.

Could you test 2.6.23 with Xenomai 2.4.5? This way we would know if we
are looking for a problem in the I-pipe patch or in Xenomai.

--
                                           Gilles.

 


[-- Attachment #2: Type: text/html, Size: 5441 bytes --]

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

* Re: [Xenomai-help] fpu context switch issue
  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
  1 sibling, 1 reply; 33+ messages in thread
From: Steven Seeger @ 2008-11-19 18:51 UTC (permalink / raw)
  To: Mark Saiia, Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 2105 bytes --]

Have there been any thoughts on this issue? We have reverted back to
2.6.23.12 with r3415 for now. Our apps (including the test I posted
earlier) work in this older environment. We'd like to use the newer
environment because many other bugs have been fixed.

 

BTW, the older environment works correctly on both our geode boards.

 

Thanks,

Steven

 

From: Mark Saiia [mailto:mark.saiia@domain.hid
Sent: Monday, November 17, 2008 10:27 AM
To: Gilles Chanteperdrix
Cc: Steven Seeger; xenomai@xenomai.org
Subject: Re: [Xenomai-help] fpu context switch issue

 

Just a quick update.  I haven't had a chance to do as you suggested
(2.6.23 w/2.4.5), but will get to it when I have a chance.  My previous
post was incorrect.  The older version of the app was somewhat
different.  We recreated the environment that was on on the app backup
flash with Xenomai 2.6.23.12 w/ Xenomai r3415.  The newer version of the
app still  exhibits floating point errors on this older platform.  Yet
we ran the simple test program numerous times on the older platform and
did not see any incorrect behavior.  I am attempting to make a
determination as to what in the larger app causes the floating point
issue to arise.

Mark

On Fri, Nov 14, 2008 at 12:42 AM, Gilles Chanteperdrix
<gilles.chanteperdrix@xenomai.org> wrote:

Mark Saiia wrote:
> Gilles,
>
> No noticeable difference using 2.4.5 w/ 2.6.26.3.  I was testing using
the
> app we first noticed the behavior on.  I will run the simple test
program
> tomorrow, but fully expect to see the erroneous behavior.  I also had
the
> chance to test the patch on a GX1 board, and noticed the error as
well. We
> have a version of the app, that I was testing today, running on
2.6.23.12 w/
> Xenomai svn of around February 2008 (I don't have the revision number
in
> front of me at the moment) that works properly.

Could you test 2.6.23 with Xenomai 2.4.5? This way we would know if we
are looking for a problem in the I-pipe patch or in Xenomai.

--
                                           Gilles.

 


[-- Attachment #2: Type: text/html, Size: 7866 bytes --]

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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-19 18:51                             ` Steven Seeger
@ 2008-11-20 12:43                               ` Gilles Chanteperdrix
  2008-11-20 13:51                                 ` Steven Seeger
  0 siblings, 1 reply; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-20 12:43 UTC (permalink / raw)
  To: Steven Seeger; +Cc: xenomai


Steven Seeger wrote:
> Have there been any thoughts on this issue? We have reverted back to
> 2.6.23.12 with r3415 for now. Our apps (including the test I posted
> earlier) work in this older environment. We'd like to use the newer
> environment because many other bugs have been fixed.
>
>
>
> BTW, the older environment works correctly on both our geode boards.

We need to know whether the issue comes from Xenomai or from the I-pipe.
So, to know this, we need you to test the 2.6.23 I-pipe patch with Xenomai
2.4.6.1. Unless I am mistaken and forgot to post a mail, I have already
asked you this.

-- 
                    Gilles.



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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-20 12:43                               ` Gilles Chanteperdrix
@ 2008-11-20 13:51                                 ` Steven Seeger
  2008-11-21 17:03                                   ` Mark Saiia
  0 siblings, 1 reply; 33+ messages in thread
From: Steven Seeger @ 2008-11-20 13:51 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

I believe that you did already post this. Just so you know the situation
I don't work at Mark's company anymore. I just help them out from time
to time. I'm about 800 miles away now so I don't know everything that
he's done. I'll be sure to hound him about it today.

Thanks,
Steven

> -----Original Message-----
> From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> Sent: Thursday, November 20, 2008 5:44 AM
> To: Steven Seeger
> Cc: Mark Saiia; Gilles Chanteperdrix; xenomai@xenomai.org
> Subject: RE: [Xenomai-help] fpu context switch issue
> 
> 
> Steven Seeger wrote:
> > Have there been any thoughts on this issue? We have reverted back to
> > 2.6.23.12 with r3415 for now. Our apps (including the test I posted
> > earlier) work in this older environment. We'd like to use the newer
> > environment because many other bugs have been fixed.
> >
> >
> >
> > BTW, the older environment works correctly on both our geode boards.
> 
> We need to know whether the issue comes from Xenomai or from the
I-pipe.
> So, to know this, we need you to test the 2.6.23 I-pipe patch with
> Xenomai
> 2.4.6.1. Unless I am mistaken and forgot to post a mail, I have
already
> asked you this.
> 
> --
>                     Gilles.



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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-20 13:51                                 ` Steven Seeger
@ 2008-11-21 17:03                                   ` Mark Saiia
  2008-11-21 17:07                                     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 33+ messages in thread
From: Mark Saiia @ 2008-11-21 17:03 UTC (permalink / raw)
  To: Steven Seeger; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 1616 bytes --]

I finally had a chance to patch 2.6.23.12 w/ Xenomai-2.4.5.  Both the simple
test and larger apps worked incorrectly (i.e. had the same floating point
issues as described before).   What should the next step be?


Thanks,

Mark



On Thu, Nov 20, 2008 at 5:51 AM, Steven Seeger <
sseeger@domain.hid> wrote:

> I believe that you did already post this. Just so you know the situation
> I don't work at Mark's company anymore. I just help them out from time
> to time. I'm about 800 miles away now so I don't know everything that
> he's done. I'll be sure to hound him about it today.
>
> Thanks,
> Steven
>
> > -----Original Message-----
> > From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
> > Sent: Thursday, November 20, 2008 5:44 AM
> > To: Steven Seeger
> > Cc: Mark Saiia; Gilles Chanteperdrix; xenomai@xenomai.org
> > Subject: RE: [Xenomai-help] fpu context switch issue
> >
> >
> > Steven Seeger wrote:
> > > Have there been any thoughts on this issue? We have reverted back to
> > > 2.6.23.12 with r3415 for now. Our apps (including the test I posted
> > > earlier) work in this older environment. We'd like to use the newer
> > > environment because many other bugs have been fixed.
> > >
> > >
> > >
> > > BTW, the older environment works correctly on both our geode boards.
> >
> > We need to know whether the issue comes from Xenomai or from the
> I-pipe.
> > So, to know this, we need you to test the 2.6.23 I-pipe patch with
> > Xenomai
> > 2.4.6.1. Unless I am mistaken and forgot to post a mail, I have
> already
> > asked you this.
> >
> > --
> >                     Gilles.
>
>

[-- Attachment #2: Type: text/html, Size: 2480 bytes --]

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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-21 17:03                                   ` Mark Saiia
@ 2008-11-21 17:07                                     ` Gilles Chanteperdrix
  2008-11-26 10:47                                       ` Gilles Chanteperdrix
  0 siblings, 1 reply; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-21 17:07 UTC (permalink / raw)
  To: Mark Saiia; +Cc: xenomai

Mark Saiia wrote:
> I finally had a chance to patch 2.6.23.12 w/ Xenomai-2.4.5.  Both the simple
> test and larger apps worked incorrectly (i.e. had the same floating point
> issues as described before).   What should the next step be?

The next step is for me to look at the differences between 2.4.5 and the
version of Xenomai which works for you and try and imagine what could be
the problem.

-- 
                                                 Gilles.


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

* Re: [Xenomai-help] fpu context switch issue
  2008-11-21 17:07                                     ` Gilles Chanteperdrix
@ 2008-11-26 10:47                                       ` Gilles Chanteperdrix
  0 siblings, 0 replies; 33+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-26 10:47 UTC (permalink / raw)
  To: Mark Saiia; +Cc: xenomai

Gilles Chanteperdrix wrote:
> Mark Saiia wrote:
>> I finally had a chance to patch 2.6.23.12 w/ Xenomai-2.4.5.  Both the simple
>> test and larger apps worked incorrectly (i.e. had the same floating point
>> issues as described before).   What should the next step be?
> 
> The next step is for me to look at the differences between 2.4.5 and the
> version of Xenomai which works for you and try and imagine what could be
> the problem.

Ok. The version you are talking about (r3415) is rather old. Could you
try to do a bisection in Xenomai revisions to tell me which commit
causes the bug you observe ?

-- 
                                                 Gilles.


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

end of thread, other threads:[~2008-11-26 10:47 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.