Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1391187 > unrolled thread

[PATCH] crypto: vmx - comply with ABIs that specify vrsave as reserved.

Started byPaulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
First post2016-04-29 16:20 +0200
Last post2016-05-10 12:00 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] crypto: vmx - comply with ABIs that specify vrsave as reserved. Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com> - 2016-04-29 16:20 +0200
    Re: [PATCH] crypto: vmx - comply with ABIs that specify vrsave as  reserved. Herbert Xu <herbert@gondor.apana.org.au> - 2016-05-03 10:20 +0200
      [PATCH] crypto: vmx - comply with ABIs that specify vrsave as reserved. Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com> - 2016-05-05 16:10 +0200
        Re: [PATCH] crypto: vmx - comply with ABIs that specify vrsave as  reserved. Herbert Xu <herbert@gondor.apana.org.au> - 2016-05-10 12:00 +0200

#1391187 — [PATCH] crypto: vmx - comply with ABIs that specify vrsave as reserved.

FromPaulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
Date2016-04-29 16:20 +0200
Subject[PATCH] crypto: vmx - comply with ABIs that specify vrsave as reserved.
Message-ID<rthqW-7qz-11@gated-at.bofh.it>
It gives significant improvements ( ~+15%) on some modes.

These code has been adopted from OpenSSL project in collaboration
with the original author (Andy Polyakov <appro@openssl.org>).
---
 drivers/crypto/vmx/ppc-xlate.pl | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/crypto/vmx/ppc-xlate.pl b/drivers/crypto/vmx/ppc-xlate.pl
index b999733..9f4994c 100644
--- a/drivers/crypto/vmx/ppc-xlate.pl
+++ b/drivers/crypto/vmx/ppc-xlate.pl
@@ -139,6 +139,26 @@ my $vmr = sub {
     "	vor	$vx,$vy,$vy";
 };
 
+# Some ABIs specify vrsave, special-purpose register #256, as reserved
+# for system use.
+my $no_vrsave = ($flavour =~ /aix|linux64le/);
+my $mtspr = sub {
+    my ($f,$idx,$ra) = @_;
+    if ($idx == 256 && $no_vrsave) {
+	"	or	$ra,$ra,$ra";
+    } else {
+	"	mtspr	$idx,$ra";
+    }
+};
+my $mfspr = sub {
+    my ($f,$rd,$idx) = @_;
+    if ($idx == 256 && $no_vrsave) {
+	"	li	$rd,-1";
+    } else {
+	"	mfspr	$rd,$idx";
+    }
+};
+
 # PowerISA 2.06 stuff
 sub vsxmem_op {
     my ($f, $vrt, $ra, $rb, $op) = @_;
-- 
2.5.0

[toc] | [next] | [standalone]


#1393152 — Re: [PATCH] crypto: vmx - comply with ABIs that specify vrsave as reserved.

FromHerbert Xu <herbert@gondor.apana.org.au>
Date2016-05-03 10:20 +0200
SubjectRe: [PATCH] crypto: vmx - comply with ABIs that specify vrsave as reserved.
Message-ID<ruDIK-4pf-5@gated-at.bofh.it>
In reply to#1391187
On Fri, Apr 29, 2016 at 11:03:05AM -0300, Paulo Flabiano Smorigo wrote:
> It gives significant improvements ( ~+15%) on some modes.
> 
> These code has been adopted from OpenSSL project in collaboration
> with the original author (Andy Polyakov <appro@openssl.org>).

No sign-off.
-- 
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

[toc] | [prev] | [next] | [standalone]


#1395141

FromPaulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
Date2016-05-05 16:10 +0200
Message-ID<rvs8y-1oa-17@gated-at.bofh.it>
In reply to#1393152
It gives significant improvements ( ~+15%) on some modes.

These code has been adopted from OpenSSL project in collaboration
with the original author (Andy Polyakov <appro@openssl.org>).

Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
---
 drivers/crypto/vmx/ppc-xlate.pl | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/crypto/vmx/ppc-xlate.pl b/drivers/crypto/vmx/ppc-xlate.pl
index b999733..9f4994c 100644
--- a/drivers/crypto/vmx/ppc-xlate.pl
+++ b/drivers/crypto/vmx/ppc-xlate.pl
@@ -139,6 +139,26 @@ my $vmr = sub {
     "	vor	$vx,$vy,$vy";
 };
 
+# Some ABIs specify vrsave, special-purpose register #256, as reserved
+# for system use.
+my $no_vrsave = ($flavour =~ /aix|linux64le/);
+my $mtspr = sub {
+    my ($f,$idx,$ra) = @_;
+    if ($idx == 256 && $no_vrsave) {
+	"	or	$ra,$ra,$ra";
+    } else {
+	"	mtspr	$idx,$ra";
+    }
+};
+my $mfspr = sub {
+    my ($f,$rd,$idx) = @_;
+    if ($idx == 256 && $no_vrsave) {
+	"	li	$rd,-1";
+    } else {
+	"	mfspr	$rd,$idx";
+    }
+};
+
 # PowerISA 2.06 stuff
 sub vsxmem_op {
     my ($f, $vrt, $ra, $rb, $op) = @_;
-- 
2.5.5

[toc] | [prev] | [next] | [standalone]


#1397911 — Re: [PATCH] crypto: vmx - comply with ABIs that specify vrsave as reserved.

FromHerbert Xu <herbert@gondor.apana.org.au>
Date2016-05-10 12:00 +0200
SubjectRe: [PATCH] crypto: vmx - comply with ABIs that specify vrsave as reserved.
Message-ID<rxcCm-8kL-7@gated-at.bofh.it>
In reply to#1395141
On Thu, May 05, 2016 at 11:09:27AM -0300, Paulo Flabiano Smorigo wrote:
> It gives significant improvements ( ~+15%) on some modes.
> 
> These code has been adopted from OpenSSL project in collaboration
> with the original author (Andy Polyakov <appro@openssl.org>).
> 
> Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>

Patch applied.  Thanks.
-- 
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web