Jean-Philippe Brucker <jean-phili...@linaro.org> writes: > This option selects which measurement algorithm to use for attestation. > Supported values are SHA256 and SHA512. Default to SHA512 arbitrarily. > > SHA512 is generally faster on 64-bit architectures. On a few arm64 CPUs > I tested SHA256 is much faster, but that's most likely because they only > support acceleration via FEAT_SHA256 (Armv8.0) and not FEAT_SHA512 > (Armv8.2). Future CPUs supporting RME are likely to also support > FEAT_SHA512. > > Cc: Eric Blake <ebl...@redhat.com> > Cc: Markus Armbruster <arm...@redhat.com> > Cc: Daniel P. Berrangé <berra...@redhat.com> > Cc: Eduardo Habkost <edua...@habkost.net> > Signed-off-by: Jean-Philippe Brucker <jean-phili...@linaro.org> > --- > v1->v2: use enum, pick default > --- > qapi/qom.json | 18 +++++++++++++++++- > target/arm/kvm-rme.c | 39 ++++++++++++++++++++++++++++++++++++++- > 2 files changed, 55 insertions(+), 2 deletions(-) > > diff --git a/qapi/qom.json b/qapi/qom.json > index 91654aa267..84dce666b2 100644 > --- a/qapi/qom.json > +++ b/qapi/qom.json > @@ -931,18 +931,34 @@ > 'data': { '*cpu-affinity': ['uint16'], > '*node-affinity': ['uint16'] } } > > +## > +# @RmeGuestMeasurementAlgo: > +# > +# @sha256: Use the SHA256 algorithm
Let's have a blank line here. > +# @sha512: Use the SHA512 algorithm > +# > +# Algorithm to use for realm measurements > +# > +# Since: FIXME 9.1 > +## > +{ 'enum': 'RmeGuestMeasurementAlgo', > + 'data': ['sha256', 'sha512'] } > + > ## > # @RmeGuestProperties: > # > # Properties for rme-guest objects. > # > +# @measurement-algo: Realm measurement algorithm (default: sha512) > +# We tend to avoid abbreviations in QMP: @measurement-algorithm. May want to rename the type to RmeGuestMeasurementAlgorithm for consistency. > # @personalization-value: Realm personalization value, as a 64-byte hex > string > # (default: 0) > # > # Since: FIXME > ## > { 'struct': 'RmeGuestProperties', > - 'data': { '*personalization-value': 'str' } } > + 'data': { '*personalization-value': 'str', > + '*measurement-algo': 'RmeGuestMeasurementAlgo' } } > > ## > # @ObjectType: With these issues addressed, QAPI schema Acked-by: Markus Armbruster <arm...@redhat.com> [...]