History

KVM: Define SEV key management command id

Define Secure Encrypted Virtualization (SEV) key management command id and structure. The command definition is available in SEV KM spec 0.14 (http://support.amd.com/TechDocs/55766_SEV-KM API_Specification.pdf) and Documentation/virtual/kvm/amd-memory-encryption.txt.

Brijesh Singh committed 8 years ago

Commit dc48bae1 parent e9df0942 files · +282 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/kvm.h+80−0
@@ -1369,6 +1369,86 @@ struct kvm_enc_region { · 1368 unmodified lines
13691369 #define KVM_MEMORY_ENCRYPT_REG_REGION _IOR(KVMIO, 0xbb, struct kvm_enc_region)
13701370 #define KVM_MEMORY_ENCRYPT_UNREG_REGION _IOR(KVMIO, 0xbc, struct kvm_enc_region)
13711371
1372+/* Secure Encrypted Virtualization command */
1373+enum sev_cmd_id {
1374+ /* Guest initialization commands */
1375+ KVM_SEV_INIT = 0,
1376+ KVM_SEV_ES_INIT,
1377+ /* Guest launch commands */
1378+ KVM_SEV_LAUNCH_START,
1379+ KVM_SEV_LAUNCH_UPDATE_DATA,
1380+ KVM_SEV_LAUNCH_UPDATE_VMSA,
1381+ KVM_SEV_LAUNCH_SECRET,
1382+ KVM_SEV_LAUNCH_MEASURE,
1383+ KVM_SEV_LAUNCH_FINISH,
1384+ /* Guest migration commands (outgoing) */
1385+ KVM_SEV_SEND_START,
1386+ KVM_SEV_SEND_UPDATE_DATA,
1387+ KVM_SEV_SEND_UPDATE_VMSA,
1388+ KVM_SEV_SEND_FINISH,
1389+ /* Guest migration commands (incoming) */
1390+ KVM_SEV_RECEIVE_START,
1391+ KVM_SEV_RECEIVE_UPDATE_DATA,
1392+ KVM_SEV_RECEIVE_UPDATE_VMSA,
1393+ KVM_SEV_RECEIVE_FINISH,
1394+ /* Guest status and debug commands */
1395+ KVM_SEV_GUEST_STATUS,
1396+ KVM_SEV_DBG_DECRYPT,
1397+ KVM_SEV_DBG_ENCRYPT,
1398+ /* Guest certificates commands */
1399+ KVM_SEV_CERT_EXPORT,
1400+
1401+ KVM_SEV_NR_MAX,
1402+};
1403+
1404+struct kvm_sev_cmd {
1405+ __u32 id;
1406+ __u64 data;
1407+ __u32 error;
1408+ __u32 sev_fd;
1409+};
1410+
1411+struct kvm_sev_launch_start {
1412+ __u32 handle;
1413+ __u32 policy;
1414+ __u64 dh_uaddr;
1415+ __u32 dh_len;
1416+ __u64 session_uaddr;
1417+ __u32 session_len;
1418+};
1419+
1420+struct kvm_sev_launch_update_data {
1421+ __u64 uaddr;
1422+ __u32 len;
1423+};
1424+
1425+
1426+struct kvm_sev_launch_secret {
1427+ __u64 hdr_uaddr;
1428+ __u32 hdr_len;
1429+ __u64 guest_uaddr;
1430+ __u32 guest_len;
1431+ __u64 trans_uaddr;
1432+ __u32 trans_len;
1433+};
1434+
1435+struct kvm_sev_launch_measure {
1436+ __u64 uaddr;
1437+ __u32 len;
1438+};
1439+
1440+struct kvm_sev_guest_status {
1441+ __u32 handle;
1442+ __u32 policy;
1443+ __u32 state;
1444+};
1445+
1446+struct kvm_sev_dbg {
1447+ __u64 src_uaddr;
1448+ __u64 dst_uaddr;
1449+ __u32 len;
1450+};
1451+
13721452 #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
13731453 #define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1)
13741454 #define KVM_DEV_ASSIGN_MASK_INTX (1 << 2)