[RFC PATCH 00/19] vhost-user-rpmb (Replay Protected Memory Block)

Alex Bennée posted 19 patches 3 years, 7 months ago
Test docker-quick@centos7 passed
Test docker-mingw@fedora passed
Test checkpatch failed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200925125147.26943-1-alex.bennee@linaro.org
docs/tools/index.rst                       |   1 +
docs/tools/vhost-user-rpmb.rst             | 102 +++
docs/tools/virtiofsd.rst                   |   4 +
include/hw/virtio/vhost-user-rpmb.h        |  46 ++
{hw => include/hw}/virtio/virtio-pci.h     |   0
tools/vhost-user-rpmb/hmac_sha256.h        |  87 ++
tools/virtiofsd/fuse_i.h                   |   1 +
hw/block/vhost-user-rpmb-pci.c             |  82 ++
hw/block/vhost-user-rpmb.c                 | 333 ++++++++
hw/virtio/vhost-scsi-pci.c                 |   2 +-
hw/virtio/vhost-user-blk-pci.c             |   2 +-
hw/virtio/vhost-user-fs-pci.c              |   2 +-
hw/virtio/vhost-user-input-pci.c           |   2 +-
hw/virtio/vhost-user-scsi-pci.c            |   2 +-
hw/virtio/vhost-user-vsock-pci.c           |   2 +-
hw/virtio/vhost-vsock-pci.c                |   2 +-
hw/virtio/virtio-9p-pci.c                  |   2 +-
hw/virtio/virtio-balloon-pci.c             |   2 +-
hw/virtio/virtio-blk-pci.c                 |   2 +-
hw/virtio/virtio-input-host-pci.c          |   2 +-
hw/virtio/virtio-input-pci.c               |   2 +-
hw/virtio/virtio-iommu-pci.c               |   2 +-
hw/virtio/virtio-net-pci.c                 |   2 +-
hw/virtio/virtio-pci.c                     |   5 +-
hw/virtio/virtio-rng-pci.c                 |   2 +-
hw/virtio/virtio-scsi-pci.c                |   2 +-
hw/virtio/virtio-serial-pci.c              |   2 +-
tools/vhost-user-rpmb/hmac_sha256.c        | 331 ++++++++
tools/vhost-user-rpmb/main.c               | 880 +++++++++++++++++++++
tools/virtiofsd/fuse_lowlevel.c            |   6 +
tools/virtiofsd/fuse_virtio.c              |  20 +-
MAINTAINERS                                |   5 +
hw/block/Kconfig                           |   5 +
hw/block/meson.build                       |   3 +
hw/virtio/trace-events                     |   7 +-
tools/meson.build                          |   8 +
tools/vhost-user-rpmb/50-qemu-rpmb.json.in |   5 +
tools/vhost-user-rpmb/meson.build          |  12 +
38 files changed, 1956 insertions(+), 21 deletions(-)
create mode 100644 docs/tools/vhost-user-rpmb.rst
create mode 100644 include/hw/virtio/vhost-user-rpmb.h
rename {hw => include/hw}/virtio/virtio-pci.h (100%)
create mode 100644 tools/vhost-user-rpmb/hmac_sha256.h
create mode 100644 hw/block/vhost-user-rpmb-pci.c
create mode 100644 hw/block/vhost-user-rpmb.c
create mode 100644 tools/vhost-user-rpmb/hmac_sha256.c
create mode 100644 tools/vhost-user-rpmb/main.c
create mode 100644 tools/vhost-user-rpmb/50-qemu-rpmb.json.in
create mode 100644 tools/vhost-user-rpmb/meson.build
[RFC PATCH 00/19] vhost-user-rpmb (Replay Protected Memory Block)
Posted by Alex Bennée 3 years, 7 months ago
Hi,

This is an initial implementation of a vhost-user backend for the
VirtIO RPMB device. The device is currently in the draft of the next
VirtIO specification and describes block device which uses combination
of a key, nonce, hashing and a persistent write counter to prevent
replay attacks (hence Replay Protected Memory Block).

