qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] ca04c3: tests: fix output message formatting


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] ca04c3: tests: fix output message formatting for crypto be...
Date: Sat, 12 Sep 2020 15:00:31 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: ca04c3cf15961e4a01c729a24b00bf804f59ac23
      
https://github.com/qemu/qemu/commit/ca04c3cf15961e4a01c729a24b00bf804f59ac23
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M tests/benchmark-crypto-cipher.c
    M tests/benchmark-crypto-hash.c
    M tests/benchmark-crypto-hmac.c

  Log Message:
  -----------
  tests: fix output message formatting for crypto benchmarks

The output was changed from g_print to g_test_message in

  commit 24441f912e67233d9c52ce6b459ed75de2484525
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   Fri Aug 28 15:07:30 2020 +0400

    tests: do not print benchmark output to stdout

    As this makes the TAP output invalid. Use g_test_message().

The functions do not result in equivalent output. The g_print
statements were putting all the information on a single line
for ease of interpretation. The change to g_test_message split
the output across many lines making it painful to read.

The opportunity is used to tweak the information printed to be
more consistent across tests.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: eba29771c006d6a689e946fa57334a2ce370c45c
      
https://github.com/qemu/qemu/commit/eba29771c006d6a689e946fa57334a2ce370c45c
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/cipher-builtin.c
    M crypto/cipher-gcrypt.c
    M crypto/cipher-nettle.c
    M crypto/cipher.c

  Log Message:
  -----------
  crypto: Assume blocksize is a power of 2

The check in the encode/decode path using full division has a
noticeable amount of overhead.  By asserting the blocksize is
a power of 2, we can reduce this check to a mask.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 6d92bdf44375f9819539927b7f234ba89ce9365e
      
https://github.com/qemu/qemu/commit/6d92bdf44375f9819539927b7f234ba89ce9365e
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    R crypto/cipher-builtin.c
    A crypto/cipher-builtin.c.inc
    R crypto/cipher-gcrypt.c
    A crypto/cipher-gcrypt.c.inc
    R crypto/cipher-nettle.c
    A crypto/cipher-nettle.c.inc
    M crypto/cipher.c

  Log Message:
  -----------
  crypto: Rename cipher include files to .c.inc

QEMU standard procedure for included c files is to use *.c.inc.
E.g. there are a different set of checks that are applied.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 7d823bf4e9241aa960de50d2b09ac8f9560bcdd8
      
https://github.com/qemu/qemu/commit/7d823bf4e9241aa960de50d2b09ac8f9560bcdd8
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/cipher-builtin.c.inc
    M crypto/cipher-gcrypt.c.inc
    M crypto/cipher-nettle.c.inc

  Log Message:
  -----------
  crypto: Remove redundant includes

Both qemu/osdep.h and cipherpriv.h have already been
included by the parent cipher.c.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: d6f77401be1dd2f34d862724fbe128a2349d379b
      
https://github.com/qemu/qemu/commit/d6f77401be1dd2f34d862724fbe128a2349d379b
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/cipher-nettle.c.inc

  Log Message:
  -----------
  crypto/nettle: Fix xts_encrypt arguments

The fourth argument to xts_encrypt should be the decrypt
callback; we were accidentally passing encrypt twice.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 954721ffa8c755ecd8552525b2a2f47da6c9d9f3
      
https://github.com/qemu/qemu/commit/954721ffa8c755ecd8552525b2a2f47da6c9d9f3
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/cipherpriv.h
    M include/crypto/cipher.h

  Log Message:
  -----------
  crypto: Move QCryptoCipherDriver typedef to crypto/cipher.h

Allow the use in QCryptoCipher to be properly typed with
the opaque struct pointer.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 7b5dbfb777ff4894ebcd71f5014d26abeef916c6
      
https://github.com/qemu/qemu/commit/7b5dbfb777ff4894ebcd71f5014d26abeef916c6
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/cipher-afalg.c
    M crypto/cipher-builtin.c.inc
    M crypto/cipher-gcrypt.c.inc
    M crypto/cipher-nettle.c.inc
    M crypto/cipher.c
    M crypto/cipherpriv.h
    M include/crypto/cipher.h

  Log Message:
  -----------
  crypto: Use the correct const type for driver

