linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/3] SHA256 for PPC/SPE
@ 2015-01-24 21:10 Markus Stockhausen
  2015-01-26  0:18 ` Herbert Xu
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Stockhausen @ 2015-01-24 21:10 UTC (permalink / raw)
  To: linux-crypto; +Cc: linuxppc-dev

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

[PATCH v1 0/3] SHA256 for PPC/SPE

The following patches add support for SIMD accelerated SHA256 
calculation on PPC processors with SPE instruction set. The 
implementation takes care of the following constraints:

- independant of processor endianess
- fallback to generic code if called from interrupt context
- disable preemtion only for short intervals

Performance numbers from insmod tcrypt sec=3 mode=304 taken
on e500v2 800 MHz (TP Link WDR4900)

data    per      generic     this patch  speedup  cycles
length  update   bytes/sec   bytes/sec   factor   per byte
------  -------  ----------  ----------  -------  --------
    16       16   5,558,336   8,248,272	  x1.48      96.99
    64       16  10,730,602  14,872,789   x1.38      53.79
    64       64  12,841,621  19,268,885   x1.50      41.52
   256       16  16,223,317  21,295,957   x1.31      37.57
   256       64  21,135,957  30,941,696   x1.46      25,86
   256      256	 22,664,448  35,765,845   x1.57      22,37
  1024       16  18,608,128  23,893,674   x1.28      33.48
  1024      256  27,427,840  43,427,498   x1.58      18.42
  1024     1024  28,064,768  45,659,136   x1.62      17.52
  2048       16  19,054,592  24,425,130   x1.28      32.75
  2048      256  28,435,797  45,087,402   x1.58      17.74
  2048     1024  29,091,157  47,395,498   x1.62      16.88
  2048     2048  29,225,642  47,756,629   x1.63      16.75

[-- Attachment #2: InterScan_Disclaimer.txt --]
[-- Type: text/plain, Size: 1650 bytes --]

****************************************************************************
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.

Über das Internet versandte E-Mails können unter fremden Namen erstellt oder
manipuliert werden. Deshalb ist diese als E-Mail verschickte Nachricht keine
rechtsverbindliche Willenserklärung.

Collogia
Unternehmensberatung AG
Ubierring 11
D-50678 Köln

Vorstand:
Kadir Akin
Dr. Michael Höhnerbach

Vorsitzender des Aufsichtsrates:
Hans Kristian Langva

Registergericht: Amtsgericht Köln
Registernummer: HRB 52 497

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

e-mails sent over the internet may have been written under a wrong name or
been manipulated. That is why this message sent as an e-mail is not a
legally binding declaration of intention.

Collogia
Unternehmensberatung AG
Ubierring 11
D-50678 Köln

executive board:
Kadir Akin
Dr. Michael Höhnerbach

President of the supervisory board:
Hans Kristian Langva

Registry office: district court Cologne
Register number: HRB 52 497

****************************************************************************

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

* Re: [PATCH v1 0/3] SHA256 for PPC/SPE
  2015-01-24 21:10 Markus Stockhausen
@ 2015-01-26  0:18 ` Herbert Xu
  2015-01-26  5:19   ` Markus Stockhausen
  0 siblings, 1 reply; 5+ messages in thread
From: Herbert Xu @ 2015-01-26  0:18 UTC (permalink / raw)
  To: Markus Stockhausen; +Cc: linuxppc-dev, linux-crypto

Markus Stockhausen <stockhausen@collogia.de> wrote:
> 
> [PATCH v1 0/3] SHA256 for PPC/SPE
> 
> The following patches add support for SIMD accelerated SHA256 
> calculation on PPC processors with SPE instruction set. The 
> implementation takes care of the following constraints:
> 
> - independant of processor endianess
> - fallback to generic code if called from interrupt context
> - disable preemtion only for short intervals

Thanks for the patch! Unfortunately the interrupt context test
is a bummer because that means your code won't be used by IPsec
at all.

Would it be possible to relax the conditions similar to sha1_ssse3
on x86? If not how about going async with cryptd?

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH v1 0/3] SHA256 for PPC/SPE
  2015-01-26  0:18 ` Herbert Xu
