From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 1/3] libxc/xc_domain_resume: Update comment. Date: Tue, 26 Jan 2016 14:47:09 -0500 Message-ID: <20160126194709.GC25403@char.us.oracle.com> References: <1453756017-8747-1-git-send-email-konrad.wilk@oracle.com> <1453756017-8747-2-git-send-email-konrad.wilk@oracle.com> <1453825194.25257.31.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aO9a8-00051H-7E for xen-devel@lists.xenproject.org; Tue, 26 Jan 2016 19:47:16 +0000 Content-Disposition: inline In-Reply-To: <1453825194.25257.31.camel@citrix.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: Ian Campbell Cc: xen-devel@lists.xenproject.org, wei.liu2@citrix.com, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Tue, Jan 26, 2016 at 04:19:54PM +0000, Ian Campbell wrote: > On Mon, 2016-01-25 at 16:06 -0500, Konrad Rzeszutek Wilk wrote: > > To hopefully clarify what it meant. > > = > > Signed-off-by: Konrad Rzeszutek Wilk > > --- > > =A0tools/libxc/xc_resume.c | 7 +++++-- > > =A01 file changed, 5 insertions(+), 2 deletions(-) > > = > > diff --git a/tools/libxc/xc_resume.c b/tools/libxc/xc_resume.c > > index 87d4324..19ba2a3 100644 > > --- a/tools/libxc/xc_resume.c > > +++ b/tools/libxc/xc_resume.c > > @@ -248,9 +248,12 @@ out: > > =A0/* > > =A0 * Resume execution of a domain after suspend shutdown. > > =A0 * This can happen in one of two ways: > > - *=A0=A01. Resume with special return code. > > - *=A0=A02. Reset guest environment so it believes it is resumed in a n= ew > > + *=A0=A01. (fast=3D1) Resume with special return code (1) that the gue= st > > + *=A0=A0=A0=A0=A0gets from SCHEDOP_shutdown:SHUTDOWN_suspend. > = > "SCHEDOP_shutdown(SHUTDOWN_suspend)" looks more like the function call > which this in effect is. > = > I think I'd say "Resume the guest without resetting the domain environmen= t. > The guests's call to SCHEDOP_shutdown(SHUTDOWN_suspend) will return 1". > = > (assuming that is true re resetting) > = > > + * > > + *=A0=A02. (fast=3D0) Reset guest environment so it believes it is res= umed in a new > > =A0 *=A0=A0=A0=A0=A0domain context. > = > with the above I would suggesting adding "The guests's call to > SCHEDOP_shutdown(SHUTDOWN_suspend) will return 0". > = > > + * > > =A0 * (2) should be used only for guests which cannot handle the special > > =A0 * new return code. (1) is always safe (but slower). > = > Is this correct? I'd have said (2) was always safe but slow? That does not sound right. It should have said that fast=3D1 = would be fast but not safe. And 2) (fast=3D0) is safe but slower. Let me resend this - with it hopefully being more clear. > = > And I would invert the first, that is to say that (1) should be used in > preference with guests which support it. Reading the 1) I am bit perplexed. It says "safe" but what it does is far from safe - it manipulates the vCPU eax register to be 1. Granted it does it on a "paused" vCPU and once the vCPU resume it can read it. I guess in the olden days this was considered safe. Along with driving without seatbelts. > = > Ian.