[PATCH 4/6] KVM: Define Hygon SEV commands

From: Hao Feng
Date: Mon Apr 15 2019 - 08:34:56 EST


1. KVM_SEV_GM_GET_DIGEST
------------------------
The command is used to get the key digest from SEV firmware, guest
owner will check the key digest to see if the key negotiation is
successful or not.

2. KVM_SEV_GM_VERIFY_DIGEST
---------------------------
The command is used to send guest owner's key digest to SEV firmware,
firmware will check the key digest to see if the key negotiation is
successful or not.

Signed-off-by: Hao Feng <fenghao@xxxxxxxx>
---
include/uapi/linux/kvm.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 6d4ea4b..3eb8858 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -1469,6 +1469,10 @@ enum sev_cmd_id {
/* Guest certificates commands */
KVM_SEV_CERT_EXPORT,

+ /* GM specific commands */
+ KVM_SEV_GM_GET_DIGEST,
+ KVM_SEV_GM_VERIFY_DIGEST,
+
KVM_SEV_NR_MAX,
};

@@ -1520,6 +1524,16 @@ struct kvm_sev_dbg {
__u32 len;
};

+struct kvm_sev_gm_get_digest {
+ __u64 uaddr;
+ __u32 len;
+};
+
+struct kvm_sev_gm_verify_digest {
+ __u64 uaddr;
+ __u32 len;
+};
+
#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1)
#define KVM_DEV_ASSIGN_MASK_INTX (1 << 2)
--
2.7.4