Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2126286yba; Mon, 15 Apr 2019 05:35:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNaskaxeNgLROPpTXBY4PJUpJegV5RJLaT7MJUOmKt8LbOhcEqGa3d3K16hfs7bhpp6j2D X-Received: by 2002:a63:7c45:: with SMTP id l5mr70237832pgn.303.1555331747337; Mon, 15 Apr 2019 05:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555331747; cv=none; d=google.com; s=arc-20160816; b=kkdCv/IWgD3v0jfhN5CsqsCupXCv+qmkGdORrVUI5d5bS9sohB9laN6D5A6YIsyVdb F5lVP3DNaHNepMARdElSPBXcf1HqaKJgh0lBy3PUjulrTctClSuTqkf7yAlPdtNqheHX lz75qr+nXDjmwPzjGCsKxpqyjZmK1NvUAymDh3icR6Kk2chw1PMUvciQ0Y1fTigfuDar 6ELHQpKePTCR+eac1AobEjFFtq9rWalzTxStd2GtpmSiDV61bMc+4+IxKUlRwqR9ySks ExHpcSD39zcauISbPctSALawebS3dJdD5wbhcoNRJt/W4Us+ZLzsy1MHN3Pp1lETimI8 J7Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=dA6mLhBVJL4KuLI+PtwOztF2a0fHucqnqSqtOYmDdSU=; b=UEWAA74RjANjL6wEyDO68vFV0RyiRQl5QQJIW6GORPoOJRmsA5D6vXuRn8Qgsnq5iz fpFyOUop7AypL23SQfFJBySgjMUdheRotuYNEEytXrhkKav6I9ASLvrpQyvfHgzmPtTM 3Z+IWDxtj7IKYszHAoG6betTFq2q2T7Y1wYUyvnGcLgLxjJlKJUWCrfawdQWDo/Zzq4u WhJK+2bV6/+cyKfBg3zLmyLzToMi6GL7UyrKe60hxSTDsy/XNpmPVxrrAA/7G0fC+eSJ nreSfjfKiJCZ39zeO73+GevFHzQIkgMjnlLeQlRQAlRXB6XwJWjw6BfOIeJUe8ZLhHQi jF3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hygon.cn Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si44214837pgc.225.2019.04.15.05.35.29; Mon, 15 Apr 2019 05:35:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hygon.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727328AbfDOMez (ORCPT + 99 others); Mon, 15 Apr 2019 08:34:55 -0400 Received: from [110.188.70.11] ([110.188.70.11]:41896 "EHLO spam2.hygon.cn" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727129AbfDOMey (ORCPT ); Mon, 15 Apr 2019 08:34:54 -0400 X-Greylist: delayed 1561 seconds by postgrey-1.27 at vger.kernel.org; Mon, 15 Apr 2019 08:34:53 EDT Received: from spam2.hygon.cn (localhost [127.0.0.2] (may be forged)) by spam2.hygon.cn with ESMTP id x3FC8xIO059284; Mon, 15 Apr 2019 20:08:59 +0800 (GMT-8) (envelope-from fenghao@hygon.cn) Received: from MK-DB.hygon.cn ([172.23.18.60]) by spam2.hygon.cn with ESMTP id x3FC7f4O059224; Mon, 15 Apr 2019 20:07:41 +0800 (GMT-8) (envelope-from fenghao@hygon.cn) Received: from cncheex02.Hygon.cn ([172.23.18.12]) by MK-DB.hygon.cn with ESMTP id x3FC7Vax053939; Mon, 15 Apr 2019 20:07:31 +0800 (GMT-8) (envelope-from fenghao@hygon.cn) Received: from harry-Inspiron-5675.higon.com (172.23.18.44) by cncheex02.Hygon.cn (172.23.18.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1466.3; Mon, 15 Apr 2019 20:07:35 +0800 From: Hao Feng To: "'Paolo Bonzini '" , =?UTF-8?q?=27=20Radim=20Kr=C4=8Dm=C3=A1=C5=99=20=27?= CC: "'Zhaohui Du '" , "'Zhiwei Ying '" , "'Wen Pu '" , Hao Feng , , Subject: [PATCH 4/6] KVM: Define Hygon SEV commands Date: Mon, 15 Apr 2019 20:04:26 +0800 Message-ID: <1555329868-17895-5-git-send-email-fenghao@hygon.cn> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555329868-17895-1-git-send-email-fenghao@hygon.cn> References: <1555329868-17895-1-git-send-email-fenghao@hygon.cn> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.23.18.44] X-ClientProxiedBy: cncheex02.Hygon.cn (172.23.18.12) To cncheex02.Hygon.cn (172.23.18.12) X-MAIL: spam2.hygon.cn x3FC7f4O059224 X-DNSRBL: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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