From patchwork Wed Dec 6 20:03:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10097099 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 4B704602BF for ; Wed, 6 Dec 2017 20:18:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B602289CE for ; Wed, 6 Dec 2017 20:18:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 301CD29489; Wed, 6 Dec 2017 20:18:42 +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=BAD_ENC_HEADER,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 24CF3289CE for ; Wed, 6 Dec 2017 20:18:40 +0000 (UTC) Received: from localhost ([::1]:57595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMg9P-0005Rq-91 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Dec 2017 15:18:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMfwK-0006ob-Qb for qemu-devel@nongnu.org; Wed, 06 Dec 2017 15:05:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMfwF-0002v8-Uv for qemu-devel@nongnu.org; Wed, 06 Dec 2017 15:05:07 -0500 Received: from mail-sn1nam01on0063.outbound.protection.outlook.com ([104.47.32.63]:36576 helo=NAM01-SN1-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 1eMfwF-0002ur-Nb for qemu-devel@nongnu.org; Wed, 06 Dec 2017 15:05:03 -0500 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=Rvuue36Qh2BnkewowOXZz5X9sDyU46P+NQ6bbWgNYAk=; b=rDoHuxREcyawreqeFoHn0+L06lqH3OrOsL/ZLrFe2NrQQxG+CpesHJ3KArdQXRa/iijGom38p6RgniYMHT9Ob1jMwud4ifo+yNTSzyzT8WnvaSiHQxER8ILZ0d5+tVY3HHJEk2asqJvM8DhV5zyLuJ9q/gDQ++BjL3pHlpGYeSg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Wed, 6 Dec 2017 20:04:59 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Wed, 6 Dec 2017 14:03:46 -0600 Message-Id: <20171206200346.116537-24-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171206200346.116537-1-brijesh.singh@amd.com> References: <20171206200346.116537-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR14CA0035.namprd14.prod.outlook.com (10.171.172.149) To SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f7eda456-c04f-4777-4e80-08d53ce4a1d1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603286); SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 3:1hCr5v7r/kWV3afGS4mFrBlluyPo19/NxWTgTh8mPi+xsyZ3R6FI5s8UjEN2wNDRxB5zuxqv+XAsIw5akRtmNCtu5pxfeJ9vL+WP8UDNOEv5hdO1zhQkl/X3cWrMl9gdMATNX3sA2mPbsXPEykOAyDluhmeQEkhXgqU4pl0Y/Lp3IZ2PEq0Cmh6HcWGevjOziqG5LjOQu86VcOuimL/a115SlcmihsCLt1144Zdy/SXOPEVKFMmnHYDRf6WHAKRK; 25:YODW87TWEvwz8aw9FRaKpT1GoZgofYuOzIC0fXg/C9MJdWUgmbZMZ/0Gk1QAVut1B9mE0CjmQPooJCecMbmF+ysbIUe92+d5Mm9lAKRgPxoGpHoCw2fDyc6v9Myok4GJHFvYg8PmVNL7ZU/dXfLvox8V7Zw/mvXfrOTgDd5ouXq6Vf8RiTU/Q/VMY08dflGQh0BkcxNbUI8MCKM4d9ZSJwuRB6eN6TtBItKesPPM0VhZvekHHeg1nDYKpclTMq2vueJElA0T/QgnbugUPPsQj6OLeiq0il8C3OZTQM5CbTPrJoQ1cmnHCASV74gHqXYDw9r/8nL/QAP9y/rH4uHWvA==; 31:RVHwIDDMLfN7oEoHYn8gotDAPm50o0m1D+04H+5WzUKtHuI1SCQuHpSZrr1I/5P3qqHtZlcFlkU6DwBAAONcyEd0QT5+yVCYXUzXQYYmJz9mchvuqZq9fcbdISGAWu1fes6Jq35Z0q2GipATRwxnST22hOqcCQOokhcQSkSHmTRETdBN+RRtkBk+4sye6ERzXeK9ZBPgtFNqe9bZgvoI4ZnypnOEODsMfcJpaB0Ey7k= X-MS-TrafficTypeDiagnostic: SN1PR12MB0158: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 20:DprkE3CwbQxG+4xk6q4n0aC5F676eTABUb6FNDwBBQrCKvmgzOIheBpaXtplkSj2zVFEyz98OlXB0ZIRLOG3HMdrBTby2BR8lBWZg7t/GBLIZLWp8FR2qE0D6gSlwSuFi4qDgwiE1aroRhA4VSORMef5yDj6QKeSu2Zse5yBThaY+bhRNLClryLlcLVbf9/AQzVDYrizNE5/CO2aiOntjyWzCktYbWgJ4wM4uGnY4pdk/Ri6tjY1851EvTIuMxPKL20/lyQ/M6Gq88M00VdC9UGt+BqrGSnIS4/OU1mduWwNx0hUPhjO8xmQOGuERMUH+LCpps4CD1qzbQeV3rqJqhENj/uxWebb1EhYNabmqTFxGHPYLA+ypqVN+rjqBhCIU6d8MhHTyX/S3borAd2bCI47S4rBIA1EkQgpjpLGcqjr4hz3ItSeK8hcOVKDGkzyIMtwfeKfsqfMvLHEBivglDMWFWUJ72cOb+1/KjdIlGWdadRirzI4ORzKuk94uA+E; 4:IK2sPV1f1crfH9ww2fX5NIDn+5Zaxs2ggROcV1yiKqGgiSrEjgvh/aSjlNhPD+eQPy4Z2OaRriqOgqWlKKy73uoV6kSAbaWCjRe4U8KhBCZ9qnZtDqlciI579XmbwW3culd2NknAuPPUP8NTzoEu9nsFlxdWxTKGqiPdRP1C2mIOaB6XvtuSrPcdrlqVxXXWY4ctimENBVZ8NNK2cNmKSSM+VaTH+I/G2F5z2nlx57Y/KNd2vjNBv3olY0j2n+oosIVFWQ2CuAw/+dw1PNG/AEJOuQRTgv4D5l71WS+xAdZfcq+AKLnuJz/jOIis8yk9 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231022)(6055026)(6041248)(20161123555025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(6072148)(201708071742011); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN1PR12MB0158; X-Forefront-PRVS: 05134F8B4F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(346002)(366004)(199004)(189003)(16526018)(16586007)(33646002)(53416004)(105586002)(39060400002)(4326008)(305945005)(2351001)(106356001)(2361001)(7736002)(7696005)(86362001)(52116002)(8936002)(316002)(53936002)(97736004)(76176011)(51416003)(36756003)(66066001)(1076002)(3846002)(25786009)(6116002)(47776003)(50226002)(68736007)(54906003)(6916009)(2950100002)(478600001)(6666003)(8666007)(5660300001)(8656006)(8676002)(101416001)(81156014)(81166006)(2906002)(7416002)(48376002)(6486002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; H:wsp141597wss.amd.com; 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: =?us-ascii?Q?1; SN1PR12MB0158; 23:MyG5ETbDdn8NdcwNvutDEUXLhV55zACu3L10KfZkm?= =?us-ascii?Q?xDfutOT85dUF8ix4vmQNOA36FkNL0OIJCcL5HG7225ILSm4maFun7TT0IOiu?= =?us-ascii?Q?j2OhR8SSp84gUmgP/w7Mq0P9grm7ofNEfJOyuscPAkruurX4ZaC02OJBbTOO?= =?us-ascii?Q?rAMlZ0SSU9EfeQlBDU2l9L6NmMi12esQ7AtkDWx5xEWQD7qf+GRfqAPIwCaG?= =?us-ascii?Q?/xVrxa61W+kM/9wvTl+4swvC/8I19emrw5BpWMZZsjZAJBVGmp+CSOZTJoGD?= =?us-ascii?Q?Kd1zp8KtSXgj1HR/nrLveBCcZ76+nt1MTQG+oG2A3y8yG9Rbtbce/+w5H0Gm?= =?us-ascii?Q?94uBa+KqWA6kNWp660dms/5W67pRmvGj8NKvPo9FA2xk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oft-Exchange-Diagnostics: 1; SN1PR12MB0158; 6:OYNm9cjniVsuF+A8TJPiLxs+3y0KfM/EsiaUqtKAuNgegnVQJ3MhodgCBfPA41i5OFYOJIAQKBsnS35KVQXw4C8DX0qLwWnIK1J25nnCSt6rAmTk5+Qpe0mcELP/7GrOhaXRZUaZcNgpHfUs3l56U/LnZNdAR5i6ulYUS1eC1K+P9EI4XG3aEMFuBBmMbDe9giWyI+MT+bF3lt0PDmTIL8RN4fcFhsqOYCHVJJehrRdDId5eIvFnveNx0+frkKkjci7ps7gkAdCP0r6DfxmKu9HTtLkfjhgO/lzOGwZDD76PueNzaGV2ep0ATzqMf8JYZyTuToaQJlvHVsGX43VbZW0Tg8p/RM3p7uunW+zA8G0=; 5:pRbN41jOZ9jwJAR0KWqZSi04bNMlOYceaQrl1kMVraKtSpvObU/ARRQLpnW0fubZLmqA4UDEUmhDioRwkd9kMQ8KOLht8RWcsM9ngMBLAenPKJvkxg6jg0WmnwjRHcYJ1UaODg/DMINwUTGOjpBWClSsSbSm8IRJE/K0cf0i06c=; 24:Du0VQ/+s8gECbYsAMBlo8yo7KBNU8ePenNzs7cu79969bHUbbExJqoGo+rQ2L+4RRi0cMYiP2mJ3KiMPUNJ687MK6b/JH8FMFqU0C99o11w=; 7:xGOUFdIt2XLhyQNUjA8TIjLbisBafqZeKw7spbtifY6bDim4UfX6RNaG6gMsFoeCD0poCuWrBLFaXTFdt7dzYAZp2s9pwE7CxGVd5xiLbMpX7tjVN5vu5EUiz7Jv22vmTfL63L47i+yrDXZow5pizOmH1a2UZa2xjj9fKu3oRpQ8XIcj9E74wNEOF2S6OUdlIIFxVen15SEYCDh9MhxQkQECe6my8Jx6kPPpgqWLmyt/CH8wq/CMd4KkGwfMnXCQ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 20:ynvr9WDwvaT+j/08+MsqaB8MSWb8qINAxQAIO5O8PxU+0I51wustcKM/e5GYo4iytdoXThtJqRA16yXMFj5WdywXpmX0XdkOhoy0UWkCEFTElaUFsxEnZgzTc2MR5AeuAQSVvOO/m8iv6L1TYoyrAQ6xoH9WebJ6VcqZSm7OP8GGDqdmDsaPfEsvsBT4Nt7B0I8XGU3GbdiRB1ybdJYa4JZuJHaai3qTGkxzv8DOmKj0pj7T+zYF6Nmm5VASs8Sp X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2017 20:04:59.0821 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f7eda456-c04f-4777-4e80-08d53ce4a1d1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.63 Subject: [Qemu-devel] [PATCH v5 23/23] sev: add migration blocker 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: , Cc: "Edgar E . Iglesias " , Peter Maydell , Peter Crosthwaite , Eduardo Habkost , kvm@vger.kernel.org, Marcel Apfelbaum , Markus Armbruster , "Michael S. Tsirkin" , Richard Henderson , "Dr. David Alan Gilbert" , Alistair Francis , Christian Borntraeger , Brijesh Singh , Stefan Hajnoczi , Cornelia Huck , Paolo Bonzini , Thomas Lendacky , Borislav Petkov , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP SEV guest migration is not yet implemented yet. Signed-off-by: Brijesh Singh Reviewed-by: Dr. David Alan Gilbert --- accel/kvm/sev.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/accel/kvm/sev.c b/accel/kvm/sev.c index 3edfb5b08416..10647645eacd 100644 --- a/accel/kvm/sev.c +++ b/accel/kvm/sev.c @@ -19,6 +19,7 @@ #include "sysemu/sev.h" #include "sysemu/sysemu.h" #include "qapi-event.h" +#include "migration/blocker.h" #define DEFAULT_GUEST_POLICY 0x1 /* disable debug */ #define DEFAULT_SEV_DEVICE "/dev/sev" @@ -36,6 +37,7 @@ static int sev_fd; static SEVState *sev_state; static MemoryRegionRAMReadWriteOps sev_ops; +static Error *sev_mig_blocker; #define SEV_FW_MAX_ERROR 0x17 @@ -460,6 +462,7 @@ static void sev_launch_finish(SEVState *s) { int ret, error; + Error *local_err = NULL; ret = sev_ioctl(KVM_SEV_LAUNCH_FINISH, 0, &error); if (ret) { @@ -470,6 +473,16 @@ sev_launch_finish(SEVState *s) s->cur_state = SEV_STATE_RUNNING; DPRINTF("SEV: LAUNCH_FINISH\n"); + + /* add migration blocker */ + error_setg(&sev_mig_blocker, + "SEV: Migration is not implemented"); + ret = migrate_add_blocker(sev_mig_blocker, &local_err); + if (local_err) { + error_report_err(local_err); + error_free(sev_mig_blocker); + exit(1); + } } static void