From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: [PATCH 2/4] libxc/xc_domain_resume: Update comment. Date: Tue, 26 Jan 2016 16:30:58 -0500 Message-ID: <1453843860-29591-3-git-send-email-konrad.wilk@oracle.com> References: <1453843860-29591-1-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: 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 In-Reply-To: <1453843860-29591-1-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org, ian.campbell@citrix.com, wei.liu2@citrix.com, Ian.Jackson@eu.citrix.com Cc: Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org 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 --- 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) { -- 2.1.0