From patchwork Tue Sep 13 14:48:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 9329339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0DC1060231 for ; Tue, 13 Sep 2016 15:47:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1E0428D37 for ; Tue, 13 Sep 2016 15:47:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5CAB28DA8; Tue, 13 Sep 2016 15:47:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4C8B828D37 for ; Tue, 13 Sep 2016 15:47:53 +0000 (UTC) Received: from localhost ([::1]:49743 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjpw8-0000Qj-Bw for patchwork-qemu-devel@patchwork.kernel.org; Tue, 13 Sep 2016 11:47:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjpWO-0003Wz-LW for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:21:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjpWI-0008M8-Om for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:21:15 -0400 Received: from mail-by2nam03on0064.outbound.protection.outlook.com ([104.47.42.64]:12192 helo=NAM03-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjpWI-0008Kq-El for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:21:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=eSZ6VJ0xz73+SExsSOYsE1aPf+nheIfgaBs823DxsdQ=; b=TSDHFOIly6uAtrTcGAlDvvrlm7iRqArNHPJ1eo8eM/g9jIROPMk53Ylj9lTOe5gBE9mfjj4UZL3uwRKADZFJcfm5uzO+hYukp6wzwThGKh+cjtgyUkv9zmrCcTVrWlJoIAHVbLddYNKyF67Ow9XUfgbFURdv+wG+qzRE2SLc+90= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from [127.0.1.1] (165.204.77.1) by SN1PR12MB0670.namprd12.prod.outlook.com (10.163.208.28) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9; Tue, 13 Sep 2016 14:48:22 +0000 From: Brijesh Singh To: , , , , , , , , Date: Tue, 13 Sep 2016 10:48:18 -0400 Message-ID: <147377809806.11859.4375323376894641953.stgit@brijesh-build-machine> In-Reply-To: <147377800565.11859.4411044563640180545.stgit@brijesh-build-machine> References: <147377800565.11859.4411044563640180545.stgit@brijesh-build-machine> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BY2PR1001CA0001.namprd10.prod.outlook.com (10.164.163.139) To SN1PR12MB0670.namprd12.prod.outlook.com (10.163.208.28) X-MS-Office365-Filtering-Correlation-Id: 4a530f7c-be71-4d36-743e-08d3dbe502e7 X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0670; 2:UPVvi6sYpFoAuab0K1gBHOrscXmuF6/sbZmTXsQL4YKyPm4UPNfXFwx7FSvLbTu6ZeIFYl3CjUEmJElunht0UjpS1xeVSfpaPqLB1hMKJMvRPeOcsyd6K3sv32VC9qDr6SVevCGtofuN/YZfIB6PDvIxrju8WW2GUFeZziGV9+El1mstSX7e5XZsrFuakeWz; 3:YX9hP0WiTtAOEg2kJl4jYVOj/2rDbyrFrBzdm/KSd1davON/xwZQOvFtSk9HsOSykinVYV7y8YiLlwp2fF2NgnigyELDbLeBdoNDHmTyDYZ7aFGUPrauEoozh88JaCkk X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR12MB0670; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0670; 25:1K8/J8Kv8kqKjusw5XJsv43uq53UXuOSQBiWKwrqWaSg8O3wIXn5tmfziNmv9d9l63myqUVAvfQ/gSQXk5cSObdHyt57uCjFemXzkTlVcg8zoVnLFG897ofdA1sj3rf+Dknz86jx9cK6C7hYbJxdbqy6ULgW3kCUGNEernCfKOs/1Jzhou5L9DTRP9niwzh2V7SPJ0cBsadfCkUQWogCzGnUzpQOhOlQWCn8gcPCK0yKSeAJgU4wSVqN75KX1lgN5TjUL4xNKJn0GNSeKzHw9o1H3vXfFIpmpkttpl0V3idQi+lE8ceomCamcv6LdnpgZYHbJkaWt6NFCHEfLxTlGc4QicB5wJCNMh6yk4bSQu4HZ3jerJatm2uNOiX/FgPwKQHySw5h94NKfibFXaGVj2wY+XMc3iwZOS/3lercqa4pAOzIE3/xcrhy5vTjtlcgBl3R1jIbv9g1mVA91aBj27bhpTLbm9sWeyqON9vDJ9feoX4gm5lEmAgPqLAFQ4AOrRFerXoVh9TLUTDX3UL8PDj0CbUeKeh4jXG+l1qohwZF3321gxyNbYXepZGv5k9I+N0Fagsb5chFVVSFUyH1nHssndC+mOhVmE2wByCAA6B0hL60xA0DUtETB6Nz7RTI7ykDllPNetZo7mGEWDMb6a8yDJkzajQoIu91Y9mb8MpncOipmhFTyNaH7oQm+9cWTPQSQtXkYJ7ydZFL9nknscG1e7faCgOvFIJz/JpXmEJnU5GSFWTunQKPcD+SeegyZienzrBUzIbmAW+ZMS3zlxpvt1o3z9Ww/PjwjC1m9X0= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0670; 31:RPi+PChkfe8GRPvY8KQSE+5j3LxTzDj/hs5d/ObHr/Ki59ngzrDYy2da4PT4cJITa+IvCpOwjKcOIqhSYuiPrYepidfmsTNNjUXd2OCA6yfcajY6vbYVe4yoqls1vv+NaIpS8YL0zja2m8DfKi5lnPksf4DAeHZLVBqAi/fclRPkDbsV+ZiwxP+8/ngXOXRIshcJlyIT1ZxNY+y9rgJuJFbG6/OoGUE700thgGQYAQY=; 20:M+lM4oa+tmJnCatNtQUsP+/ZYNrr/incWghEzUq/u13EO6MYPTWqGf+O4UwOZsVrlehnAnkBIrlHkbBbj/jtQfwbYBNw0vKZENHhfhvWesakD98IaJgzS+ilMQVs9Jp2a/1Ai/igcxouVg2TLx7kGQfzhj5bvVj8V1gG8CbUGg56GN/2jruNSHFUHc1OH/nNaG0L7cjDBuPm3bj8cSTBDlSusuo3LlEEauRlpMMpgI0yOvH2CgCbGyyslIyRVQXHXHZOBLhXVKiU6REkQzrn5OB+1xSmdvRKAgcOr4ys/AnvZovJrehj5IRaGEgZdPwkamECj9Fw+a7g8ibuVsvSfu8FXUT9s623RB8HziR91J/HfmghC+HHhkhc8Jku+cGEr2gQY7LT0D5b29GxNn3scw9hKIz3J7f4s4lfzBJ+c3O3W3chxtldHFC61BVyBrVf/P4Y1cF4vQ5VZ8GU1xd6C/+U9cQCohGocLSLJ5p9IFRSabrHipvlJW/af2a9nrpy X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:SN1PR12MB0670; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0670; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0670; 4:J1PmPFOeDVJ8f3UZxhmuUHoLIOG99BZ769OQEotRCPvN4vKVnbdpqiBcZyZ/cdosW/FJoZS+h8/znqdDYa6WxD7aH2MohCH9CV1mgTcBnnHL36EADoGx/O39FaIIjC5IuaI7nzNaBScGG08/oPZaeoBc2XVEBP0TXg1L4Tvylj4XQAN50MvFApms5pz2LcUtsmbEbe+YyCMbfS6KdkpyyMSqJFRIVUb4UtTJYM+T9ePrJ67PryQDr5KReUfmErg4ANR4HkAgO0p9l35g8PTj0BLJH646iArqQZ7w1I+lLuVoTFcuk0iBn1MJ9mMarvxgzL1oi2/Ja5t3TXZy8kc9oBQju9renGv82la9LWxMqFUsSXES92Wmhcobo7pL/eBrm/Fp3xkH+1DhnXk2uMxhz4fjDodE6pblZzK6hmJZnjJ6HvNQyj36crvd4AHPAoxJ X-Forefront-PRVS: 0064B3273C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(7916002)(209900001)(189002)(199003)(103116003)(86362001)(7846002)(106356001)(81166006)(105586002)(15395725005)(2906002)(2201001)(3846002)(9686002)(81156014)(8676002)(4001350100001)(42186005)(97736004)(6116002)(305945005)(5001770100001)(23676002)(107886002)(229853001)(33646002)(76176999)(77096005)(54356999)(7736002)(50986999)(189998001)(66066001)(33716001)(2950100001)(83506001)(68736007)(47776003)(586003)(19580395003)(230700001)(15975445007)(50466002)(92566002)(5660300001)(19580405001)(101416001)(217873001)(6606295002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0670; H:[127.0.1.1]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjEyTUIwNjcwOzIzOk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IR1hPTGdXYU5KWWJLMmFF?= =?utf-8?Q?BFxkC61kGzSV3?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0670; 6:e/auFIjrEHkRVizRAJDy3UZn4eS/rDD1L8EGr9BFEJTta6ZmHERRltXvNYL9T3+WEX0Isu3hF0SDjb8R0gZl5YI1qpf05o31WSFAnEitrXkVWQLIo3F27/jrTS7kXqXfwOBuTvEyh9Y9chMloiu7daVyDQeKhoi5G/9+ApC+PNECYpteUQmh/sgrtCB82Y4TjoQ0WMrVwu17R8MCDCheReF9LWJriL8KUmxZ9kOLfgeMMmJ/pjPim9KQbtLxO/nzHmSUDxUkLtxHTOT17xMZ/rjJ9kRzeGiOL2YHEyyxd9g2m1r5GbL0M1bE4C0FDVKWKq0Ip4/AKtG0E3i/YiIeQw==; 5:DPZ9sVr34qX12N898smJSfyVGx5zb2jgG46a2b/UWkEeWGOaRKj33K1Yv2cJ60/rPYaCPbXVYXwjdjZVlxzP/wKA8S5lwbH5eboWTePkz1Yus08XMZT3ahix2d0HGF1u8PAbjfQEKLh1yk8EF0wumQ==; 24:B8aW0T2HpmSt54wHs3YSbLtG9wqv/M638/b1tTJEDPIhV3/hO1iAjWO2LK3DuEJQX39T9zsUunzQC5Wak4ZJExG5AtZkcdbnqOBhPCMKAwc=; 7:iz/0kbW2JYKM0Ev+8/K7ggU98oni9QsExENmBi/49VJFAxjCMCYWzHtJ1ZsKBdayBVHv+kL2HC+d2jJOGwLoQSXiHZMmMFUFiGC8lIjRedpT0lpyiMXVGU7z8R9Y1mC6ULHiLv78YGBjqf8QXd1nOsSdnUta299R2jG0Z2JqlNwImDVKohK8dJ5jRV9EQGPstTqI494EVWspvHTXyaaMOlB2Xa878jFuVSneUUtRYPlRBtO8vbOVLw82nG41uMD+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0670; 20:lEK0eTeBL1E3wKy09XYw2q877J2YC/eZirEFgZ/am4qUrLHmmHq4h0z56G0Wbd6PyBBYB9cxwQkI/uSMEY/WA4R74hJQXGnPl1HVYGRIi+FL2ch8YxKCRdIQJ3CsyT+aUAbGqUJIdoN60HOFAssDiUCx9vSe8s3MIO+5X8/Rg8EfyFj39tAO+Dhqb+zTvXZEsf2eeTNxw4wnYRTcQwjJZS8ibK3r1IEjlFPleVrs/l6pIXvArS4njDARF6+y0dXA X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2016 14:48:22.2901 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0670 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.42.64 X-Mailman-Approved-At: Tue, 13 Sep 2016 11:45:46 -0400 Subject: [Qemu-devel] [RFC PATCH v1 09/22] sev: add SEV launch finish command X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The SEV LAUNCH_FINISH command is used for finalizing the guest launch process. The commad returned a measurement value that can be handed to the guest owner to validate the guest before vmrun. For more information see [1], section 6.3 [1] http://support.amd.com/TechDocs/55766_SEV-KM%20API_Spec.pdf The following KVM RFC patches defines and implements this command http://marc.info/?l=kvm&m=147190852423972&w=2 http://marc.info/?l=kvm&m=147190856623987&w=2 Signed-off-by: Brijesh Singh --- include/sysemu/sev.h | 17 +++++++++++++- sev.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/include/sysemu/sev.h b/include/sysemu/sev.h index b58a9d7..ab03c5d 100644 --- a/include/sysemu/sev.h +++ b/include/sysemu/sev.h @@ -39,5 +39,20 @@ int kvm_sev_guest_start(void); */ int kvm_sev_guest_update(uint8_t *address, uint32_t len); -#endif +/** + * kvm_sev_guest_finish - finialize launching guest into SEV mode. + */ +int kvm_sev_guest_finish(void); +/** + * kvm_sev_guest_get_measurement - get measurement from launch finish command. + * + * @measurement: measurement values returned from the SEV. Its 32-byte value + * and buffer must be allocated by caller. + * + * Returns: 0 on success and @measurement will contain the value, or + * 1 on failure. + */ +int kvm_sev_guest_measurement(uint8_t *measurement); + +#endif diff --git a/sev.c b/sev.c index a451dc0..055ed83 100644 --- a/sev.c +++ b/sev.c @@ -48,6 +48,7 @@ enum { SEV_LAUNCH_START = 0x1, + SEV_LAUNCH_FINISH, }; struct SEVInfo { @@ -326,6 +327,32 @@ static int sev_launch_update(uint8_t *addr, uint32_t len) return 0; } +static int sev_launch_finish(void) +{ + int i, ret; + SEVInfo *s = sev_info; + struct kvm_sev_issue_cmd input; + struct kvm_sev_launch_finish *finish = s->launch_finish; + + input.cmd = KVM_SEV_LAUNCH_FINISH; + input.opaque = (__u64)finish; + ret = kvm_vm_ioctl(kvm_state, KVM_SEV_ISSUE_CMD, &input); + if (ret) { + fprintf(stderr, "SEV: launch_finish failed ret=%d(%#010x)\n", + ret, input.ret_code); + exit(EXIT_FAILURE); + } + + DPRINTF("SEV: LAUNCH finish measurement=0x"); + for (i = 0; i < 32; i++) { + DPRINTF("%02x", finish->measurement[i]); + } + DPRINTF("\n"); + + s->state = SEV_LAUNCH_FINISH; + return 0; +} + int kvm_sev_guest_start(void) { SEVInfo *s = sev_info; @@ -371,3 +398,37 @@ int kvm_sev_guest_update(uint8_t *addr, uint32_t len) return 1; } + +int kvm_sev_guest_finish(void) +{ + SEVInfo *s = sev_info; + + if (!s) { + return 1; + } + + if (s->state == SEV_LAUNCH_START) { + return sev_launch_finish(); + } + + return 1; +} + +int kvm_sev_guest_measurement(uint8_t *out) +{ + SEVInfo *s = sev_info; + struct kvm_sev_launch_finish *finish = s->launch_finish; + + if (!s) { + return 1; + } + + if (s->type == UNENCRYPTED_GUEST && + s->state == SEV_LAUNCH_FINISH) { + memcpy(out, finish->measurement, 32); + } else { + return 1; + } + + return 0; +}