public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman•id.au>
To: Markus Stockhausen <stockhausen@collogia•de>
Cc: "linuxppc-dev@lists•ozlabs.org" <linuxppc-dev@lists•ozlabs.org>
Subject: Re: How to make use of SPE instructions?
Date: Fri, 16 Jan 2015 09:38:38 +1100	[thread overview]
Message-ID: <1421361518.23332.3.camel@ellerman.id.au> (raw)
In-Reply-To: <12EF8D94C6F8734FB2FF37B9FBEDD1735F90DD25@EXCHANGE.collogia.de>

On Thu, 2015-01-08 at 09:58 +0000, Markus Stockhausen wrote:
> Hello,
> 
> I developed a SHA224/256 kernel crypto module with SPE instructions.
> The result looks quite promising (~ +50% speedup). Nevertheless the
> flooding of kernel messages "SPE used in kernel" makes me feel 
> uncomfortable.
> 
> My findings so far:
> 
> - I can configure the kernel with "SPE support". 
> - arch/powerpc/kernel/head_fsl_booke.S suggests that the message is
>   triggerd unconditionally whenwever we make use of SPE in kernel.
> - There exists a function enable_kernel_spe() but I don't know how
>   this could help me in my work.
> 
> I guess I need some kind of "brackets" around my coding to make sure 
> the upper 32 bit of the registers are stored correctly during task switch. 
> Or is the use of SPE instructions inside the kernel totally forbidden? Any 
> expert with some helpful advise?

I don't know about SPE specifically, hopefully someone from FSL can chime in.

But, IIUIC you should just be able to call enable_kernel_spe() prior to your
code, ie. before you execute any SPE instructions. That will save any values
userspace has left in the SPE regs, and then enable SPE for you in the kernel.
That should get rid of the "SPE used in kernel" messages.  

cheers

  reply	other threads:[~2015-01-15 22:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08  9:58 How to make use of SPE instructions? Markus Stockhausen
2015-01-15 22:38 ` Michael Ellerman [this message]
2015-01-15 22:56 ` Scott Wood
2015-01-16  5:27   ` AW: " Markus Stockhausen
2015-01-20  7:38     ` Scott Wood

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=1421361518.23332.3.camel@ellerman.id.au \
    --to=mpe@ellerman$(echo .)id.au \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=stockhausen@collogia$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox