cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-crypto-annotate-xts_tweak_encdec-as-inlineable.patch

Pablo Greco e6a3ae
From 8e0e5d4ff6afd4e869ff1974df13b9b3003f035b Mon Sep 17 00:00:00 2001
Pablo Greco e6a3ae
From: "Daniel P. Berrange" <berrange@redhat.com>
Pablo Greco e6a3ae
Date: Wed, 24 Apr 2019 09:56:41 +0100
Pablo Greco e6a3ae
Subject: [PATCH 7/9] crypto: annotate xts_tweak_encdec as inlineable
Pablo Greco e6a3ae
MIME-Version: 1.0
Pablo Greco e6a3ae
Content-Type: text/plain; charset=UTF-8
Pablo Greco e6a3ae
Content-Transfer-Encoding: 8bit
Pablo Greco e6a3ae
Pablo Greco e6a3ae
RH-Author: Daniel P. Berrange <berrange@redhat.com>
Pablo Greco e6a3ae
Message-id: <20190424095643.796-8-berrange@redhat.com>
Pablo Greco e6a3ae
Patchwork-id: 85884
Pablo Greco e6a3ae
O-Subject: [RHEL-8.1.0 qemu-kvm PATCH 7/9] crypto: annotate xts_tweak_encdec as inlineable
Pablo Greco e6a3ae
Bugzilla: 1680231
Pablo Greco e6a3ae
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: John Snow <jsnow@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Eric Blake <eblake@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Encouraging the compiler to inline xts_tweak_encdec increases the
Pablo Greco e6a3ae
performance for xts-aes-128 when built with gcrypt:
Pablo Greco e6a3ae
Pablo Greco e6a3ae
  Encrypt: 545 MB/s -> 580 MB/s
Pablo Greco e6a3ae
  Decrypt: 568 MB/s -> 602 MB/s
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Reviewed-by: Alberto Garcia <berto@igalia.com>
Pablo Greco e6a3ae
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Pablo Greco e6a3ae
(cherry picked from commit aa895bd439341a8f218d8f1a3d21359ba058c13f)
Pablo Greco e6a3ae
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Pablo Greco e6a3ae
---
Pablo Greco e6a3ae
 crypto/xts.c | 10 +++++-----
Pablo Greco e6a3ae
 1 file changed, 5 insertions(+), 5 deletions(-)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
diff --git a/crypto/xts.c b/crypto/xts.c
Pablo Greco e6a3ae
index 10ec83f..4277ad4 100644
Pablo Greco e6a3ae
--- a/crypto/xts.c
Pablo Greco e6a3ae
+++ b/crypto/xts.c
Pablo Greco e6a3ae
@@ -81,11 +81,11 @@ static void xts_mult_x(xts_uint128 *I)
Pablo Greco e6a3ae
  *
Pablo Greco e6a3ae
  * Encrypt/decrypt data with a tweak
Pablo Greco e6a3ae
  */
Pablo Greco e6a3ae
-static void xts_tweak_encdec(const void *ctx,
Pablo Greco e6a3ae
-                             xts_cipher_func *func,
Pablo Greco e6a3ae
-                             const xts_uint128 *src,
Pablo Greco e6a3ae
-                             xts_uint128 *dst,
Pablo Greco e6a3ae
-                             xts_uint128 *iv)
Pablo Greco e6a3ae
+static inline void xts_tweak_encdec(const void *ctx,
Pablo Greco e6a3ae
+                                    xts_cipher_func *func,
Pablo Greco e6a3ae
+                                    const xts_uint128 *src,
Pablo Greco e6a3ae
+                                    xts_uint128 *dst,
Pablo Greco e6a3ae
+                                    xts_uint128 *iv)
Pablo Greco e6a3ae
 {
Pablo Greco e6a3ae
     /* tweak encrypt block i */
Pablo Greco e6a3ae
     xts_uint128_xor(dst, src, iv);
Pablo Greco e6a3ae
-- 
Pablo Greco e6a3ae
1.8.3.1
Pablo Greco e6a3ae