It is implemented as a vhost-user device because we want to experiment
in making portable backends that can be used with multiple
hypervisors. We also want to support backends isolated in their own
separate service VMs with limited memory cross-sections with the
principle guest. This is part of a wider initiative called project
Stratos for which you can find information here:

  https://collaborate.linaro.org/display/STR/Stratos

I mention this to explain the decision to duplicate some of the
utility functions (specifically iov and hmac handling) and write the
daemon as a fairly pure glib application that just depends on
libvhost-user. As it happens I ended up having to include libqemuutil
as libvhost-user requires qemu_memfd_alloc. Whether this is an
oversight for libvhost-user or it means we should split these daemons
into a separate repository is a discussion I would like to have with
the community. Now I have a working reference implementation I also
want to explore how easy it is to write a Rust version of the backend
which raises similar questions about where such a project should live.

The current Linux kernel doesn't support RPMB devices in the vanilla
tree so if you want to test you will need to look at my testing tree
which is based on Thomas Winkler's original patches although somewhat
cut down and pared back to just support the JDEC style frames of the
upstream spec and the simple chardev based userspace interface. You
can find my kernel testing tree here:

  https://git.linaro.org/people/alex.bennee/linux.git/log/?h=testing/virtio-rpmb   

The above branch includes a simple test script with the rpmb userspace
tool which I've used to exercise the various features. I'm unsure if
there will ever be a push to upstream support for RPMB to the kernel
as access to these sorts of devices are usually the preserve of
firmware living in the secure world. There is currently work underway
to support this device in uboot and I suspect eventually there will be
support for OPTEE as well.

Any review comments gratefully received as well as discussion about if
we should consider creating some new projects for housing these sort
of vhost-user backends. 

