Message ID | 147455599942.8519.8393086220777121018.stgit@brijesh-build-machine (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> 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 37317607D0 for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 22 Sep 2016 15:26:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28EA42ABAB for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 22 Sep 2016 15:26:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D8772ABB0; Thu, 22 Sep 2016 15:26:36 +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 EF7972ABAB for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 22 Sep 2016 15:26:33 +0000 (UTC) Received: from localhost ([::1]:50395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1bn5tQ-0003lw-W7 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Sep 2016 11:26:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1bn5Nb-0001RT-NV for qemu-devel@nongnu.org; Thu, 22 Sep 2016 10:53:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1bn5NV-00084N-Q6 for qemu-devel@nongnu.org; Thu, 22 Sep 2016 10:53:38 -0400 Received: from mail-by2nam03on0069.outbound.protection.outlook.com ([104.47.42.69]:49259 helo=NAM03-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1bn5NV-00083n-HL for qemu-devel@nongnu.org; Thu, 22 Sep 2016 10:53:33 -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=J1exC4fD0XxVggicLn5j4nlW5H0fKFcvzbBB+YzQ00A=; b=2Dzx5tvlhUDfap5rNdWDjBYQVc2nbP6vxbusHHOd+nDrXTWKspTecybnNcyVx0ny/QyJrOVAG/pWOpHhlbFs9HF4sQyxYA3/9Y2sfeLCv/W53NfUAUGYa5uj0MOIZYRaus74Uga1MRo4Z4NY2hw1Mv9I7gWIPgXVoeAuErhKMFg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from [127.0.1.1] (165.204.77.1) by BY2PR12MB0661.namprd12.prod.outlook.com (10.163.113.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Thu, 22 Sep 2016 14:53:30 +0000 From: Brijesh Singh <brijesh.singh@amd.com> To: <ehabkost@redhat.com>, <crosthwaite.peter@gmail.com>, <armbru@redhat.com>, <mst@redhat.com>, <p.fedin@samsung.com>, <qemu-devel@nongnu.org>, <lcapitulino@redhat.com>, <pbonzini@redhat.com>, <rth@twiddle.net> Date: Thu, 22 Sep 2016 10:53:19 -0400 Message-ID: <147455599942.8519.8393086220777121018.stgit@brijesh-build-machine> In-Reply-To: <147455590865.8519.11191009507297313736.stgit@brijesh-build-machine> References: <147455590865.8519.11191009507297313736.stgit@brijesh-build-machine> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BLUPR01CA048.prod.exchangelabs.com (10.160.23.38) To BY2PR12MB0661.namprd12.prod.outlook.com (10.163.113.150) X-MS-Office365-Filtering-Correlation-Id: 23bcda1c-a04c-46a8-522e-08d3e2f8386c X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0661; 2:6mmFcblt80xLXkMFtgAs140QNYCYRjxJywb09wjG+W9c+f79/E0wD0R5PB39o22M2JGAHLGjZGTHvKhBX19qvQwV3zj8V8zvSsLr4EjoMImjg4qRwU8DyubwLGEEKUiV4VuvfHT+rdBDL/Fdx0Q+SF+iATW65+FLJBzOmiXnJDtePK4Z8IuCQ2EflhrM2rGE; 3:g+JRGuAD70swKro4U87Ww0VC+UFovh/7iek0Fwg8l4OtUdxD+bJtZvwLOmN5UZL03Cev+C12E05t4IoscjVgipx7C6HvL6qaWOGDK8mW8gtI+NZPBaRERnFawyT20GKd; 25:a3GwG3/MRWZWXgXJBmc9q6w8wjPvLbPgD1gqC+DCeappXgd6mPFTD0v1Ay7aRJGNj8CN2yUyhhP9z2C2XIM/15AzokSD1MIZMm69VMLSMOXM4/dYUuTXRprfWymL2Uf705SR5ol7M6KIIQN3qegLnPaNCvX/FYs+83QsdRC0rQ9P5chEfVhe9NfNdWWrbrF9Q2ZoSih4zqFrhyJ/Bttv+oUgJiID0TnthCLV2/eqYKDIRV+Dd+5W/QVZw1zsq1G/R2oup0zOawuGPqdt/Q0iwB3Be2dWvQ1keIvPSIW7ZTi8afV9iCBroau6NOtc49ggIQMNXfMCSjE4v/XcNYg61lYurwYrbVNK6tu/lJVcXMoKc+rxysc5ZONSAqgpKN7sG9IFow6Gibdv4JR7pZ/CfmJcy4I7NS/mxczqfRjx+yY= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR12MB0661; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0661; 31:ou9RGwjCFuaow//uTHhrBO7NP4643e3+9rlBds4/AmAP08dJeMmki4kaSRTGWYhpziZWenJaK+QxzwOYgAtjWObc3QE6H5T8NZLY6dZvFujw6/YhXIbHnxpMDHRaO+ZkxlEqK3dCWVW4BrO3BpsG7RqYcMhIMO6T5324LeOpVARimjMjP6wecTPRfESzrLBm/EBKkxD95roaBgYXSRmU/Yz5G1ffKFXHWPVFDoP65mM=; 20:gPxvps1teR3Kb1Rm3py2UZT3NhlkLmlQOJSe5SB4sV4mKb9OLdt7v3hB2kcDiTYyPfLdvJ96zPyQ1kQdgvIuH68LE7vCU4RY2lFyoN6h6P9P1+5pIa52QQ4V8iCyse7cZ95A1XHbYttwCVqbUziScOhxXEtoTPdX3BfWP3TReBH5FW8vxROfxX/KtCBg6DKvqi21JaByJcHjlhgJX1439ID9V+a9RDsfQQRuzkePjmg82aJUlSX0jp6YV3QK8Mr/bggak89UxUDIFsDiO1hsc69PrT4mU+3rOC0VGTpSZP0EW7/cM0jdsCuyUbRQMSLM6IeVrgybllyy9KLHunXEoPBNVJ+DZj8vkJyj2WBc8fpqp+xjgnjlTHG/200RtjiFpKtH5DErsOeX3JpRD73ghO8VmS5CgEPwEYP7wloqYWnAOLyqvoYFd+qINd2jbAwCkFejADmqXLi76A474hrQnKRwwLrBZMC3Gt7RVhw+VAevLJaYfjMHi7XvO6nF7T9Z X-Microsoft-Antispam-PRVS: <BY2PR12MB06612EFDCA1D13830799B4E3E5C90@BY2PR12MB0661.namprd12.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:BY2PR12MB0661; BCL:0; PCL:0; RULEID:; SRVR:BY2PR12MB0661; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0661; 4:UI8Kz4ZAXaNqWeMjLbsvCekfdAlHBucJFtDjyaLOkGARzbxicT5UWvOGbh64b2VLKPgavXuAiOfAI9WiiERNiqf5jdwbSZeiK8tnEG1dN9fx8EQJzwrb1XyTl2y6dSDHrPCuN2Sv7iAxIOXFHJ6tE5HINSZceRilMfMuPc2CKPjT+WuS9zhJ1NlN4l1BGD031ju3xOkpUIXv44gpVd0QyHy+4s8VXaYGOzCUmCSsiQ01ZFQ+bFEuX7ZJLRXr9ksjBVUMC2KoB1AKUhLvKbcQ6/Gt+aHab6oVBnCCTfPQJ5HgIoxnl8gEMrT7RnG5GX6ZSwq+MCwkfD6pmT9Psf+CfDmlpLgEEauIv3EpmxJ41Oo9l9rhnhvnntxZFzKm65ihae3oBruPfVo+707d44pnEHDe9dVdIGKO4mxUFbPUT3WJm5ZHx0r+JxWMABKSbamU X-Forefront-PRVS: 0073BFEF03 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(7916002)(189002)(199003)(6116002)(107886002)(19580395003)(83506001)(105586002)(68736007)(42186005)(2950100001)(4001350100001)(81166006)(305945005)(2201001)(97736004)(101416001)(189998001)(19580405001)(77096005)(2906002)(106356001)(33716001)(92566002)(7846002)(9686002)(7736002)(586003)(3846002)(33646002)(23676002)(8676002)(86362001)(229853001)(50466002)(81156014)(47776003)(66066001)(5001770100001)(5660300001)(50986999)(54356999)(103116003)(230700001)(76176999)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR12MB0661; 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?MTtCWTJQUjEyTUIwNjYxOzIzOk9WK2RlbnRNSU13V2s0dUhSOW5aeHpaVUNz?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3i34nn9EP+RE6zbV5z6PeI+0vWxLZRsTbH9n9 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2016 14:53:30.4341 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0661 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.42.69 Subject: [Qemu-devel] [RFC PATCH v2 09/16] sev: add LAUNCH_START command X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/sev.c b/sev.c index 226ad76..ead7c5a 100644 --- a/sev.c +++ b/sev.c @@ -910,17 +910,45 @@ static const TypeInfo qsev_receive_info = { }; static int +sev_ioctl(int cmd, void *data) +{ + int ret; + struct kvm_sev_issue_cmd input; + + input.cmd = cmd; + input.opaque = (__u64)data; + ret = kvm_vm_ioctl(kvm_state, KVM_SEV_ISSUE_CMD, &input); + if (ret) { + fprintf(stderr, "sev_ioctl failed cmd=%#x, ret=%d(%#010x)\n", + cmd, ret, input.ret_code); + return ret; + } + + return 0; +} + +static int sev_launch_start(SEVState *s) { int ret; + if (s->state == SEV_STATE_LAUNCHING) { + return 0; + } + ret = sev_launch_info_get_params(s->launch_id, &s->launch_start, &s->launch_update, &s->launch_finish); if (ret < 0) { return -1; } - // add the command to launch guest in next patches + ret = sev_ioctl(KVM_SEV_LAUNCH_START, s->launch_start); + if (ret < 0) { + return -1; + } + + s->state = SEV_STATE_LAUNCHING; + DPRINTF("SEV: LAUNCH_START\n"); return 0; }
The command is used to prepare a guest for the transition into SEV-enabled mode. Command uses the parameters specified in 'sev-launch-info' object, see doc/amd-memory-encryption.txt for parameter details. The command creates a new VM Encryption Key (VEK) and cryptographic context. The key created during launch start process will be used to encrypt the guest memory. Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> --- sev.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-)