From patchwork Thu Jun 20 18:03:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 1119686 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="nq6Kc6JI"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45V9gR72FTz9s3l for ; Fri, 21 Jun 2019 04:43:15 +1000 (AEST) Received: from localhost ([::1]:52138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1he21i-0000h0-1f for incoming@patchwork.ozlabs.org; Thu, 20 Jun 2019 14:43:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43355) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1he1cb-0005MN-Mu for qemu-devel@nongnu.org; Thu, 20 Jun 2019 14:17:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1he1P8-0003tw-UZ for qemu-devel@nongnu.org; Thu, 20 Jun 2019 14:03:47 -0400 Received: from mail-eopbgr790073.outbound.protection.outlook.com ([40.107.79.73]:37285 helo=NAM03-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1he1P6-0003mO-TY for qemu-devel@nongnu.org; Thu, 20 Jun 2019 14:03:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qVCBWcxuCdP4tzGZUnso/keG4BIXpWd9tzQZiSdM98g=; b=nq6Kc6JIj+bn+oUqoiKibjWNe5uTLVTI86GqfG7mpZCnL3e/teBnR8BfbQtqFP8yf3nxXtTD2EchH+h6Vu1Mfwa90i6hR4x9MzixbtVQgQN0nXzodf4ScIzQGi0ulup6hZ4TL9BQsPbP6CS5h4WepIaXl4lCDKa68aRNAsDUiJs= Received: from DM6PR12MB2682.namprd12.prod.outlook.com (20.176.116.31) by DM6PR12MB2842.namprd12.prod.outlook.com (20.176.116.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.13; Thu, 20 Jun 2019 18:03:05 +0000 Received: from DM6PR12MB2682.namprd12.prod.outlook.com ([fe80::b9c1:b235:fff3:dba2]) by DM6PR12MB2682.namprd12.prod.outlook.com ([fe80::b9c1:b235:fff3:dba2%6]) with mapi id 15.20.1987.014; Thu, 20 Jun 2019 18:03:05 +0000 From: "Singh, Brijesh" To: "qemu-devel@nongnu.org" Thread-Topic: [RFC PATCH v1 00/12] Add SEV guest live migration support Thread-Index: AQHVJ5JohKMZUl6sx0qZdgLCEug/WA== Date: Thu, 20 Jun 2019 18:03:04 +0000 Message-ID: <20190620180247.8825-1-brijesh.singh@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: DM5PR16CA0025.namprd16.prod.outlook.com (2603:10b6:4:15::11) To DM6PR12MB2682.namprd12.prod.outlook.com (2603:10b6:5:4a::31) authentication-results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [165.204.77.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c6beb0f3-4b5e-4a07-d331-08d6f5a9895e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:DM6PR12MB2842; x-ms-traffictypediagnostic: DM6PR12MB2842: x-ms-exchange-purlcount: 2 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0074BBE012 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(376002)(396003)(366004)(346002)(39860400002)(189003)(199004)(81166006)(81156014)(386003)(86362001)(256004)(486006)(476003)(50226002)(186003)(2616005)(4326008)(8936002)(25786009)(68736007)(14454004)(5660300002)(26005)(66066001)(64756008)(5640700003)(6306002)(73956011)(3846002)(66556008)(6512007)(66476007)(53936002)(66946007)(966005)(2351001)(6486002)(66446008)(478600001)(99286004)(71200400001)(305945005)(14444005)(7736002)(6506007)(102836004)(71190400001)(52116002)(6436002)(8676002)(36756003)(54906003)(316002)(2501003)(6916009)(2906002)(1076003)(6116002)(6606295002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB2842; H:DM6PR12MB2682.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 9epW2PqMgLSh2OdSE35nmxmelFJTPR2v3yW8/Fp18n8cEGKulW6xHZMUn+HY6WSm/BL5Ge6KjYhXAEAcXBhW+1kkiouXcJbMEOw+c0QUXnppyjOri58htgXToMZMfqbxD/7GMqw4RPlCjMIRtxnbGqRo359tsSd/Zyg6Z2O0urRvC8ouFxmlRNoDg3thl/DobCWCw0gcVsYqAsw3Sx0FtERLqM8DRW18GCz9ydPoY8MTu7DPUPJ9iJRhTx6qxROm89WOcUJ51L5xiCwNuBDsI2YsauZ4jo/vbD6VcZPxTCmZWCnCcMuYakyIaPqBS8REgyEjiDFofF9QQO6VL/wQ1bbLHnZiRr5rErKfx+CTP9RqJTppwCYSsG70MZ42+tWLNPQoGQChyA8wtapDiK/yJYOELga2Aketisw3mDzyTS4= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6beb0f3-4b5e-4a07-d331-08d6f5a9895e X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jun 2019 18:03:04.9999 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sbrijesh@amd.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2842 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.79.73 Subject: [Qemu-devel] [RFC PATCH v1 00/12] Add SEV guest live migration support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Lendacky, Thomas" , "Singh, Brijesh" , "kvm@vger.kernel.org" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" AMD SEV encrypts the memory of VMs and because this encryption is done using an address tweak, the hypervisor will not be able to simply copy ciphertext between machines to migrate a VM. Instead the AMD SEV Key Management API provides a set of functions which the hypervisor can use to package a guest encrypted pages for migration, while maintaining the confidentiality provided by AMD SEV. The patch series add the support required in Qemu to perform the SEV guest live migration. Before initiating the live migration a user should use newly added 'migrate-set-sev-info' command to pass the target machines certificate chain. See the docs/amd-memory-encryption.txt for further details. The patch series depends on kernel patches available here: https://marc.info/?l=kvm&m=156104873409876&w=2 The complete tree with patch is available at: https://github.com/codomania/qemu/tree/sev-migration-rfc-v1 Brijesh Singh (12): linux-headers: update kernel header to include SEV migration commands kvm: introduce high-level API to support encrypted guest migration migration/ram: add support to send encrypted pages kvm: add support to sync the page encryption state bitmap doc: update AMD SEV API spec web link doc: update AMD SEV to include Live migration flow target/i386: sev: do not create launch context for an incoming guest target.json: add migrate-set-sev-info command target/i386: sev: add support to encrypt the outgoing page target/i386: sev: add support to load incoming encrypted page migration: add support to migrate page encryption bitmap target/i386: sev: remove migration blocker accel/kvm/kvm-all.c | 75 ++++++ accel/kvm/sev-stub.c | 28 ++ accel/stubs/kvm-stub.c | 30 +++ docs/amd-memory-encryption.txt | 46 +++- include/exec/ram_addr.h | 2 + include/sysemu/kvm.h | 33 +++ include/sysemu/sev.h | 9 + linux-headers/linux/kvm.h | 53 ++++ migration/ram.c | 121 ++++++++- qapi/target.json | 18 ++ target/i386/monitor.c | 10 + target/i386/sev-stub.c | 5 + target/i386/sev.c | 471 +++++++++++++++++++++++++++++++-- target/i386/sev_i386.h | 11 +- target/i386/trace-events | 9 + 15 files changed, 902 insertions(+), 19 deletions(-)