Alex Bennée (19):
  tools/virtiofsd: add support for --socket-group
  hw/block: add boilerplate for vhost-user-rpmb device
  hw/virtio: move virtio-pci.h into shared include space
  hw/block: add vhost-user-rpmb-pci boilerplate
  virtio-pci: add notification trace points
  tools/vhost-user-rpmb: add boilerplate and initial main
  tools/vhost-user-rpmb: implement --print-capabilities
  tools/vhost-user-rpmb: connect to fd and instantiate basic run loop
  tools/vhost-user-rpmb: add a --verbose/debug flags for logging
  tools/vhost-user-rpmb: handle shutdown and SIGINT/SIGHUP cleanly
  tools/vhost-user-rpmb: add --flash-path for backing store
  tools/vhost-user-rpmb: import hmac_sha256 functions
  tools/vhost-user-rpmb: implement the PROGRAM_KEY handshake
  tools/vhost-user-rpmb: implement VIRTIO_RPMB_REQ_GET_WRITE_COUNTER
  tools/vhost-user-rpmb: implement VIRTIO_RPMB_REQ_DATA_WRITE
  tools/vhost-user-rpmb: implement VIRTIO_RPMB_REQ_DATA_READ
  tools/vhost-user-rpmb: add key persistence
  tools/vhost-user-rpmb: allow setting of the write_count
  docs: add a man page for vhost-user-rpmb

 docs/tools/index.rst                       |   1 +
 docs/tools/vhost-user-rpmb.rst             | 102 +++
 docs/tools/virtiofsd.rst                   |   4 +
 include/hw/virtio/vhost-user-rpmb.h        |  46 ++
 {hw => include/hw}/virtio/virtio-pci.h     |   0
 tools/vhost-user-rpmb/hmac_sha256.h        |  87 ++
 tools/virtiofsd/fuse_i.h                   |   1 +
 hw/block/vhost-user-rpmb-pci.c             |  82 ++
 hw/block/vhost-user-rpmb.c                 | 333 ++++++++
 hw/virtio/vhost-scsi-pci.c                 |   2 +-
 hw/virtio/vhost-user-blk-pci.c             |   2 +-
 hw/virtio/vhost-user-fs-pci.c              |   2 +-
 hw/virtio/vhost-user-input-pci.c           |   2 +-
 hw/virtio/vhost-user-scsi-pci.c            |   2 +-
 hw/virtio/vhost-user-vsock-pci.c           |   2 +-
 hw/virtio/vhost-vsock-pci.c                |   2 +-
 hw/virtio/virtio-9p-pci.c                  |   2 +-
 hw/virtio/virtio-balloon-pci.c             |   2 +-
 hw/virtio/virtio-blk-pci.c                 |   2 +-
 hw/virtio/virtio-input-host-pci.c          |   2 +-
 hw/virtio/virtio-input-pci.c               |   2 +-
 hw/virtio/virtio-iommu-pci.c               |   2 +-
 hw/virtio/virtio-net-pci.c                 |   2 +-
 hw/virtio/virtio-pci.c                     |   5 +-
 hw/virtio/virtio-rng-pci.c                 |   2 +-
 hw/virtio/virtio-scsi-pci.c                |   2 +-
 hw/virtio/virtio-serial-pci.c              |   2 +-
 tools/vhost-user-rpmb/hmac_sha256.c        | 331 ++++++++
 tools/vhost-user-rpmb/main.c               | 880 +++++++++++++++++++++
 tools/virtiofsd/fuse_lowlevel.c            |   6 +
 tools/virtiofsd/fuse_virtio.c              |  20 +-
 MAINTAINERS                                |   5 +
 hw/block/Kconfig                           |   5 +
 hw/block/meson.build                       |   3 +
 hw/virtio/trace-events                     |   7 +-
 tools/meson.build                          |   8 +
 tools/vhost-user-rpmb/50-qemu-rpmb.json.in |   5 +
 tools/vhost-user-rpmb/meson.build          |  12 +
 38 files changed, 1956 insertions(+), 21 deletions(-)
 create mode 100644 docs/tools/vhost-user-rpmb.rst
 create mode 100644 include/hw/virtio/vhost-user-rpmb.h
 rename {hw => include/hw}/virtio/virtio-pci.h (100%)
 create mode 100644 tools/vhost-user-rpmb/hmac_sha256.h
 create mode 100644 hw/block/vhost-user-rpmb-pci.c
 create mode 100644 hw/block/vhost-user-rpmb.c
 create mode 100644 tools/vhost-user-rpmb/hmac_sha256.c
 create mode 100644 tools/vhost-user-rpmb/main.c
 create mode 100644 tools/vhost-user-rpmb/50-qemu-rpmb.json.in
 create mode 100644 tools/vhost-user-rpmb/meson.build

-- 
2.20.1


Re: [RFC PATCH 00/19] vhost-user-rpmb (Replay Protected Memory Block)
Posted by no-reply@patchew.org 3 years, 7 months ago
Patchew URL: https://patchew.org/QEMU/20200925125147.26943-1-alex.bennee@linaro.org/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20200925125147.26943-1-alex.bennee@linaro.org
Subject: [RFC PATCH  00/19] vhost-user-rpmb (Replay Protected Memory Block)

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Switched to a new branch 'test'
de93431 docs: add a man page for vhost-user-rpmb
2bc1b7e tools/vhost-user-rpmb: allow setting of the write_count
50f0f27 tools/vhost-user-rpmb: add key persistence
dd8233f tools/vhost-user-rpmb: implement VIRTIO_RPMB_REQ_DATA_READ
88283cc tools/vhost-user-rpmb: implement VIRTIO_RPMB_REQ_DATA_WRITE
aa2e735 tools/vhost-user-rpmb: implement VIRTIO_RPMB_REQ_GET_WRITE_COUNTER
24de191 tools/vhost-user-rpmb: implement the PROGRAM_KEY handshake
cf0cc66 tools/vhost-user-rpmb: import hmac_sha256 functions
f98813c tools/vhost-user-rpmb: add --flash-path for backing store
8db0f08 tools/vhost-user-rpmb: handle shutdown and SIGINT/SIGHUP cleanly
f7534d4 tools/vhost-user-rpmb: add a --verbose/debug flags for logging
4c44c17 tools/vhost-user-rpmb: connect to fd and instantiate basic run loop
061c2c0 tools/vhost-user-rpmb: implement --print-capabilities
d873168 tools/vhost-user-rpmb: add boilerplate and initial main
397a631 virtio-pci: add notification trace points
d947373 hw/block: add vhost-user-rpmb-pci boilerplate
5966eb3 hw/virtio: move virtio-pci.h into shared include space
48c264c hw/block: add boilerplate for vhost-user-rpmb device
220284c tools/virtiofsd: add support for --socket-group

