linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* MPC8540 : What's "SPE used in kernel" ?
       [not found] <20080221123534.GA17716@ingate.macqel>
@ 2008-02-22  9:50 ` Philippe De Muyter
  2008-02-22 15:29   ` Johannes Berg
                     ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Philippe De Muyter @ 2008-02-22  9:50 UTC (permalink / raw)
  To: linuxppc-dev

Dear list,

I have just compiled linux-2.6.24 for a MPC8540 target using a MPC8540
specific gcc.

I then got tan infinity of "SPE used in kernel" messages.  Looking at the
sources I ifdeffed out the printk call in KernelSPE, and I now have a
silent kernel, that seems to work fine.

Is there something wrong in my setting and should I look further to
debug this problem or is this perfectly normal ?

I wonder why a kernel configured for E500 and compiled by a E500-specific gcc
triggers this message.  Is it invalid to use SPE instructions in the kernel 
or do I misunderstand the message ?

Philippe

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

* Re: MPC8540 : What's "SPE used in kernel" ?
  2008-02-22  9:50 ` MPC8540 : What's "SPE used in kernel" ? Philippe De Muyter
@ 2008-02-22 15:29   ` Johannes Berg
  2008-02-22 18:33   ` Andy Fleming
  2008-02-25 14:47   ` E500 linux : are the 64-bit GPRs context-switched ? Philippe De Muyter
  2 siblings, 0 replies; 11+ messages in thread
From: Johannes Berg @ 2008-02-22 15:29 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: linuxppc-dev

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


> I wonder why a kernel configured for E500 and compiled by a E500-specific gcc
> triggers this message.  Is it invalid to use SPE instructions in the kernel 
> or do I misunderstand the message ?

I think it's like floating point/altivec, we don't always save the FP
registers on kernel/userspace transitions and so have to explicitly save
them to use them in the kernel, otherwise we'd clobber the userspace
register state.

I guess there's something like kernel_enter_spe()?

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: MPC8540 : What's "SPE used in kernel" ?
  2008-02-22  9:50 ` MPC8540 : What's "SPE used in kernel" ? Philippe De Muyter
  2008-02-22 15:29   ` Johannes Berg
@ 2008-02-22 18:33   ` Andy Fleming
  2008-02-23  9:24     ` Philippe De Muyter
  2008-02-25 14:47   ` E500 linux : are the 64-bit GPRs context-switched ? Philippe De Muyter
  2 siblings, 1 reply; 11+ messages in thread
From: Andy Fleming @ 2008-02-22 18:33 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: linuxppc-dev


On Feb 22, 2008, at 03:50, Philippe De Muyter wrote:

> Dear list,
>
> I have just compiled linux-2.6.24 for a MPC8540 target using a MPC8540
> specific gcc.
>
> I then got tan infinity of "SPE used in kernel" messages.  Looking  
> at the
> sources I ifdeffed out the printk call in KernelSPE, and I now have a
> silent kernel, that seems to work fine.
>
> Is there something wrong in my setting and should I look further to
> debug this problem or is this perfectly normal ?
>
> I wonder why a kernel configured for E500 and compiled by a E500- 
> specific gcc
> triggers this message.  Is it invalid to use SPE instructions in  
> the kernel
> or do I misunderstand the message ?


We don't currently support using SPE in the kernel.  Are you using  
SPE in the kernel for some reason?  Do you think that the compiler is  
automatically generating SPE code in the kernel?  I've never seen  
that before.

Andy

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

* Re: MPC8540 : What's "SPE used in kernel" ?
  2008-02-22 18:33   ` Andy Fleming
@ 2008-02-23  9:24     ` Philippe De Muyter
  2008-02-23  9:51       ` Johannes Berg
  0 siblings, 1 reply; 11+ messages in thread
From: Philippe De Muyter @ 2008-02-23  9:24 UTC (permalink / raw)
  To: Andy Fleming; +Cc: linuxppc-dev

On Fri, Feb 22, 2008 at 12:33:19PM -0600, Andy Fleming wrote:
>
> On Feb 22, 2008, at 03:50, Philippe De Muyter wrote:
>
>> Dear list,
>>
>> I have just compiled linux-2.6.24 for a MPC8540 target using a MPC8540
>> specific gcc.
>>
>> I then got tan infinity of "SPE used in kernel" messages.  Looking at the
>> sources I ifdeffed out the printk call in KernelSPE, and I now have a
>> silent kernel, that seems to work fine.
>>
>> Is there something wrong in my setting and should I look further to
>> debug this problem or is this perfectly normal ?
>>
>> I wonder why a kernel configured for E500 and compiled by a E500-specific 
>> gcc
>> triggers this message.  Is it invalid to use SPE instructions in the 
>> kernel
>> or do I misunderstand the message ?
>
>
> We don't currently support using SPE in the kernel.  Are you using SPE in 
> the kernel for some reason?  Do you think that the compiler is 
> automatically generating SPE code in the kernel?  I've never seen that 
> before.
>
> Andy

I have bought a modified CLFS installation targetting by default a MPC8540.
By default my powerpc compiler thus generates also SPE instructions.
And I built linux using that compiler.

My first trial used ARCH=ppc and caused this infinity of "SPE used in kernel"
messages, but I then recompiled linux with ARCH=powerpc.  With the message
not ifdef'ed out, this second kernel does not emit "SPE used in kernel"
messages, but I noticed problems with processes dying unexpectedly
(like in the first one, but after my first mail to the list).

Do you by chance know which MPC8540 registers are not saved by the kernel ?

Philippe

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

* Re: MPC8540 : What's "SPE used in kernel" ?
  2008-02-23  9:24     ` Philippe De Muyter
@ 2008-02-23  9:51       ` Johannes Berg
  2008-02-23 10:17         ` Philippe De Muyter
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2008-02-23  9:51 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: linuxppc-dev

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


> My first trial used ARCH=ppc and caused this infinity of "SPE used in kernel"
> messages, but I then recompiled linux with ARCH=powerpc.  With the message
> not ifdef'ed out, this second kernel does not emit "SPE used in kernel"
> messages,

If I were to venture a guess I'd point to the fact that the arch/powerpc
Makefile contains

# No SPE instruction when building kernel
KBUILD_CFLAGS += $(call cc-option,-mno-spe)  

while the arch/ppc one doesn't.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: MPC8540 : What's "SPE used in kernel" ?
  2008-02-23  9:51       ` Johannes Berg
@ 2008-02-23 10:17         ` Philippe De Muyter
  2008-02-23 10:25           ` Johannes Berg
  0 siblings, 1 reply; 11+ messages in thread
From: Philippe De Muyter @ 2008-02-23 10:17 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linuxppc-dev

Hi Johanness,

On Sat, Feb 23, 2008 at 10:51:08AM +0100, Johannes Berg wrote:
> 
> > My first trial used ARCH=ppc and caused this infinity of "SPE used in kernel"
> > messages, but I then recompiled linux with ARCH=powerpc.  With the message
> > not ifdef'ed out, this second kernel does not emit "SPE used in kernel"
> > messages,
> 
> If I were to venture a guess I'd point to the fact that the arch/powerpc
> Makefile contains
> 
> # No SPE instruction when building kernel
> KBUILD_CFLAGS += $(call cc-option,-mno-spe)  

OK, that's a good point.

But as I said in the same mail, processes still dies unexpectedly.

> 
> while the arch/ppc one doesn't.
> 
> johannes

Philippe

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

* Re: MPC8540 : What's "SPE used in kernel" ?
  2008-02-23 10:17         ` Philippe De Muyter
@ 2008-02-23 10:25           ` Johannes Berg
  2008-02-26  7:39             ` Kumar Gala
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2008-02-23 10:25 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: linuxppc-dev

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


> But as I said in the same mail, processes still dies unexpectedly.

Yeah, no idea though. I guess you could try putting that into the
arch/ppc Makefile, but arch/ppc will be removed this year so you don't
want to rely on it.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* E500 linux : are the 64-bit GPRs context-switched ?
  2008-02-22  9:50 ` MPC8540 : What's "SPE used in kernel" ? Philippe De Muyter
  2008-02-22 15:29   ` Johannes Berg
  2008-02-22 18:33   ` Andy Fleming
@ 2008-02-25 14:47   ` Philippe De Muyter
  2008-02-25 16:58     ` Scott Wood
  2 siblings, 1 reply; 11+ messages in thread
From: Philippe De Muyter @ 2008-02-25 14:47 UTC (permalink / raw)
  To: linuxppc-dev

Dear ppclinux gurus,

I have just compiled linux-2.6.24 for a MPC8540 target using a MPC8540
specific gcc.

After my first attempt using ARCH=ppc, leading to an infinity of messages :
"SPE used in kernel", I recompiled the whole kernel sources using
the default ARCH (ARCH=powerpc).  I now have a kernel that does not complain
about "SPE used in kernel", but user processes still crash ramdomly.

