All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Yang Hongyang <yanghy@cn.fujitsu.com>
Cc: wei.liu2@citrix.com, wency@cn.fujitsu.com,
	andrew.cooper3@citrix.com, yunhong.jiang@intel.com,
	eddie.dong@intel.com, xen-devel@lists.xen.org,
	guijianfeng@cn.fujitsu.com, rshriram@cs.ubc.ca,
	ian.jackson@eu.citrix.com
Subject: Re: [PATCH v4 --for 4.6 COLOPre 11/25] tools/libxc: support to resume uncooperative HVM guests
Date: Wed, 15 Jul 2015 13:26:07 +0100	[thread overview]
Message-ID: <1436963167.32371.30.camel@citrix.com> (raw)
In-Reply-To: <1436946351-21118-12-git-send-email-yanghy@cn.fujitsu.com>

On Wed, 2015-07-15 at 15:45 +0800, Yang Hongyang wrote:
> From: Wen Congyang <wency@cn.fujitsu.com>
> 
> 1. suspend
> a. PVHVM and PV: we use the same way to suspend the guest (send the suspend
>    request to the guest). If the guest doesn't support evtchn, the xenstore
>    variant will be used, suspending the guest via XenBus control node.
> b. pure HVM: we call xc_domain_shutdown(..., SHUTDOWN_suspend) to suspend
>    the guest
> 
> 2. Resume:
> a. fast path
>    In this case, we don't change the guest's state.
>    PV: modify the return code to 1, and than call the domctl:
>        XEN_DOMCTL_resumedomain
>    PVHVM: same with PV
>    HVM: do nothing in modify_returncode, and than call the domctl:
>         XEN_DOMCTL_resumedomain
> b. slow
>    Used when the guest's state have been changed.
>    PV: update start info, and reset all secondary CPU states. Than call the
>    domctl: XEN_DOMCTL_resumedomain
>    PVHVM and HVM can not be resumed.
> 
> For PVHVM, in my test, only call the domctl: XEN_DOMCTL_resumedomain
> can work. I am not sure if we should update start info and reset all
> secondary CPU states.
> 
> For pure HVM guest, in my test, only call the domctl:
> XEN_DOMCTL_resumedomain can work.
> 
> So we can call libxl__domain_resume(..., 1) if we don't change the guest
> state, otherwise call libxl__domain_resume(..., 0).
> 
> Under COLO, we will update the guest's state(modify memory, cpu's registers,
> device status...). In this case, we cannot use the fast path to resume it.
> Keep the return code 0, and use a slow path to resume the guest. While
> resuming HVM using slow path is not supported currently, this patch is to
> make the resume call do not fail.

I'm afraid that the addition of this paragraph has not really addressed
my comment on v3:

        I'm afraid I think the commit message for this patch (and the associated
        doc comments) need revisiting almost from scratch, to clearly explain
        what this patch is doing and why and what the constraints on the new
        functionality will be.
        
        At the moment it mostly talks in a confusing way about the old behaviour
        and adds very specific assumptions to the new function which are not
        made clear.

It also appears that this has not been addressed:

        Hrm, so it sounds here like the correctness of this new functionality
        requires the caller to have not messed with the domain's state? What
        sort of changes are to the guest state are we talking about here?
        
        Isn't that a new requirement for this call? If so then it should be
        documented somewhere, specifically what sorts of changes are and are not
        allowed and the types of guests which are affected.
        
The two usages of "in my test" in the commit message also do not inspire
confidence that this change is understood to be correct, vs. happening
to be something which works for you.

Ian.

> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
> ---
>  tools/libxc/xc_resume.c | 22 ++++++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/libxc/xc_resume.c b/tools/libxc/xc_resume.c
> index e67bebd..bd82334 100644
> --- a/tools/libxc/xc_resume.c
> +++ b/tools/libxc/xc_resume.c
> @@ -109,6 +109,23 @@ static int xc_domain_resume_cooperative(xc_interface *xch, uint32_t domid)
>      return do_domctl(xch, &domctl);
>  }
>  
> +static int xc_domain_resume_hvm(xc_interface *xch, uint32_t domid)
> +{
> +    DECLARE_DOMCTL;
> +
> +    /*
> +     * If it is PVHVM, the hypercall return code is 0, because this
> +     * is not a fast path resume, we do not modify_returncode as in
> +     * xc_domain_resume_cooperative.
> +     * (resuming it in a new domain context)
> +     *
> +     * If it is a HVM, the hypercall is a NOP.
> +     */
> +    domctl.cmd = XEN_DOMCTL_resumedomain;
> +    domctl.domain = domid;
> +    return do_domctl(xch, &domctl);
> +}
> +
>  static int xc_domain_resume_any(xc_interface *xch, uint32_t domid)
>  {
>      DECLARE_DOMCTL;
> @@ -138,10 +155,7 @@ static int xc_domain_resume_any(xc_interface *xch, uint32_t domid)
>       */
>  #if defined(__i386__) || defined(__x86_64__)
>      if ( info.hvm )
> -    {
> -        ERROR("Cannot resume uncooperative HVM guests");
> -        return rc;
> -    }
> +        return xc_domain_resume_hvm(xch, domid);
>  
>      if ( xc_domain_get_guest_width(xch, domid, &dinfo->guest_width) != 0 )
>      {

  reply	other threads:[~2015-07-15 12:26 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15  7:45 [PATCH v4 --for 4.6 COLOPre 00/25] Prerequisite patches for COLO Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 01/25] tools/libxl: rename libxl__domain_suspend to libxl__domain_save Yang Hongyang
2015-07-15 11:16   ` Ian Campbell
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 02/25] tools/libxl: move domain suspend code into libxl_dom_suspend.c Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 03/25] tools/libxl: move domain resume " Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 04/25] tools/libxl: rename remus checkpoint callbacks Yang Hongyang
2015-07-15 11:17   ` Ian Campbell
2015-07-16  1:43     ` Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 05/25] libxl/remus: introduce libxl__remus_setup Yang Hongyang
2015-07-15 11:26   ` Ian Campbell
2015-07-16  5:32     ` Yang Hongyang
2015-07-16 10:40       ` Ian Campbell
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 06/25] libxl/remus: introduce libxl__remus_teardown Yang Hongyang
2015-07-15 11:59   ` Ian Campbell
2015-07-16  1:43     ` Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 07/25] libxl/remus: init checkpoint_callback in Remus checkpoint callback Yang Hongyang
2015-07-15 12:02   ` Ian Campbell
2015-07-15 12:35     ` Yang Hongyang
2015-07-16 10:32       ` Ian Campbell
2015-07-16 11:00         ` Yang Hongyang
2015-07-16 11:16           ` Ian Campbell
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 08/25] tools/libxl: move remus code into libxl_remus.c Yang Hongyang
2015-07-15 12:05   ` Ian Campbell
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 09/25] tools/libxl: move save/restore code into libxl_dom_save.c Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 10/25] libxl/save: Refactor libxl__domain_suspend_state Yang Hongyang
2015-07-15 12:10   ` Ian Campbell
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 11/25] tools/libxc: support to resume uncooperative HVM guests Yang Hongyang
2015-07-15 12:26   ` Ian Campbell [this message]
2015-07-16  5:57     ` Yang Hongyang
2015-07-16 15:40       ` Ian Jackson
2015-07-16 16:15         ` Yang Hongyang
2015-07-16 16:27           ` Ian Jackson
2015-12-15  2:05             ` Wen Congyang
2016-01-04 16:33               ` Ian Jackson
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 12/25] tools/libxl: introduce enum type libxl_checkpointed_stream Yang Hongyang
2015-07-15 12:34   ` Ian Campbell
2015-07-15 13:58     ` Yang Hongyang
2015-07-16 10:34       ` Ian Campbell
2015-07-16 10:47         ` Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 13/25] migration/save: pass checkpointed_stream from libxl to libxc Yang Hongyang
2015-07-15 12:38   ` Ian Campbell
2015-07-16  6:05     ` Yang Hongyang
2015-07-16 10:47       ` Ian Campbell
2015-07-16 16:13       ` Wei Liu
2015-07-16 16:21         ` Yang Hongyang
2015-07-16 16:39           ` Wei Liu
2015-07-16 16:10   ` Wei Liu
2015-07-16 16:24     ` Yang Hongyang
2015-07-16 16:37       ` Wei Liu
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 14/25] tools/libxl: introduce libxl__domain_restore_device_model to load qemu state Yang Hongyang
2015-07-15 12:45   ` Ian Campbell
2015-07-15 13:42     ` Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 15/25] tools/libxl: check QEMU state before resume dm Yang Hongyang
2015-07-15 12:48   ` Ian Campbell
2015-07-15 12:54     ` Ian Campbell
2015-07-15 13:00       ` Wei Liu
2015-07-15 13:48         ` Ian Campbell
2015-07-15 13:49     ` Ian Campbell
2015-07-16 14:43   ` Wei Liu
2015-07-16 15:43     ` Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 16/25] tools/libxl: Update libxl_domain_unpause() to support qemu-xen Yang Hongyang
2015-07-15 12:50   ` Ian Campbell
2015-07-16  3:49     ` Yang Hongyang
2015-07-16 10:39       ` Ian Campbell
2015-07-16 10:51         ` Yang Hongyang
2015-07-16 16:26   ` Wei Liu
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 17/25] tools/libxl: introduce libxl__domain_common_switch_qemu_logdirty() Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 18/25] tools/libxl: export logdirty_init Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 19/25] tools/libxl: Add back channel to allow migration target send data back Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 20/25] tools/libx{l, c}: add back channel to libxc Yang Hongyang
2015-07-15 13:13   ` Ian Campbell
2015-07-16  6:29     ` Yang Hongyang
2015-07-16 11:01       ` Ian Campbell
2015-07-15 13:21   ` Andrew Cooper
2015-07-16  6:07     ` Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 21/25] tools/libxl: rename remus device to checkpoint device Yang Hongyang
2015-07-15 13:15   ` Ian Campbell
2015-07-15 13:34     ` Yang Hongyang
2015-07-16  9:26       ` Andrew Cooper
2015-07-16  9:29         ` Yang Hongyang
2015-07-15 13:32   ` Ian Campbell
2015-07-15 13:38     ` Yang Hongyang
2015-07-16  9:23     ` Yang Hongyang
2015-07-16  9:31       ` Ian Campbell
2015-07-16  9:36         ` Yang Hongyang
2015-07-16 10:14           ` Ian Campbell
2015-07-16 10:22             ` Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 22/25] tools/libxl: adjust the indentation Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 23/25] tools/libxl: store remus_ops in checkpoint device state Yang Hongyang
2015-07-15 13:21   ` Ian Campbell
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 24/25] tools/libxl: move remus state into a seperate structure Yang Hongyang
2015-07-15 13:28   ` Ian Campbell
2015-07-15 13:50     ` Yang Hongyang
2015-07-16 10:37       ` Ian Campbell
2015-07-16 11:10         ` Ian Jackson
2015-07-16 11:19           ` Ian Campbell
2015-07-15 15:08   ` Ian Jackson
2015-07-15 15:18     ` Yang Hongyang
2015-07-15  7:45 ` [PATCH v4 --for 4.6 COLOPre 25/25] tools/libxl: seperate device init/cleanup from checkpoint device layer Yang Hongyang
2015-07-15 13:37   ` Ian Campbell
2015-07-16  1:37 ` [PATCH v4 --for 4.6 COLOPre 00/25] Prerequisite patches for COLO Yang Hongyang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436963167.32371.30.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=eddie.dong@intel.com \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=rshriram@cs.ubc.ca \
    --cc=wei.liu2@citrix.com \
    --cc=wency@cn.fujitsu.com \
    --cc=xen-devel@lists.xen.org \
    --cc=yanghy@cn.fujitsu.com \
    --cc=yunhong.jiang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.