=== OUTPUT BEGIN ===
1/19 Checking commit 220284c70dd3 (tools/virtiofsd: add support for --socket-group)
WARNING: line over 80 characters
#92: FILE: tools/virtiofsd/fuse_virtio.c:934:
+        old_umask = umask(S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH);

total: 0 errors, 1 warnings, 74 lines checked

Patch 1/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/19 Checking commit 48c264cdfcd0 (hw/block: add boilerplate for vhost-user-rpmb device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#42: 
new file mode 100644

total: 0 errors, 1 warnings, 395 lines checked

Patch 2/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
3/19 Checking commit 5966eb3db703 (hw/virtio: move virtio-pci.h into shared include space)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#250: 
rename from hw/virtio/virtio-pci.h

total: 0 errors, 1 warnings, 144 lines checked

Patch 3/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
4/19 Checking commit d94737395f8f (hw/block: add vhost-user-rpmb-pci boilerplate)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28: 
new file mode 100644

total: 0 errors, 1 warnings, 89 lines checked

Patch 4/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
5/19 Checking commit 397a63150433 (virtio-pci: add notification trace points)
6/19 Checking commit d8731682a51c (tools/vhost-user-rpmb: add boilerplate and initial main)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#53: 
new file mode 100644

ERROR: that open brace { should be on the previous line
#84: FILE: tools/vhost-user-rpmb/main.c:16:
+static GOptionEntry options[] =
+{

ERROR: line over 90 characters
#85: FILE: tools/vhost-user-rpmb/main.c:17:
+    { "socket-path", 0, 0, G_OPTION_ARG_FILENAME, &socket_path, "Location of vhost-user Unix domain socket, incompatible with --fd", "PATH" },

ERROR: line over 90 characters
#86: FILE: tools/vhost-user-rpmb/main.c:18:
+    { "fd", 0, 0, G_OPTION_ARG_INT, &socket_fd, "Specify the file-descriptor of the backend, incompatible with --socket-path", "FD" },

ERROR: line over 90 characters
#87: FILE: tools/vhost-user-rpmb/main.c:19:
+    { "print-capabilities", 0, 0, G_OPTION_ARG_NONE, &print_cap, "Output to stdout the backend capabilities in JSON format and exit", NULL},

ERROR: space prohibited between function name and open parenthesis '('
#91: FILE: tools/vhost-user-rpmb/main.c:23:
+int main (int argc, char *argv[])

ERROR: line over 90 characters
#96: FILE: tools/vhost-user-rpmb/main.c:28:
+    context = g_option_context_new ("vhost-user-rpmb - vhost-user emulation of RPBM device");

ERROR: space prohibited between function name and open parenthesis '('
#96: FILE: tools/vhost-user-rpmb/main.c:28:
+    context = g_option_context_new ("vhost-user-rpmb - vhost-user emulation of RPBM device");

ERROR: space prohibited between function name and open parenthesis '('
#97: FILE: tools/vhost-user-rpmb/main.c:29:
+    g_option_context_add_main_entries (context, options, "vhost-user-rpmb");

ERROR: that open brace { should be on the previous line
#98: FILE: tools/vhost-user-rpmb/main.c:30:
+    if (!g_option_context_parse (context, &argc, &argv, &error))
+    {

ERROR: space prohibited between function name and open parenthesis '('
#98: FILE: tools/vhost-user-rpmb/main.c:30:
+    if (!g_option_context_parse (context, &argc, &argv, &error))

ERROR: space prohibited between function name and open parenthesis '('
#101: FILE: tools/vhost-user-rpmb/main.c:33:
+        exit (1);

total: 11 errors, 1 warnings, 75 lines checked

Patch 6/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

7/19 Checking commit 061c2c0a97eb (tools/vhost-user-rpmb: implement --print-capabilities)
8/19 Checking commit 4c44c17852d6 (tools/vhost-user-rpmb: connect to fd and instantiate basic run loop)
ERROR: spaces required around that '*' (ctx:WxV)
#32: FILE: tools/vhost-user-rpmb/main.c:21:
+        const typeof(((type *) 0)->member) *__mptr = (ptr);     \
                                            ^

ERROR: space required after that ';' (ctx:VxV)
#33: FILE: tools/vhost-user-rpmb/main.c:22:
+        (type *) ((char *) __mptr - offsetof(type, member));})
                                                            ^

ERROR: space prohibited between function name and open parenthesis '('
#199: FILE: tools/vhost-user-rpmb/main.c:194:
+    context = g_option_context_new ("vhost-user emulation of RPBM device");

ERROR: line over 90 characters
#219: FILE: tools/vhost-user-rpmb/main.c:219:
+        g_autoptr(GSocket) bind_socket = g_socket_new(G_SOCKET_FAMILY_UNIX, G_SOCKET_TYPE_STREAM,

WARNING: line over 80 characters
#220: FILE: tools/vhost-user-rpmb/main.c:220:
+                                                      G_SOCKET_PROTOCOL_DEFAULT, &error);

WARNING: line over 80 characters
#246: FILE: tools/vhost-user-rpmb/main.c:246:
+    if (!vug_init(&rpmb.dev, VHOST_USER_RPMB_MAX_QUEUES, g_socket_get_fd(socket),

total: 4 errors, 2 warnings, 244 lines checked

Patch 8/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

9/19 Checking commit f7534d48c985 (tools/vhost-user-rpmb: add a --verbose/debug flags for logging)
WARNING: line over 80 characters
#39: FILE: tools/vhost-user-rpmb/main.c:39:
+    { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be more verbose in output", NULL},

WARNING: line over 80 characters
#63: FILE: tools/vhost-user-rpmb/main.c:227:
+                          G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR,

total: 0 errors, 2 warnings, 49 lines checked

Patch 9/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/19 Checking commit 8db0f083eb3e (tools/vhost-user-rpmb: handle shutdown and SIGINT/SIGHUP cleanly)
11/19 Checking commit f98813cc37dd (tools/vhost-user-rpmb: add --flash-path for backing store)
ERROR: line over 90 characters
#45: FILE: tools/vhost-user-rpmb/main.c:45:
+    { "flash-path", 0, 0, G_OPTION_ARG_FILENAME, &flash_path, "Location of raw flash image file", "PATH" },

ERROR: spaces required around that '*' (ctx:WxV)
#102: FILE: tools/vhost-user-rpmb/main.c:231:
+    r->virtio_config.capacity = map_size / (128 *KiB);
                                                 ^

total: 2 errors, 0 warnings, 115 lines checked

Patch 11/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

12/19 Checking commit cf0cc660d83d (tools/vhost-user-rpmb: import hmac_sha256 functions)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#15: 
new file mode 100644

ERROR: space prohibited before that close parenthesis ')'
#75: FILE: tools/vhost-user-rpmb/hmac_sha256.c:56:
+    *((str) + 3) = (uint8) ((x)      );       \

ERROR: spaces required around that '*' (ctx:WxV)
#83: FILE: tools/vhost-user-rpmb/hmac_sha256.c:64:
+    *(x) =   ((uint32) *((str) + 3)      )    \
                        ^

ERROR: space prohibited before that close parenthesis ')'
#83: FILE: tools/vhost-user-rpmb/hmac_sha256.c:64:
+    *(x) =   ((uint32) *((str) + 3)      )    \

ERROR: spaces required around that '*' (ctx:WxV)
#84: FILE: tools/vhost-user-rpmb/hmac_sha256.c:65:
+           | ((uint32) *((str) + 2) <<  8)    \
                        ^

ERROR: spaces required around that '*' (ctx:WxV)
#85: FILE: tools/vhost-user-rpmb/hmac_sha256.c:66:
+           | ((uint32) *((str) + 1) << 16)    \
                        ^

ERROR: spaces required around that '*' (ctx:WxV)
#86: FILE: tools/vhost-user-rpmb/hmac_sha256.c:67:
+           | ((uint32) *((str) + 0) << 24);   \
                        ^

ERROR: space prohibited before that close parenthesis ')'
#91: FILE: tools/vhost-user-rpmb/hmac_sha256.c:72:
+    *((str) + 7) = (uint8) ((x)      );       \

ERROR: spaces required around that '*' (ctx:WxV)
#103: FILE: tools/vhost-user-rpmb/hmac_sha256.c:84:
+    *(x) =   ((uint64) *((str) + 7)      )    \
                        ^

ERROR: space prohibited before that close parenthesis ')'
#103: FILE: tools/vhost-user-rpmb/hmac_sha256.c:84:
+    *(x) =   ((uint64) *((str) + 7)      )    \

ERROR: spaces required around that '*' (ctx:WxV)
#104: FILE: tools/vhost-user-rpmb/hmac_sha256.c:85:
+           | ((uint64) *((str) + 6) <<  8)    \
                        ^

ERROR: spaces required around that '*' (ctx:WxV)
#105: FILE: tools/vhost-user-rpmb/hmac_sha256.c:86:
+           | ((uint64) *((str) + 5) << 16)    \
                        ^

ERROR: spaces required around that '*' (ctx:WxV)
#106: FILE: tools/vhost-user-rpmb/hmac_sha256.c:87:
+           | ((uint64) *((str) + 4) << 24)    \
                        ^

ERROR: spaces required around that '*' (ctx:WxV)
#107: FILE: tools/vhost-user-rpmb/hmac_sha256.c:88:
+           | ((uint64) *((str) + 3) << 32)    \
                        ^

ERROR: spaces required around that '*' (ctx:WxV)
#108: FILE: tools/vhost-user-rpmb/hmac_sha256.c:89:
+           | ((uint64) *((str) + 2) << 40)    \
                        ^

ERROR: spaces required around that '*' (ctx:WxV)
#109: FILE: tools/vhost-user-rpmb/hmac_sha256.c:90:
+           | ((uint64) *((str) + 1) << 48)    \
                        ^

ERROR: spaces required around that '*' (ctx:WxV)
#110: FILE: tools/vhost-user-rpmb/hmac_sha256.c:91:
+           | ((uint64) *((str) + 0) << 56);   \
                        ^

ERROR: that open brace { should be on the previous line
#120: FILE: tools/vhost-user-rpmb/hmac_sha256.c:101:
+uint32 sha256_h0[8] =
+            {0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,

ERROR: that open brace { should be on the previous line
#124: FILE: tools/vhost-user-rpmb/hmac_sha256.c:105:
+uint32 sha256_k[64] =
+            {0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,

WARNING: line over 80 characters
#188: FILE: tools/vhost-user-rpmb/hmac_sha256.c:169:
+void sha256(const unsigned char *message, unsigned int len, unsigned char *digest)

ERROR: space required before the open brace '{'
#282: FILE: tools/vhost-user-rpmb/hmac_sha256.c:263:
+        if (key_size > SHA256_BLOCK_SIZE){

ERROR: space prohibited after that open parenthesis '('
#396: FILE: tools/vhost-user-rpmb/hmac_sha256.h:40:
+#define SHA256_DIGEST_SIZE ( 256 / 8)

ERROR: space prohibited after that open parenthesis '('
#397: FILE: tools/vhost-user-rpmb/hmac_sha256.h:41:
+#define SHA256_BLOCK_SIZE  ( 512 / 8)

ERROR: "foo * bar" should be "foo *bar"
#413: FILE: tools/vhost-user-rpmb/hmac_sha256.h:57:
+void sha256_init(sha256_ctx * ctx);

total: 22 errors, 2 warnings, 425 lines checked

Patch 12/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

13/19 Checking commit 24de191d1408 (tools/vhost-user-rpmb: implement the PROGRAM_KEY handshake)
WARNING: line over 80 characters
#125: FILE: tools/vhost-user-rpmb/main.c:143:
+static size_t vrpmb_iov_to_buf(const struct iovec *iov, const unsigned int iov_cnt,

WARNING: line over 80 characters
#205: FILE: tools/vhost-user-rpmb/main.c:262:
+static void vrpmb_handle_program_key(VuDev *dev, struct virtio_rpmb_frame *frame)

ERROR: "foo * bar" should be "foo *bar"
#239: FILE: tools/vhost-user-rpmb/main.c:296:
+static struct virtio_rpmb_frame * vrpmb_handle_result_read(VuDev *dev)

WARNING: line over 80 characters
#347: FILE: tools/vhost-user-rpmb/main.c:400:
+                    g_warning("%s: already sent a response in this set of frames",

total: 1 errors, 3 warnings, 352 lines checked

Patch 13/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

14/19 Checking commit aa2e735c5fbb (tools/vhost-user-rpmb: implement VIRTIO_RPMB_REQ_GET_WRITE_COUNTER)
15/19 Checking commit 88283ccf688e (tools/vhost-user-rpmb: implement VIRTIO_RPMB_REQ_DATA_WRITE)
WARNING: Block comments use a leading /* on a separate line
#110: FILE: tools/vhost-user-rpmb/main.c:371:
+    } else if (false /* what does an expired write counter mean? */) {

WARNING: Block comments use a leading /* on a separate line
#120: FILE: tools/vhost-user-rpmb/main.c:381:
+        /* At this point we have a valid authenticated write request

ERROR: spaces required around that ':' (ctx:VxV)
#150: FILE: tools/vhost-user-rpmb/main.c:411:
+           r->last_result == VIRTIO_RPMB_RES_OK ? "successful":"failed",
                                                               ^

total: 1 errors, 2 warnings, 163 lines checked

Patch 15/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

16/19 Checking commit dd8233f9d9d3 (tools/vhost-user-rpmb: implement VIRTIO_RPMB_REQ_DATA_READ)
17/19 Checking commit 50f0f2719ffb (tools/vhost-user-rpmb: add key persistence)
ERROR: line over 90 characters
#35: FILE: tools/vhost-user-rpmb/main.c:52:
+    { "key-path", 0, 0, G_OPTION_ARG_FILENAME, &key_path, "Location of persistent keyfile", "KEY"},

ERROR: line over 90 characters
#36: FILE: tools/vhost-user-rpmb/main.c:53:
+    { "key-set", 0, 0, G_OPTION_ARG_NONE, &key_set, "Is the key already programmed", NULL},

total: 2 errors, 0 warnings, 72 lines checked

Patch 17/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

18/19 Checking commit 2bc1b7e86343 (tools/vhost-user-rpmb: allow setting of the write_count)
ERROR: line over 90 characters
#29: FILE: tools/vhost-user-rpmb/main.c:53:
+    { "initial-counter", 0, 0, G_OPTION_ARG_INT, &initial_counter, "Set initial value of write counter", NULL},

total: 1 errors, 0 warnings, 24 lines checked

Patch 18/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

19/19 Checking commit de934315542c (docs: add a man page for vhost-user-rpmb)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#22: 
new file mode 100644

ERROR: trailing whitespace
#71: FILE: docs/tools/vhost-user-rpmb.rst:45:
+            $

ERROR: trailing whitespace
#93: FILE: docs/tools/vhost-user-rpmb.rst:67:
+            $

ERROR: trailing whitespace
#102: FILE: docs/tools/vhost-user-rpmb.rst:76:
+  incremented by each write operation. $

total: 3 errors, 1 warnings, 106 lines checked

Patch 19/19 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200925125147.26943-1-alex.bennee@linaro.org/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com