@ 2015-01-26  5:19   ` Markus Stockhausen
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Stockhausen @ 2015-01-26  5:19 UTC (permalink / raw)
  To: Herbert Xu, linuxppc-dev@lists.ozlabs.org; +Cc: linux-crypto@vger.kernel.org

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

> Von: linux-crypto-owner@vger.kernel.org [linux-crypto-owner@vger.kernel.org]&quot; im Auftrag von &quot;Herbert Xu [herbert@gondor.apana.org.au]
> Gesendet: Montag, 26. Januar 2015 01:18
> An: Markus Stockhausen
> Cc: linux-crypto@vger.kernel.org; linuxppc-dev@lists.ozlabs.org
> Betreff: Re: [PATCH v1 0/3] SHA256 for PPC/SPE
> 
> Markus Stockhausen <stockhausen@collogia.de> wrote:
> >
> >  [PATCH v1 0/3] SHA256 for PPC/SPE
> >
> > The following patches add support for SIMD accelerated SHA256
> > calculation on PPC processors with SPE instruction set. The
> > implementation takes care of the following constraints:
> >
> > - independant of processor endianess
> > - fallback to generic code if called from interrupt context
> > - disable preemtion only for short intervals
> 
> Thanks for the patch! Unfortunately the interrupt context test
> is a bummer because that means your code won't be used by IPsec
> at all.
> 
> Would it be possible to relax the conditions similar to sha1_ssse3
> on x86? If not how about going async with cryptd?

@Herbert: thanks for that annotation. IPsec is the desired use case.
Do you have a programming template for the cryptd integration?
E.g. ghash-clmulni-intel_glue.c?

@linuxppc: Intel world checks for usable FPU (SSE3, ...) in the crypto 
modules with

bool irq_fpu_usable(void)
{
  return !in_interrupt() ||
    interrupted_user_mode() ||
    interrupted_kernel_fpu_idle();
}

I guess interrupted_kernel_fpu_idle() is the part that allows IPsec 
inside an interrupt to make use of the accelerated module. 
Explanation reads:

* On others, we can do a kernel_fpu_begin/end() pair *ONLY* if 
* that pair does nothing at all: the thread must not have fpu (so
* that we don't try to save the FPU state), and TS must
* be set (so that the clts/stts pair does nothing that is
* visible in the interrupted kernel thread).

Do I have the chance to use something similiar in the PPC/SPE 
case? Or is there a simple way like saving the SPE registers
myself?

Thanks in advance.

Markus=

[-- Attachment #2: InterScan_Disclaimer.txt --]
[-- Type: text/plain, Size: 1650 bytes --]

****************************************************************************
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.

Über das Internet versandte E-Mails können unter fremden Namen erstellt oder
manipuliert werden. Deshalb ist diese als E-Mail verschickte Nachricht keine
rechtsverbindliche Willenserklärung.

Collogia
Unternehmensberatung AG
Ubierring 11
D-50678 Köln

Vorstand:
Kadir Akin
Dr. Michael Höhnerbach

Vorsitzender des Aufsichtsrates:
Hans Kristian Langva

Registergericht: Amtsgericht Köln
Registernummer: HRB 52 497

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

e-mails sent over the internet may have been written under a wrong name or
been manipulated. That is why this message sent as an e-mail is not a
legally binding declaration of intention.

Collogia
Unternehmensberatung AG
Ubierring 11
D-50678 Köln

executive board:
Kadir Akin
Dr. Michael Höhnerbach

President of the supervisory board:
Hans Kristian Langva

Registry office: district court Cologne
Register number: HRB 52 497

****************************************************************************

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

* Re: [PATCH v1 0/3] SHA256 for PPC/SPE
       [not found] <5ad377b3-e491-4c35-8b89-de1dfd0749a6__44574.29146064$1422133918$gmane$org@EXCHANGE.collogia.de>
@ 2015-01-30 12:02 ` Conor O'Gorman
  2015-01-30 13:41   ` AW: " Markus Stockhausen
  0 siblings, 1 reply; 5+ messages in thread
From: Conor O'Gorman @ 2015-01-30 12:02 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linuxppc-dev

On 24/01/15 21:10, Markus Stockhausen wrote:
> [PATCH v1 0/3] SHA256 for PPC/SPE
>
> The following patches add support for SIMD accelerated SHA256
> calculation on PPC processors with SPE instruction set. The

Nice boost.

Many of the SoCs with e500 core have crypto hardware accelerators. How 
does this compare?

Thanks,
Conor

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

* AW: [PATCH v1 0/3] SHA256 for PPC/SPE
  2015-01-30 12:02 ` [PATCH v1 0/3] SHA256 for PPC/SPE Conor O'Gorman
