From patchwork Wed Mar 8 20:54:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 9612015 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 9C66860414 for ; Wed, 8 Mar 2017 21:38:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DC572862A for ; Wed, 8 Mar 2017 21:38:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 827D628635; Wed, 8 Mar 2017 21:38:59 +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 CB6ED2862A for ; Wed, 8 Mar 2017 21:38:58 +0000 (UTC) Received: from localhost ([::1]:58581 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cljIP-0008P9-SR for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Mar 2017 16:38:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clj7u-0007li-UE for qemu-devel@nongnu.org; Wed, 08 Mar 2017 16:28:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clj7r-000613-NN for qemu-devel@nongnu.org; Wed, 08 Mar 2017 16:28:06 -0500 Received: from mail-by2nam01on0050.outbound.protection.outlook.com ([104.47.34.50]:15072 helo=NAM01-BY2-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 1clj7r-0005zr-Cn for qemu-devel@nongnu.org; Wed, 08 Mar 2017 16:28: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=kvKADZ/GCCgHKX1hfkbY4bUnGB1IFcyQMWBlvdXUR6Q=; b=2U6ZwjYiRv3l+AX0TQskJJOjKvi5qs5dsuotuqfEtIzpvB2y9vuwUPBlieGemKV2ZH022E1W+MIRcRhLX0RPIiS89sAjJizUX4XZXvWO96wCw5Xcsn3ENMaFS62Ge78N73Bxq0l7acARbjWjnVIQ+WyRVFXqckFAuLV8X9/OHqQ= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from [127.0.1.1] (165.204.77.1) by MWHPR12MB1614.namprd12.prod.outlook.com (10.172.56.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Wed, 8 Mar 2017 20:54:46 +0000 From: Brijesh Singh To: , , , , , , , , Date: Wed, 8 Mar 2017 15:54:43 -0500 Message-ID: <148900648332.27090.14562192041474683540.stgit@brijesh-build-machine> In-Reply-To: <148900626714.27090.1616990932333159904.stgit@brijesh-build-machine> References: <148900626714.27090.1616990932333159904.stgit@brijesh-build-machine> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR21CA0003.namprd21.prod.outlook.com (10.173.47.13) To MWHPR12MB1614.namprd12.prod.outlook.com (10.172.56.15) X-MS-Office365-Filtering-Correlation-Id: 5a4807f1-6fb4-44d5-711c-08d466655af0 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:MWHPR12MB1614; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1614; 3:awjC7i2g4Bcc7A7yUaDANWfPgPHWLLxT5QGO2/eEZ3UVPLVoRmpF50bbz5M/oVfEQSya/rslzZjREkVM+G7aoiiB1K3nw8i6FF9dGYOvI1Urhtz/AC30rVJmimoxrm5GwjlXodAy9skcBF10NstNVEsZ2djVpY+x7iozc3wBfO2+Ke/hBACkHW9K9KlSdYR8kpM3ePWbKPHJuJz/pvvydXBI3/M9I8IJvddX+ggXgvnUMvKhZoSFDg4eLrykVu4K8eI5Ihm1ETS6OiqJypeGS3OmK3xEjOy4+UAnt5Hr4Ik=; 25:Nid576+xBkwZt7eRMt6JraQ09wb7nHB7XmsmvvVeH+SrBZkSokRPiuh4OUJVtUPVNKYw4RCu1Ysyivpl+DKrxHK940ogAuAIAoW2qStUjU5HGo47BqQZ8RmN00aX2DxTMTooVnwxsJ/krsA/1jxDgGQSovZMOSAOcufIs/bKxz7amPErHc3yWtDCUu3pdRQ9P9SohOBG1YeyWzhh6LoQuz+hKA0hvDiGRLjQA+Qo4WGJoo+WTMGvB8feGgj3++TmPPd140/WCU/ajTP2yCyxbVTnrUaCJkHQXlfsAWrxOw1ka7io6C5WU+U55l1jTzTxsm4HTB65/XtryrBfWkbwaxovTvEDs4gGXXoelIO/LQ0Dn2P3fbuX6FBWU1kvYvaMHUWaBTuEpitr9uMkxO1e1GUgbBYpt5PBHUCTQHX9laOKl5Y37hMRdX/HtGq37Mu3 X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1614; 31:RFg58uEkJuEm75qtyIc/mjVXh+aH8uNstRF/ieQb0bGX3/DBreee67lnGRlP/QR26p9bsUebNk98aWkQOOr9S22InMoWQ2hNY8EBhU+8bsmEDLBbE5B8v5LjGG7T7mSj1pYy6TPB2w5oyOGeItnQDf8iK7rwq+VHLifm7FxiX/O1JDjH1jcKgRW869oC7XFwAa0RZloKPCNDtRxpYmqIIwLaFEPy0cHS+G7j+OUv4oHlxs6dI9vwdFcj9vr2WMcw; 20:3X+DDhhtx8WsepBSe1g9VCfsp9YRK3oytk7lE2iSivFqFDy8WyH3n+3QJnRfSYrvovwau50bOmR9QEEkhPPv55g0jO6sQrkgOJzF+GvfG3l8s5BgBdcT1q5CFXJJsw5arxxFu6GnQMNFB12RzjVAwXbGwJJeNNQsTulK5QcryP37xqhwg7V5uASXAGtck7KYe28NfcOb9d5W9vBgCj7xJAXfljVEhmt8Rs4sSLqKTtq8FeiVb3LgJs+7QuTUuluicwZgVMVkm3LbsZxgHW1wUjeAlXDyWtjprPE+2Tiv8ZZHylIaF0VBPHeAQg1CsXTxY6Lx5Liz3Gm+WZre7j9UVeOoxXEHJMZM5GRJV/URixssKEzFrrXvTwOspueauCw0oD1QBoDgwpiT3yLb73mo4wrC5Du0JEYO7gsI4rFMWFAvE02FUUxibaOj90DQkEnx+Hvg4gF7dSEHKzqh5Cg8RLERJW0yA1iHKGA8Ia5FahW0lYMHHn4U24SLMTr0XJyd X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123558025)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(6072148); SRVR:MWHPR12MB1614; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1614; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1614; 4:RKA5p5RGdQoqgcK7GWlP75eEt1XU09YC5Uo3mAzIlzbcei8W47LAhHl6PIvMNftnV6xGeAhReypt5LXuHxGgGa0D7ST6MxVX7Yn3uST0gjoXfkhwa24/y6usjcVCDHMl6WjTvHaQ86p9Vj72yWzk5Gt0tIDFwkNzEbq/B18AHW2M78xqIlL9IFUAOsGCZdzZWQisWOU/ARZTq8ntRkLhm23IeiuEy0gM++6p4D8DZYsDXPenfCnqGZPbZMAiS45fOJI3VkqaivSwXeY3aNMCPcQVe7c79r9ZskD3swT21ATUh/rWBx7o80THnKIoVC6rlYH08yZ/9IbUHUZNoIuq3LTWVrNtKpOPaCkKma2vLvx0KE+Vsp4HlGZWJPQfwWNyJPLN51ZMQEp81Dp7Out6L9H+1BgjIlSwq9JW3Ho/GMw9ldPNn/3w2gYgzzR2EgmGJRAqT4InmGIUhjn9aVZWIRg5MR6cgF3cbptV281ptpQgiWq9wFkBg9wQ34O0zdGz4uhzrKniHyLX85pJ9WYntxrenNL91sjA+gI5pAPAQS3MxotLe9yBC7Q89lR+EwVaroUJTHBLgPla6wBvtDsU9oDDZNIUUnVCyvvCvc7V647iPsPDuCrp0VbDcQ22hI5CDgjt/7Ru3+xBSBI+KRRLIPEOp7dcts7/hTAl3u9pzig= X-Forefront-PRVS: 02408926C4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(39450400003)(39850400002)(39840400002)(39410400002)(39860400002)(6116002)(230700001)(6486002)(9686003)(3846002)(53936002)(47776003)(77096006)(54356999)(54906002)(76176999)(50986999)(2950100002)(25786008)(90366009)(66066001)(189998001)(103116003)(42186005)(2201001)(2906002)(83506001)(305945005)(33716001)(33646002)(5660300001)(86362001)(7736002)(23676002)(4326008)(50466002)(38730400002)(81166006)(6666003)(8676002)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1614; H:[127.0.1.1]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxNjE0OzIzOlBGTzlkcUY4WUtMZUtDV2QrVVk3ZGpCRmcw?= =?utf-8?B?emlwbVhkc1B6ZDhzZmJVUS9CcEExOXc1YjZlVmtGdjdHS21QWk5lQ05HcjJV?= =?utf-8?B?TU1zUVJVTmprVVVEeUxPW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YP2hoEuAyGw2+Ag+bMJN3kuwTWbtoq/AHAxQ8/eaha1evQeEKjwAu6ewipDO+f3nAES5xPzhnma9gcXzj1Qa/5EnqFEMyLKNbWuAFkbPk5zfo9qfHo0e4CAl8QhTRKGJZeoJVOJCNcDdUo5vGo=; 24:dwLtcBpw5hJLwVL7XWfIAhabSR9OJnNmcELpa+3n/G7XsbmWDUGOUxAWKSw+8C1TNYdM4tqltv5hYPEUqQfYW6SV5zBZIwEVXbZHOwyKAWQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1614; 7:1rtV714iHQss4F3CpaMQ/GOuG50XJgLhI05RXEPhZ9xpuxfAxAgP1fI9O0FF94gUoWBdcQ45no86RkN8MI3WmtO+q5RJ74FToznkxYasRugVLcOUHV6FMBUo1FwyW7Hy10QTaNtcxP3xaU8R3gn90780H56qKKz6q/s9yYfom5qnWm9kHnwMmM05dZ3DDdR7WUvWOU193gVGMKeHZSJgEYezVDqh9uz9YJWFAEVPp1uRV/U5dLYOoDFg++3YlSNM2ZfWLz6PgdgGnl7itWXsD1IyUGm/ltMUft5eIBC2yZDq4dUiv6/Zvdu2VI+JIVU2tALetDJhlIf7V5T6noP3gQ==; 20:H6pJ80H9SICGCsSPELH69bMcgjm9T5STnNv4mROVPXmDWjvfWCVgf13TPcKS5M7MceCYW6/j9YDRyKpyfWItjxiBlCHfgMESgPlIHf1CzDTJo4D4EpULJw11ERNMpZi8NnfxmG3LsVA+kAOdtDD0HlhkAyola7DuldJuIafUa4cEo6hbSCvrYu105wjttHjZMLzsvkWX6jZt0fCvpgpb35Ep1x4hOk7fBxf9qml7hjyC5XnboFCyAwW7vOrbHP3B X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2017 20:54:46.2483 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1614 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.34.50 Subject: [Qemu-devel] [RFC PATCH v4 20/20] migration: disable save/restore and migration when SEV is active 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: Thomas.Lendacky@amd.com, brijesh.singh@amd.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Snapshot, Restore and Migration is not implemented yet. Return error when user tries to perform any of these operations. Signed-off-by: Brijesh Singh --- migration/migration.c | 7 +++++++ migration/savevm.c | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index 3dab684..287c72b 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -37,6 +37,7 @@ #include "io/channel-buffer.h" #include "io/channel-tls.h" #include "migration/colo.h" +#include "sysemu/sev.h" #define MAX_THROTTLE (32 << 20) /* Migration transfer speed throttling */ @@ -1221,6 +1222,12 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, error_setg(errp, QERR_MIGRATION_ACTIVE); return; } + + if (sev_enabled()) { + error_setg(errp, "Migration is not implemented"); + return; + } + if (runstate_check(RUN_STATE_INMIGRATE)) { error_setg(errp, "Guest is waiting for an incoming migration"); return; diff --git a/migration/savevm.c b/migration/savevm.c index 3b19a4a..bf6e9b0 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -54,6 +54,7 @@ #include "qemu/cutils.h" #include "io/channel-buffer.h" #include "io/channel-file.h" +#include "sysemu/sev.h" #ifndef ETH_P_RARP #define ETH_P_RARP 0x8035 @@ -2084,6 +2085,11 @@ int save_vmstate(Monitor *mon, const char *name) Error *local_err = NULL; AioContext *aio_context; + if (sev_enabled()) { + monitor_printf(mon, "savevm is not implemented\n"); + return -1; + } + if (!bdrv_all_can_snapshot(&bs)) { monitor_printf(mon, "Device '%s' is writable but does not " "support snapshots.\n", bdrv_get_device_name(bs)); @@ -2245,6 +2251,11 @@ int load_vmstate(const char *name) AioContext *aio_context; MigrationIncomingState *mis = migration_incoming_get_current(); + if (sev_enabled()) { + error_report("loadvm is not implemented"); + return -ENOTSUP; + } + if (!bdrv_all_can_snapshot(&bs)) { error_report("Device '%s' is writable but does not support snapshots.", bdrv_get_device_name(bs));