This allows the in memory structures to be read-only.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 3eedf5cc9d45f94e2fd229f0a7aaca556a4ac734
      
https://github.com/qemu/qemu/commit/3eedf5cc9d45f94e2fd229f0a7aaca556a4ac734
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/afalgpriv.h
    M crypto/cipher-afalg.c
    M crypto/cipher-builtin.c.inc
    M crypto/cipher-gcrypt.c.inc
    M crypto/cipher-nettle.c.inc
    M crypto/cipher.c
    M crypto/cipherpriv.h
    M include/crypto/cipher.h

  Log Message:
  -----------
  crypto: Allocate QCryptoCipher with the subclass

Merge the allocation of "opaque" into the allocation of "cipher".
This is step one in reducing the indirection in these classes.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: da30cd77e1dab21560286627eea9609e8a460ce9
      
https://github.com/qemu/qemu/commit/da30cd77e1dab21560286627eea9609e8a460ce9
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/cipher-afalg.c
    M crypto/cipher-builtin.c.inc
    M crypto/cipher-gcrypt.c.inc
    M crypto/cipher-nettle.c.inc
    M crypto/cipher.c
    M crypto/cipherpriv.h

  Log Message:
  -----------
  crypto: Move cipher->driver init to qcrypto_*_cipher_ctx_new

The class vtable should be set by the class initializer.
This will also allow additional subclassing, reducing the
amount of indirection in the hierarchy.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: e46064a4c610daf185e1de6e5210dd7556591faf
      
https://github.com/qemu/qemu/commit/e46064a4c610daf185e1de6e5210dd7556591faf
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/cipher.c

  Log Message:
  -----------
  crypto: Constify cipher data tables

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 838e4631cb26618df8b2e3ed3d3b6801c4cd1424
      
https://github.com/qemu/qemu/commit/838e4631cb26618df8b2e3ed3d3b6801c4cd1424
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/cipher-builtin.c.inc

  Log Message:
  -----------
  crypto/builtin: Remove odd-sized AES block handling

We verified that the data block is properly sized modulo
AES_BLOCK_SIZE within qcrypto_builtin_cipher_{en,de}crypt.
Therefore we will never have to handle odd sized blocks.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 8ee47cddbe758ae521792f4b52ed3d86af993da6
      
https://github.com/qemu/qemu/commit/8ee47cddbe758ae521792f4b52ed3d86af993da6
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/cipher-builtin.c.inc

  Log Message:
  -----------
  crypto/builtin: Merge qcrypto_cipher_aes_{ecb,xts}_{en,de}crypt

There's no real reason we need two separate helper functions here.
Standardize on the function signature required for xts_encrypt.
Rename to do_aes_{en,de}crypt_ecb, since the helper does not
itself do anything with respect to xts.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: a2d76b6b2e324972641749f9fffd9eab27c89509
      
https://github.com/qemu/qemu/commit/a2d76b6b2e324972641749f9fffd9eab27c89509
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/aes.c
    M crypto/cipher-builtin.c.inc
    M include/crypto/aes.h

  Log Message:
  -----------
  crypto/builtin: Move AES_cbc_encrypt into cipher-builtin.inc.c

By making the function private, we will be able to make further
simplifications.  Re-indent the migrated code and fix the missing
braces for CODING_STYLE.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: ef186f4bc24ea7159a57776e8add1e9478b9702e
      
https://github.com/qemu/qemu/commit/ef186f4bc24ea7159a57776e8add1e9478b9702e
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/cipher-builtin.c.inc

  Log Message:
  -----------
  crypto/builtin: Split and simplify AES_encrypt_cbc

Split into encrypt/decrypt functions, dropping the "enc" argument.
Now that the function is private to this file, we know that "len"
is a multiple of AES_BLOCK_SIZE.  So drop the odd block size code.

Name the functions do_aes_*crypt_cbc to match the *_ecb functions.
Reorder and re-type the arguments to match as well.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: a3db31b83ef56ec044dbd7b89f3560855d5f8d5e
      