@ 2015-01-30 13:41   ` Markus Stockhausen
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Stockhausen @ 2015-01-30 13:41 UTC (permalink / raw)
  To: Conor O'Gorman, linux-crypto@vger.kernel.org
  Cc: linuxppc-dev@lists.ozlabs.org

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

> Von: Conor O'Gorman [i@conorogorman.net]
> Gesendet: Freitag, 30. Januar 2015 13:02
> An: Markus Stockhausen; linux-crypto@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Betreff: Re: [PATCH v1 0/3] SHA256 for PPC/SPE
> 
> On 24/01/15 21:10, Markus Stockhausen wrote:
> > [PATCH v1 0/3] SHA256 for PPC/SPE
> >
> > The following patches add support for SIMD accelerated SHA256
> > calculation on PPC processors with SPE instruction set. The
> 
> Nice boost.
> 
> Many of the SoCs with e500 core have crypto hardware accelerators. How
> does this compare?

May sound stupid but I failed to activate the device in my TP-Link WDR4900.
The whole story here: https://community.freescale.com/message/475816

Markus
=

[-- Attachment #2: InterScan_Disclaimer.txt --]
[-- Type: text/plain, Size: 1650 bytes --]

****************************************************************************
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.

Über das Internet versandte E-Mails können unter fremden Namen erstellt oder
manipuliert werden. Deshalb ist diese als E-Mail verschickte Nachricht keine
rechtsverbindliche Willenserklärung.

Collogia
Unternehmensberatung AG
Ubierring 11
D-50678 Köln

Vorstand:
Kadir Akin
Dr. Michael Höhnerbach

Vorsitzender des Aufsichtsrates:
Hans Kristian Langva

Registergericht: Amtsgericht Köln
Registernummer: HRB 52 497

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

e-mails sent over the internet may have been written under a wrong name or
been manipulated. That is why this message sent as an e-mail is not a
legally binding declaration of intention.

Collogia
Unternehmensberatung AG
Ubierring 11
D-50678 Köln

executive board:
Kadir Akin
Dr. Michael Höhnerbach

President of the supervisory board:
Hans Kristian Langva

Registry office: district court Cologne
Register number: HRB 52 497

****************************************************************************

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

end of thread, other threads:[~2015-01-30 13:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <5ad377b3-e491-4c35-8b89-de1dfd0749a6__44574.29146064$1422133918$gmane$org@EXCHANGE.collogia.de>
2015-01-30 12:02 ` [PATCH v1 0/3] SHA256 for PPC/SPE Conor O'Gorman
2015-01-30 13:41   ` AW: " Markus Stockhausen
2015-01-24 21:10 Markus Stockhausen
2015-01-26  0:18 ` Herbert Xu
2015-01-26  5:19   ` Markus Stockhausen

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).