[Qemu-devel] [RFC PATCH 0/2] spapr: Implement H_TPM_COMM for accessing host TPM device

Michael Roth posted 2 patches 4 years, 9 months ago
Test docker-clang@ubuntu passed
Test asan passed
Test docker-mingw@fedora passed
Test FreeBSD passed
Test checkpatch failed
Test s390x passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190712011934.29863-1-mdroth@linux.vnet.ibm.com
Maintainers: David Gibson <david@gibson.dropbear.id.au>
There is a newer version of this series
docs/specs/ppc-spapr-uv-hcalls.txt |  74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
hw/ppc/Makefile.objs               |   1 +
hw/ppc/spapr.c                     |  27 +++++++++++++++++++++++++++
hw/ppc/spapr_hcall_tpm.c           | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
hw/ppc/trace-events                |   4 ++++
include/hw/ppc/spapr.h             |   7 ++++++-
6 files changed, 247 insertions(+), 1 deletion(-)
[Qemu-devel] [RFC PATCH 0/2] spapr: Implement H_TPM_COMM for accessing host TPM device
Posted by Michael Roth 4 years, 9 months ago
These patches are also available at:

  https://github.com/mdroth/qemu/commits/spapr-tpm-hcall-v0

This patchset implements the H_TPM_COMM hypercall, which provides a way
for an Ultravisor to pass raw TPM commands on to a host's TPM device,
either directly or through a TPM Resource Manager (needed to support
multiple guests).

Secure Guests running on an Ultravisor have a symmetric key that is
encrypted using a public key that is bound to a trusted host's TPM
hardware. This hypercall provides a means to decrypt the symmetric
key on behalf of a Secure Guest using the host's TPM hardware.

More details are provided in the spec summary introduced in patch 1.

 docs/specs/ppc-spapr-uv-hcalls.txt |  74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/ppc/Makefile.objs               |   1 +
 hw/ppc/spapr.c                     |  27 +++++++++++++++++++++++++++
 hw/ppc/spapr_hcall_tpm.c           | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/ppc/trace-events                |   4 ++++
 include/hw/ppc/spapr.h             |   7 ++++++-
 6 files changed, 247 insertions(+), 1 deletion(-)



Re: [Qemu-devel] [RFC PATCH 0/2] spapr: Implement H_TPM_COMM for accessing host TPM device
Posted by no-reply@patchew.org 4 years, 9 months ago
Patchew URL: https://patchew.org/QEMU/20190712011934.29863-1-mdroth@linux.vnet.ibm.com/



Hi,

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

Message-id: 20190712011934.29863-1-mdroth@linux.vnet.ibm.com
Type: series
Subject: [Qemu-devel] [RFC PATCH 0/2] spapr: Implement H_TPM_COMM for accessing host TPM device

=== 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'
12b8055a19 spapr: initial implementation for H_TPM_COMM hcall
47c8841564 docs/specs: initial spec summary for Ultravisor-related hcalls

=== OUTPUT BEGIN ===
1/2 Checking commit 47c884156452 (docs/specs: initial spec summary for Ultravisor-related hcalls)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#18: 
new file mode 100644

total: 0 errors, 1 warnings, 74 lines checked

Patch 1/2 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/2 Checking commit 12b8055a1905 (spapr: initial implementation for H_TPM_COMM hcall)
WARNING: line over 80 characters
#63: FILE: hw/ppc/spapr.c:3354:
+static void spapr_set_tpm_device_file(Object *obj, const char *value, Error **errp)

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#90: 
new file mode 100644

ERROR: Error messages should not contain newlines
#137: FILE: hw/ppc/spapr_hcall_tpm.c:43:
+        error_report("invalid TPM input buffer size: " TARGET_FMT_lu "\n",

ERROR: Error messages should not contain newlines
#143: FILE: hw/ppc/spapr_hcall_tpm.c:49:
+        error_report("invalid TPM output buffer size: " TARGET_FMT_lu "\n",

ERROR: switch and case should be at the same indent
#202: FILE: hw/ppc/spapr_hcall_tpm.c:108:
+    switch (op) {
+        case TPM_COMM_OP_EXECUTE:
[...]
+        case TPM_COMM_OP_CLOSE_SESSION:
[...]
+        default:

total: 3 errors, 2 warnings, 223 lines checked

Patch 2/2 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/20190712011934.29863-1-mdroth@linux.vnet.ibm.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [Qemu-devel] [RFC PATCH 0/2] spapr: Implement H_TPM_COMM for accessing host TPM device
Posted by David Gibson 4 years, 9 months ago
On Thu, Jul 11, 2019 at 08:19:32PM -0500, Michael Roth wrote:
> These patches are also available at:
> 
>   https://github.com/mdroth/qemu/commits/spapr-tpm-hcall-v0
> 
> This patchset implements the H_TPM_COMM hypercall, which provides a way
> for an Ultravisor to pass raw TPM commands on to a host's TPM device,
> either directly or through a TPM Resource Manager (needed to support
> multiple guests).
> 
> Secure Guests running on an Ultravisor have a symmetric key that is
> encrypted using a public key that is bound to a trusted host's TPM
> hardware. This hypercall provides a means to decrypt the symmetric
> key on behalf of a Secure Guest using the host's TPM hardware.
> 
> More details are provided in the spec summary introduced in patch 1.

This is obviously 4.2 material, other comments on the individual patches.

> 
>  docs/specs/ppc-spapr-uv-hcalls.txt |  74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  hw/ppc/Makefile.objs               |   1 +
>  hw/ppc/spapr.c                     |  27 +++++++++++++++++++++++++++
>  hw/ppc/spapr_hcall_tpm.c           | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  hw/ppc/trace-events                |   4 ++++
>  include/hw/ppc/spapr.h             |   7 ++++++-
>  6 files changed, 247 insertions(+), 1 deletion(-)
> 
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson