[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/3] libxc/xc_domain_resume: Update comment.



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 <konrad.wilk@xxxxxxxxxx>
> > ---
> >  tools/libxc/xc_resume.c | 7 +++++--
> >  1 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:
> >  /*
> >   * 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
> > + *  1. (fast=1) Resume with special return code (1) that the guest
> > + *     gets 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 environment.
> The guests's call to SCHEDOP_shutdown(SHUTDOWN_suspend) will return 1".
> 
> (assuming that is true re resetting)
> 
> > + *
> > + *  2. (fast=0) Reset guest environment so it believes it is resumed in a 
> > new
> >   *     domain context.
> 
> with the above I would suggesting adding "The guests's call to
> SCHEDOP_shutdown(SHUTDOWN_suspend) will return 0".
> 
> > + *
> >   * (2) should be used only for guests which cannot handle the special
> >   * 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=1 
would be fast but not safe. And 2) (fast=0) 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.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.