Searching around, I learned that the E500 GPR registers are 64-bits wide,
and gcc targetted for powerpc-linuxspe uses them sometimes.  In the other
PPC32 targets, those registers are 32-bits wide.

The specific E500 64-bit move instructions are `evstdd' and `evldd'.
I searched in the linux kernel sources (2.6.24) but did not find where
those GPR registers could be saved in 64-bit mode for context-switch.

Is there a patch pending somewhere to preserve the E500 GPR's in 64-bit mode
for context-switch ?

Philippe

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

* Re: E500 linux : are the 64-bit GPRs context-switched ?
  2008-02-25 14:47   ` E500 linux : are the 64-bit GPRs context-switched ? Philippe De Muyter
@ 2008-02-25 16:58     ` Scott Wood
  0 siblings, 0 replies; 11+ messages in thread
From: Scott Wood @ 2008-02-25 16:58 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: linuxppc-dev

On Mon, Feb 25, 2008 at 03:47:22PM +0100, Philippe De Muyter wrote:
> Searching around, I learned that the E500 GPR registers are 64-bits wide,
> and gcc targetted for powerpc-linuxspe uses them sometimes.  In the other
> PPC32 targets, those registers are 32-bits wide.
> 
> The specific E500 64-bit move instructions are `evstdd' and `evldd'.
> I searched in the linux kernel sources (2.6.24) but did not find where
> those GPR registers could be saved in 64-bit mode for context-switch.

giveup_spe and load_up_spe.

-Scott

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

* Re: MPC8540 : What's "SPE used in kernel" ?
  2008-02-23 10:25           ` Johannes Berg
@ 2008-02-26  7:39             ` Kumar Gala
  2008-02-26 10:34               ` Philippe De Muyter
  0 siblings, 1 reply; 11+ messages in thread
From: Kumar Gala @ 2008-02-26  7:39 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linuxppc-dev, Philippe De Muyter


On Feb 23, 2008, at 4:25 AM, Johannes Berg wrote:

>
>> But as I said in the same mail, processes still dies unexpectedly.
>
> Yeah, no idea though. I guess you could try putting that into the
> arch/ppc Makefile, but arch/ppc will be removed this year so you don't
> want to rely on it.

Its been removed (or will be for 2.6.25).

What compiler version are you using?

- k

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

* Re: MPC8540 : What's "SPE used in kernel" ?
  2008-02-26  7:39             ` Kumar Gala
@ 2008-02-26 10:34               ` Philippe De Muyter
  0 siblings, 0 replies; 11+ messages in thread
From: Philippe De Muyter @ 2008-02-26 10:34 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Johannes Berg

Hi Kumar,

On Tue, Feb 26, 2008 at 01:39:20AM -0600, Kumar Gala wrote:
>
> On Feb 23, 2008, at 4:25 AM, Johannes Berg wrote:
>
>>
>>> But as I said in the same mail, processes still dies unexpectedly.
>>
>> Yeah, no idea though. I guess you could try putting that into the
>> arch/ppc Makefile, but arch/ppc will be removed this year so you don't
>> want to rely on it.
>
> Its been removed (or will be for 2.6.25).
>
> What compiler version are you using?

a gcc-4.2.1 derivative from codesourcery (4.2-50) that I needed to compile
eglibc for e500 and that I tweaked to use it with CLFS and that I compiled
with --host=powerpc-linuxspe.  I now noticed that it still generates
spe insn's even when given '-mno-spe'.

I am now busy to retest with a vanilla powerpc-linuxspe-gcc-4.2.2 and
that seems to work fine.  I don't think, though, that it is able to compile
eglibc for e500.

Thanks for the attention, and sorry for the noise.

Philippe

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

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

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20080221123534.GA17716@ingate.macqel>
2008-02-22  9:50 ` MPC8540 : What's "SPE used in kernel" ? Philippe De Muyter
2008-02-22 15:29   ` Johannes Berg
2008-02-22 18:33   ` Andy Fleming
2008-02-23  9:24     ` Philippe De Muyter
2008-02-23  9:51       ` Johannes Berg
2008-02-23 10:17         ` Philippe De Muyter
2008-02-23 10:25           ` Johannes Berg
2008-02-26  7:39             ` Kumar Gala
2008-02-26 10:34               ` Philippe De Muyter
2008-02-25 14:47   ` E500 linux : are the 64-bit GPRs context-switched ? Philippe De Muyter
2008-02-25 16:58     ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).