https://github.com/qemu/qemu/commit/a3db31b83ef56ec044dbd7b89f3560855d5f8d5e
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/cipher-builtin.c.inc

  Log Message:
  -----------
  crypto/builtin: Split QCryptoCipherBuiltin into subclasses

We had a second set of function pointers in QCryptoCipherBuiltin,
which are redundant with QCryptoCipherDriver.  Split the AES and
DES implementations to avoid one level of indirection.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 53ddad9b8398ef95c38f60d849aa9edf85a07282
      
https://github.com/qemu/qemu/commit/53ddad9b8398ef95c38f60d849aa9edf85a07282
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/cipher-nettle.c.inc

  Log Message:
  -----------
  crypto/nettle: Split QCryptoCipherNettle into subclasses

Use separate classes for each cipher entry point: des_rfb, des3,
aes128, aes192, aes256, cast128, serpent, and twofish.

Generate wrappers for XTS only for CONFIG_QEMU_PRIVATE_XTS.
This eliminates unreachable wrappers for DES_RFB, DES3 and
CAST128, which have blocksizes that do not allow XTS mode.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 1b010d9339497b081c3b8ab4f98b2a21f2cae08d
      
https://github.com/qemu/qemu/commit/1b010d9339497b081c3b8ab4f98b2a21f2cae08d
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M crypto/cipher-gcrypt.c.inc

  Log Message:
  -----------
  crypto/gcrypt: Split QCryptoCipherGcrypt into subclasses

With gcrypt, most of the dispatch happens in the library,
so there aren't many classes to create.  However, we can
still create separate dispatch for CTR mode, and for
CONFIG_QEMU_PRIVATE_XTS, which avoids needing to check
for these modes at runtime.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: c47edb8dda0660180f86df4defae2a1f60e345db
      
https://github.com/qemu/qemu/commit/c47edb8dda0660180f86df4defae2a1f60e345db
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-09-12 (Sat, 12 Sep 2020)

  Changed paths:
    M crypto/aes.c
    M crypto/afalgpriv.h
    M crypto/cipher-afalg.c
    R crypto/cipher-builtin.c
    A crypto/cipher-builtin.c.inc
    R crypto/cipher-gcrypt.c
    A crypto/cipher-gcrypt.c.inc
    R crypto/cipher-nettle.c
    A crypto/cipher-nettle.c.inc
    M crypto/cipher.c
    M crypto/cipherpriv.h
    M include/crypto/aes.h
    M include/crypto/cipher.h
    M tests/benchmark-crypto-cipher.c
    M tests/benchmark-crypto-hash.c
    M tests/benchmark-crypto-hmac.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/berrange-gitlab/tags/crypt-perf-pull-request' into staging

Improve performance of crypto cipher subsystem

# gpg: Signature made Thu 10 Sep 2020 11:05:18 BST
# gpg:                using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
# gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>" [full]
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* remotes/berrange-gitlab/tags/crypt-perf-pull-request:
  crypto/gcrypt: Split QCryptoCipherGcrypt into subclasses
  crypto/nettle: Split QCryptoCipherNettle into subclasses
  crypto/builtin: Split QCryptoCipherBuiltin into subclasses
  crypto/builtin: Split and simplify AES_encrypt_cbc
  crypto/builtin: Move AES_cbc_encrypt into cipher-builtin.inc.c
  crypto/builtin: Merge qcrypto_cipher_aes_{ecb,xts}_{en,de}crypt
  crypto/builtin: Remove odd-sized AES block handling
  crypto: Constify cipher data tables
  crypto: Move cipher->driver init to qcrypto_*_cipher_ctx_new
  crypto: Allocate QCryptoCipher with the subclass
  crypto: Use the correct const type for driver
  crypto: Move QCryptoCipherDriver typedef to crypto/cipher.h
  crypto/nettle: Fix xts_encrypt arguments
  crypto: Remove redundant includes
  crypto: Rename cipher include files to .c.inc
  crypto: Assume blocksize is a power of 2
  tests: fix output message formatting for crypto benchmarks

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/842038f55c69...c47edb8dda06



reply via email to

[Prev in Thread] Current Thread [Next in Thread]