Message ID | 147801562823.18237.14268813373957314485.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 33D5D600C8 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 1 Nov 2016 16:07:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25E082998E for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 1 Nov 2016 16:07:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A50029992; Tue, 1 Nov 2016 16:07:49 +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 BABEC2998E for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 1 Nov 2016 16:07:47 +0000 (UTC) Received: from localhost ([::1]:48915 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 1c1bbG-0008Ik-Jo for patchwork-qemu-devel@patchwork.kernel.org; Tue, 01 Nov 2016 12:07:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1c1bNv-0005rC-In for qemu-devel@nongnu.org; Tue, 01 Nov 2016 11:54:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1c1bNr-0003uZ-FR for qemu-devel@nongnu.org; Tue, 01 Nov 2016 11:53:59 -0400 Received: from mail-bn3nam01on0044.outbound.protection.outlook.com ([104.47.33.44]:65360 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1c1bNr-0003uK-9i for qemu-devel@nongnu.org; Tue, 01 Nov 2016 11:53:55 -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=KqwkHGER1slt226/vXk8HnTTfmRqgvC3B0WgUkgNnOw=; b=NamB2R3mrjVkrydwONgW1zZX1MEsa4j2k/IuXW90Z6krBBkND8cq0ScG6aU0O01+tO3TGN0dcDQnq/Y0c3kpPnsLh/CCFbzrbHAaWXW/w3PaR51CNiE92sM9vs+rWsks97yivZwbL3BOSEhscmgbEMCSrilvyiard78PtCdCeWw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from [127.0.1.1] (165.204.77.1) by CY1PR12MB0668.namprd12.prod.outlook.com (10.163.238.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Tue, 1 Nov 2016 15:53:52 +0000 From: Brijesh Singh <brijesh.singh@amd.com> To: <Thomas.Lendacky@amd.com>, <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: Tue, 1 Nov 2016 11:53:48 -0400 Message-ID: <147801562823.18237.14268813373957314485.stgit@brijesh-build-machine> In-Reply-To: <147801550845.18237.12915616525154608660.stgit@brijesh-build-machine> References: <147801550845.18237.12915616525154608660.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: BY2PR1001CA0084.namprd10.prod.outlook.com (10.164.163.52) To CY1PR12MB0668.namprd12.prod.outlook.com (10.163.238.153) X-MS-Office365-Filtering-Correlation-Id: 6a4db9e3-de03-4547-3aac-08d4026f4793 X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0668; 2:3O1kx0w4lKUM9dr31IK5DL65zX72IQraLrBAh6iYveVo00POoXsAWNqkty0GWMiy/vlQY6U3YWRjbHQv6lFDou1sO+pTIK/jPuG9chkR/N/3PGJF0Np8xM0ifaPcea6wg1VvpS8CmzupyvAe2Hq9wnG4mleAlZTt7B124xnMGUcDOT60nefr/+h/xM0feP/SJXZXYLIUXn1tVm0bpFK9gw==; 3:kspwnvM1wjV5b2SUWF7xLa4GbRGHvqMmRDnZx1G+MCPCxxbF6jc24hO41Asmw0mI0GHOomzbL/MQh/Fen2faO9onfDqFGONocMcKjnnkrg4+cz0dgwbNQ01UcGoBCnuDeWqbv+BjSt7vjQpi6CqXQw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR12MB0668; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0668; 25:Vpfse+hfVrNxr+LEgi3BT9T1kJp4+dhSrC/wAPUDX6AkKDOv7vctecoccgGpuc7myPQ0pxJBFg0j5id559VvbUvlo9z9+tEgCA/PPY8xqtaLWvsL1lRC/IiWYROuvnFZc6ktP8GxaTY5ZVHSEuK5EskSOUifmgxe8zsegH6OAKAaE/yWKh7/NUmvehM+qnr/RCb3dneiWAIa1dEFdk9PDyE26CuuW+ZMrSlDtPI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vKVrPEMxm6rDLwdGIHR7HRy5JjfoZz2stc5Qsn9fXFm/ZaGSH2X6fJcjUI+Nacn+h7Y3kfg8G95vGY5MZIvO0lIZb7woEuNGBDr743fAgq9raN8+ccDfDVXVX6GaKkUUKEa44a1uTehuoQWJB506hMWf67HeiSXOjoAfnN/RqYiETnIlMSgkns61VrKCh7AdY4LlHYalunNc8vMxm9FEEN6KxnOrwFLTEe2e1j5uVFR X-Microsoft-Antispam-PRVS: <CY1PR12MB06681BB7906D93EDE96193D7E5A10@CY1PR12MB0668.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)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:CY1PR12MB0668; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0668; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0668; 4:XY6d8/fFuxJjs8yHS4yZ2tdVHGyBry8SSw7LPlwowbsRU2mj/lAwTOj4rK5bMqp97+M7PFtYyH2HbowiNsIsmUfwm4wHRLeOkt+d9aTI352l2vD2wyPEFbNCY3VvqOb/g/cUJoZDSi7/UvBDOQBgKk2iIRYlPANk/cPmuUE7Jj1SbHbRanD0NkPAyOLQ8x4llgkJBWoMISbSuMEbj7QZSGzaT3o9R5D0fFyEyItH3/xPIidxVzfWeShBd1YsgdQvHwo/uwi+xIFLjUOYOmiX5iTWMpr5dv+J60gWVfS7la3dwUrGyz21onMUQWwJICtrm7YZzwDYIUyKZhCWXdAwT1vLG79vySLN7aVHpHQ4T5LIl8slqjH++Setd7fGOqfhvsyPdZ9MMMgpBo/KHm+h42WvFzV+jP8qJuvRIkQQxKfwggO/2zI/6fTU5TRP4cQBpl9UYqtZshjpp11xw6QlNQ== X-Forefront-PRVS: 01136D2D90 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(7916002)(199003)(189002)(33716001)(4326007)(66066001)(23676002)(68736007)(103116003)(33646002)(6116002)(47776003)(3846002)(83506001)(77096005)(50466002)(189998001)(97736004)(5001770100001)(86362001)(4001350100001)(92566002)(50986999)(2906002)(6666003)(7846002)(2950100002)(229853001)(76176999)(42186005)(54356999)(19580395003)(19580405001)(305945005)(2201001)(7736002)(5660300001)(7416002)(81156014)(8676002)(81166006)(230700001)(9686002)(101416001)(106356001)(105586002)(586003)(921003)(217873001)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0668; H:[127.0.1.1]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjEyTUIwNjY4OzIzOjlURFBFclR6RjI0ZWlMQXdIL2lCR1h4ZU5w?= =?utf-8?B?bXJuWnY3WUpOU1Q4YnlIWDRhWFFWTHNwd1k5Q1UxRCt6ZkJwYmJkZFdDMGkx?= =?utf-8?B?SFI1UE5PaENyMElBb3ZvTlJjVVRvNVBZRXpSc09iTExIY0VIdlBQeVBHL09S?= =?utf-8?B?djlPZjRFcUxXUGUxWURiWk0rdDlLb0RWUVVjT012bzZCdmp4ZWxaVzJZZ2sr?= =?utf-8?B?cVkwL3dEZHVqVUx5YWtnV1JGQmdzYmtvanVOK1hlOHVwYm9qMjdRbmxWNFlz?= =?utf-8?B?ZXBOV0pxSTlqMGhCSkxBMXdvdEFsRnhyY0pOYUx5R0xDRW5tMnN2dmJWOGNO?= =?utf-8?B?MWZMWGw1MEZTWU9pQklGZkhCWHpFSW1yaCtaSytteG5YcHVqNzNFYVpocXpn?= =?utf-8?B?R1cveVVtMFRIWkdueE1mVTN0MC84WFY5VThsM3ZGRE1QcWJTa3BnOWZ5NXRo?= =?utf-8?B?RWpaTUkySExMTlU4NHg1SG9vaFIwM05HL3NwRjFDWHZNYzJST1M4Tk93bWFy?= =?utf-8?B?TkRzRDk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DiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0668; 7:PLP7pRGKqSey313A+2F66j0fkSRaCdAc+TXSa6KhzTTdzfZ2RPd/ZwCUfdWbdi4Jg6hnBFwxznSqjxALMvo7hsq5q2M4yqOJjQCwHBi9NbT4t/L4NhWqz0oRVp/Z8tZQW+cha8f9wZUUWFyK3A2f1hT86aYJRs0N8CJNsC8H5ozS+dwUizP0Rt1joH8oqGTn6vS8/gT/2IG6FYMeVSxzdDgEreMAkeFwMulGqmI3y4ysLHDa2dusmiGFfaJo7sYQbZfXbLmfVYivo86//wOLzj6NAuzoezI6akY75gBCWUB9hJlc/lH6JpxTxaO1TqhQ/LTfpEE18SY1E5NX1UBPvsINPoUhi3mzuInpUQWYAyk=; 20:yd0Vjf+g82rr7ekizGiACfDkjQCPTVHMYeoMmAXCmkQychQpAaN7g/Pq2/wT/2ESs/U5pWTAxpZtB2gNDKpG2vGl94/2/LWHCQk1EsnZxQ2MKF4PreS3Azcs1PEfapobhmvYxbldu+JUkCH+MAXDYFa5RE/HbIrLDurkDGLl38y4f0cTT4Jr5kTNBJbVzojK5xI0OJBi5wxltU+7sA6/5kAGQz/47qWvTFZ1tpciyKpJ37JBX1UizbeSXMJOXpLr X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2016 15:53:52.1531 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0668 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.44 Subject: [Qemu-devel] [RFC PATCH v3 11/18] sev: add LAUNCH_UPDATE 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> Cc: brijesh.ksingh@gmail.com 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 2fbab2f..fafef6f 100644 --- a/sev.c +++ b/sev.c @@ -282,12 +282,41 @@ sev_launch_finish(SEVState *s) } static int +sev_launch_update(SEVState *s, uint8_t *addr, uint32_t len) +{ + int ret; + struct kvm_sev_launch_update *data; + + data = g_malloc0(sizeof(*data)); + if (!data) { + return 1; + } + + data->address = (__u64)addr; + data->length = len; + ret = sev_ioctl(KVM_SEV_LAUNCH_UPDATE, data); + if (ret) { + goto err; + } + + DPRINTF("SEV: LAUNCH_UPDATE %#lx+%#x\n", (unsigned long)addr, len); +err: + g_free(data); + return ret; +} + +static int sev_mem_write(uint8_t *dst, const uint8_t *src, uint32_t len, MemTxAttrs attrs) { SEVState *s = kvm_memory_encryption_get_handle(); assert(s != NULL && s->state != SEV_STATE_INVALID); + if (s->state == SEV_STATE_LAUNCHING) { + memcpy(dst, src, len); + return sev_launch_update(s, dst, len); + } + return 0; }
The command is used to encrypt a guest memory region using the VM Encryption Key (VEK) created by LAUNCH_START command. The firmware will also update the measurement with the contents of the memory region. This measurement can be retrieved by calling LAUNCH_FINISH command. Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> --- sev.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)