From patchwork Tue Jan 26 21:30:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 8127641 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 47C929F1CC for ; Tue, 26 Jan 2016 21:33:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 836202026C for ; Tue, 26 Jan 2016 21:33:54 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A43EB20222 for ; Tue, 26 Jan 2016 21:33:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aOBCl-0004ey-Hi; Tue, 26 Jan 2016 21:31:15 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aOBCj-0004cz-P3 for xen-devel@lists.xenproject.org; Tue, 26 Jan 2016 21:31:13 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id 97/90-21201-0A5E7A65; Tue, 26 Jan 2016 21:31:12 +0000 X-Env-Sender: konrad@char.us.oracle.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1453843870!10805742!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 35987 invoked from network); 26 Jan 2016 21:31:12 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-7.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 26 Jan 2016 21:31:11 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u0QLV8qO001300 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 26 Jan 2016 21:31:08 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u0QLV4p6004629 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 26 Jan 2016 21:31:07 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u0QLV3Em018396; Tue, 26 Jan 2016 21:31:04 GMT Received: from char.us.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 26 Jan 2016 13:31:02 -0800 Received: by char.us.oracle.com (Postfix, from userid 1000) id 931A06A4BCB; Tue, 26 Jan 2016 16:31:01 -0500 (EST) From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org, ian.campbell@citrix.com, wei.liu2@citrix.com, Ian.Jackson@eu.citrix.com Date: Tue, 26 Jan 2016 16:30:58 -0500 Message-Id: <1453843860-29591-3-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1453843860-29591-1-git-send-email-konrad.wilk@oracle.com> References: <1453843860-29591-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] Cc: Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH 2/4] libxc/xc_domain_resume: Update comment. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To hopefully clarify what it meant. Also point out that mechanism by which the return 1 value is done is via an intimate knowledge of the hypercall ABI (i.e. which register - eax - is the return value). Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Wei Liu --- tools/libxc/xc_resume.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/libxc/xc_resume.c b/tools/libxc/xc_resume.c index 87d4324..e692b81 100644 --- a/tools/libxc/xc_resume.c +++ b/tools/libxc/xc_resume.c @@ -248,11 +248,20 @@ out: /* * Resume execution of a domain after suspend shutdown. * This can happen in one of two ways: - * 1. Resume with special return code. - * 2. Reset guest environment so it believes it is resumed in a new - * domain context. + * 1. (fast=1) Resume the guest without resetting the domain environment. + * The guests's call to SCHEDOP_shutdown(SHUTDOWN_suspend) will return 1. + * + * 2. (fast=0) Reset guest environment so it believes it is resumed in a new + * domain context. The guests's call to SCHEDOP_shutdown(SHUTDOWN_suspend) + * will return 0. + * + * (1) should only by used for guests which can handle the special return + * code. Also note that the insertion of the return code is quite interesting + * and that the guest MUST be paused - otherwise we would be corrupting + * the guest vCPU state. + * * (2) should be used only for guests which cannot handle the special - * new return code. (1) is always safe (but slower). + * new return code - and it is always safe (but slower). */ int xc_domain_resume(xc_interface *xch, uint32_t domid, int fast) {