[libvirt] [PATCH v8 03/11] libvirt: add new public API to get SEV Info

Erik Skultety eskultet at redhat.com
Thu Jun 7 16:19:12 UTC 2018


A better commit subject would have been:
libvirt: Introduce virNodeGetSEVInfo public API

On Wed, Jun 06, 2018 at 12:50:09PM -0500, Brijesh Singh wrote:
> The API can be used by application to retrieve the Platform Diffie-Hellman
> Key and Platform Certificate chain.
>
> Signed-off-by: Brijesh Singh <<brijesh.singh at amd.com>>
> ---
>  include/libvirt/libvirt-host.h | 42 +++++++++++++++++++++++++++++++++++++
>  src/driver-hypervisor.h        |  6 ++++++
>  src/libvirt-host.c             | 47 ++++++++++++++++++++++++++++++++++++++++++
>  src/libvirt_public.syms        |  1 +
>  4 files changed, 96 insertions(+)

There were a few typos in the macro description, please squash in the diff
below.

Reviewed-by: Erik Skultety <eskultet at redhat.com>

diff --git a/include/libvirt/libvirt-host.h b/include/libvirt/libvirt-host.h
index e46f88b5ce..a04d669901 100644
--- a/include/libvirt/libvirt-host.h
+++ b/include/libvirt/libvirt-host.h
@@ -441,33 +441,33 @@ typedef virNodeMemoryStats *virNodeMemoryStatsPtr;
 /**
  * VIR_NODE_SEV_PDH:
  *
- * Marco represents the Platform Diffie-Hellman key, as VIR_TYPED_PARAMS_STRING.
+ * Macro represents the Platform Diffie-Hellman key, as VIR_TYPED_PARAMS_STRING.
  */
-# define VIR_NODE_SEV_PDH               "pdh"
+# define VIR_NODE_SEV_PDH "pdh"

 /**
  * VIR_NODE_SEV_CERT_CHAIN:
  *
- * Marco represents the Platform certificate chain that includes the
+ * Macro represents the platform certificate chain that includes the platform
  * endorsement key (PEK), owner certificate authority (OCD) and chip
  * endorsement key (CEK), as VIR_TYPED_PARAMS_STRING.
  */
-# define VIR_NODE_SEV_CERT_CHAIN        "cert-chain"
+# define VIR_NODE_SEV_CERT_CHAIN "cert-chain"

 /**
  * VIR_NODE_SEV_CBITPOS:
  *
- * Marco represents the CBit Position used by hypervisor when SEV is enabled.
+ * Macro represents the CBit Position used by hypervisor when SEV is enabled.
  */
-# define VIR_NODE_SEV_CBITPOS        "cbitpos"
+# define VIR_NODE_SEV_CBITPOS "cbitpos"

 /**
  * VIR_NODE_SEV_REDUCED_PHYS_BITS:
  *
- * Marco represents the number of bits we lose in physical address space
+ * Macro represents the number of bits we lose in physical address space
  * when SEV is enabled in the guest.
  */
-# define VIR_NODE_SEV_REDUCED_PHYS_BITS        "reduced-phys-bits"
+# define VIR_NODE_SEV_REDUCED_PHYS_BITS "reduced-phys-bits"

 int virNodeGetSEVInfo (virConnectPtr conn,
                        virTypedParameterPtr *params,
diff --git a/src/libvirt-host.c b/src/libvirt-host.c
index 2a633f01d5..e20d6ee250 100644
--- a/src/libvirt-host.c
+++ b/src/libvirt-host.c
@@ -1640,15 +1640,17 @@ virNodeAllocPages(virConnectPtr conn,
     return -1;
 }

+
 /*
  * virNodeGetSEVInfo:
  * @conn: pointer to the hypervisor connection
- * @params: where to store  SEV information; output
- * @nparams: pointer to number of SEV parameters; output
+ * @params: where to store  SEV information
+ * @nparams: pointer to number of SEV parameters returned in @params
  * @flags: extra flags; not used yet, so callers should always pass 0
  *
- * If hypervisor supports SEV then @params will contains PDH and
- * certificate chain.
+ * If hypervisor supports AMD's SEV feature, then @params will contain various
+ * platform specific information like PDH and certificate chain. Caller is
+ * responsible for freeing @params.
  *
  * Returns 0 in case of success, and -1 in case of failure.
  */




More information about the libvir-list mailing list