Message ID | 147455601724.8519.18051040109806747243.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 3DE4E6077A for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 22 Sep 2016 15:18:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FC5A2AB8E for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 22 Sep 2016 15:18:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 246462ABA8; Thu, 22 Sep 2016 15:18:37 +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 3C4282AB8E for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 22 Sep 2016 15:18:33 +0000 (UTC) Received: from localhost ([::1]:50106 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 1bn5lg-0001Y5-9A for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Sep 2016 11:18:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1bn5Nj-0001ca-Pv for qemu-devel@nongnu.org; Thu, 22 Sep 2016 10:53:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1bn5Nf-00089A-Jm for qemu-devel@nongnu.org; Thu, 22 Sep 2016 10:53:47 -0400 Received: from mail-sn1nam01on0067.outbound.protection.outlook.com ([104.47.32.67]:4370 helo=NAM01-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <brijesh.singh@amd.com>) id 1bn5Nf-000896-Bc for qemu-devel@nongnu.org; Thu, 22 Sep 2016 10:53:43 -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=BtDaMbdSQ7BHrdZpRaAZ9zNufS3a7YMHOSY9EG2OVuA=; b=QbP80aZ0I8umPPaTmXGs26FuUVquuXhR1Ot6R1m7RimrGDz5DkI6xBDrusUuehRdoPzFL6FK4O++ifaE3Y/q8izCXdoBv1/myOGuSX6vzy9WHD/yMezsrYSJUo9wNp/d15L8zqFFuU2K3+vVBWHrGvEws81/N1XRop+Xz5zEcDU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from [127.0.1.1] (165.204.77.1) by SN1PR12MB0669.namprd12.prod.outlook.com (10.163.208.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8; Thu, 22 Sep 2016 14:53:40 +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:37 -0400 Message-ID: <147455601724.8519.18051040109806747243.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: CY1PR08CA0012.namprd08.prod.outlook.com (10.163.94.150) To SN1PR12MB0669.namprd12.prod.outlook.com (10.163.208.27) X-MS-Office365-Filtering-Correlation-Id: 9a7391d1-d830-400f-b495-08d3e2f83e1a X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0669; 2:P2R5abFxntXqMSdJxxT/fQtw3hkmOZQHQ1NNIUWVNMMM5/ie3faFyAsr4khavu7MB/7jZe9mSO+wRdWkXd9lkMpJzyVk84HTEtQgtXToIDqzPVe+6UCm/GTahz5/9ET5phFXrusLXdkhCnUePfGkVfMp1qiIrKY5Xofyt8FVAyT079qnr5jlvAvaet+iU5q8; 3:E0x/kM9ahyj9R5XyqFOvHAnNDmRmQ5USkRREQNj1ianl8muNcYQjLGWUA2gH7Q49aIPNFbVYdj0T3ZSBOJ0Xw/qVh1eiF8qUlpyeBItMH1ZYWcUJaI0g9fkq4vXSaS9D X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR12MB0669; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0669; 25:W1hN3manwIw5DlayAZ12eXDTHfis3+RvhDfLGSqtRpPoWg6UtjtVeBH5JNhoIdrOPYmBwqMz7Wl3J+jR92ZjXx3s/chyN8eOgt6cRAtuEs059Vf9NSe3u0+23ivB88UaTNyRt+JisAAP6sF2EipHErCgHgU79IweP3hifD7mC3fHiacgzw5iOYF3aQJUO20lP1U6/L5lKyYg+Y1/sujr5XCRuK+GCzQL/05qAbwR+14A+AMEC545mqYoE0AoDL87A7OQX8JarBifUA7LkMMMWOVt1Bzu5dGlyPq2dS34KDgH9lh443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NJ2AF3BDt96tNOK89ViWB9bPIr8F1pRF6Xs01n+FxHoaP5MRlzdiFA9+EOWR5AtiSqfsyb+d0P+9alIGIYuL2WlURrmpxihP3m; 4:evjL+B05muw3joQfJyRaR4GvEeqG0RA3MG6AcEEDPIFBqbUZypfGqD1GEPcU59vNdyZ9UGMvwjWpkJX9p9nm8sgEbLeVhdFbJz267O/pTQhugnFndcOcMQngW6IQjqg/YpHNqVWf0b6hbXxzPKJU984i4goNRMyxxKUgRLHg39dSFkiPcKhCG4RPs7IsBkqMiA+DX9usrEfjtRnHx7lGVTRiLZqwKj8FEJqOLVR/uvX6ti7Tgc9SF8MON7Y8koQnlfxRl2r8vLIyMQ6DYQP8VcU0epcstg+TW5ZRKcaDPCKJHUKGF0v/axLPvycXU36Lo2sFRbuIWlLSdH7BgM4GhaVivtbKzG2nuMh1QSfCZxgZda186Zu/KmyEgDZwBMJ4C38Z94SL2sb4+fIZ4IsmddiZjGmf6DlIKZ4b8Mp844IPyrs/VDLPzM7bgsT/P6ji X-Microsoft-Antispam-PRVS: <SN1PR12MB06696D987C8F3F4DD4A369C8E5C90@SN1PR12MB0669.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)(10201501046)(3002001)(6055026); SRVR:SN1PR12MB0669; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0669; X-Forefront-PRVS: 0073BFEF03 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(7916002)(189002)(199003)(105586002)(6116002)(83506001)(8676002)(92566002)(586003)(230700001)(9686002)(33646002)(7736002)(7846002)(305945005)(3846002)(50466002)(68736007)(2906002)(86362001)(2201001)(19580395003)(19580405001)(54356999)(81166006)(33716001)(2950100001)(76176999)(101416001)(5660300001)(103116003)(106356001)(229853001)(66066001)(107886002)(97736004)(42186005)(189998001)(4001350100001)(23676002)(81156014)(50986999)(77096005)(47776003)(5001770100001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0669; 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?MTtTTjFQUjEyTUIwNjY5OzIzOlMzOEU3b1JSV0dVMjdjVTA0TUVDOEZpeHEx?= =?utf-8?B?UGo0amgzWDFGVWNNcDNMeTJtQ1RsRDJES1FUYkZ3SXkxT2h5UE5UczJuWHZK?= =?utf-8?B?RWJTaEJyN0xtS3F5WFFqeCszc0ZUcXdncGY1TUE5ZWUyMkZ2bFEwb25scGJ4?= =?utf-8?B?VlZQQkJjY0F0LzVoK3ZIOHh2ZlhtS0VqNm1OeExaUG53OTlCa1NTV3ZvcEta?= =?utf-8?B?anV5WGlnSVRWRkZOZ01TbVJlNUhDdTNVa3R5Q2NHQzRmV1I5UENKdWMzSE5W?= =?utf-8?B?d0pGVmg0b2JQME0zQVpPL1RzUzFKUjBZdnI2YjlZQ1FCNHhBWHRQTXRpdWxX?= =?utf-8?B?eWI2bjlYcWRkQjFNdXJtdGkrb00xMUVOcGpJL1VGUFJkN0xkM0lua2ZyeWZu?= =?utf-8?B?RjRLY1dxbHRCc0pRQ1FYSUFNUVZIcm15Z3BKZmo5V2x3eVg1NUliN3RwTTRT?= =?utf-8?B?R0NLd1I1UmFGV3lrbWlKR2VSQjNYZGpGcWNVaTl2YTRwMnAybXRPL0g3YUNu?= =?utf-8?B?L3RWbEdaZXZIN256Q29VUS91Nnljdmh5OXRURGJXUmx1NlJ1alR0ajRKZDBt?= =?utf-8?B?c2pPVWRlamdHM29UMGNkVCthYUJMb3dnUy9TeWlZTVQ0Q1h3V1lNdm9OTitk?= =?utf-8?B?K2F3SGF1d0Q1UWJQOWp6T0lLY1MvODAwbXpucUZuL2FkZ0lOOFlheG5rWmMv?=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 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0669; 20:k+gI0BTZCrjPuwLsd798LgSpgwuVbsIDAkfw8V0/lApC6iTV9B2CO81aa44uSAD84jwj0i21MyV6+gGkIiBm/HOrP1NcvIp01FTgN5f++cPl/zhRwJjfUzPSzcKV2cW/C8FbWU1MA5VSRxzuyfTkA8S0bX0Tk46HLGIBj8xl+H1/Lajrk0g5G0SL/3Z5zM33ziL+SCsgcr6YhzZcTxBAgnkk1iT2twZti+Y+0rlW8M8ezLMz/tim8uigouVfL6AX X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2016 14:53:40.5171 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0669 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.67 Subject: [Qemu-devel] [RFC PATCH v2 10/16] 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> 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 ead7c5a..dcd7c48 100644 --- a/sev.c +++ b/sev.c @@ -959,6 +959,25 @@ sev_launch_finish(SEVState *s) return 0; } +static int +sev_launch_update(SEVState *s, uint8_t *addr, uint32_t len) +{ + int ret; + struct kvm_sev_launch_update *data = s->launch_update; + + assert(s->state == SEV_STATE_LAUNCHING); + data->address = (__u64)addr; + data->length = len; + + ret = sev_ioctl(KVM_SEV_LAUNCH_UPDATE, data); + if (ret) { + return ret; + } + + DPRINTF("SEV: LAUNCH_UPDATE %#lx+%#x\n", (unsigned long)addr, len); + return 0; +} + /** * Function returns 'true' if id is a valid QSevGuestInfo object. */ @@ -1056,7 +1075,11 @@ sev_mem_write(uint8_t *dst, const uint8_t *src, uint32_t len, MemTxAttrs attrs) assert(s != NULL); - // fill in the code in next patches + 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 | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)