From: Yang Hongyang Subject: [PATCH Remus v1 5/8] tools/libxc: defer the setting of HVM_PARAM_IDENT_PT Date: Thu, 7 May 2015 14:37:23 +0800 Message-ID: <1430980646-316-6-git-send-email-yanghy@cn.fujitsu.com> References: <1430980646-316-1-git-send-email-yanghy@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1430980646-316-1-git-send-email-yanghy@cn.fujitsu.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.xen.org Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, wency@cn.fujitsu.com, ian.jackson@eu.citrix.com, yunhong.jiang@intel.com, eddie.dong@intel.com, rshriram@cs.ubc.ca List-Id: xen-devel@lists.xenproject.org Set the hvm param HVM_PARAM_IDENT_PT second time will fail. So defer the setting of HVM_PARAM_IDENT_PT. Signed-off-by: Yang Hongyang --- tools/libxc/xc_sr_common.h | 3 +++ tools/libxc/xc_sr_restore_x86_hvm.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/tools/libxc/xc_sr_common.h b/tools/libxc/xc_sr_common.h index 6f099b8..f85eb41 100644 --- a/tools/libxc/xc_sr_common.h +++ b/tools/libxc/xc_sr_common.h @@ -280,6 +280,9 @@ struct xc_sr_context void *context; size_t contextsz; + /* HVM_PARAM_IDENT_PT */ + xen_pfn_t ident_pt; + #ifdef XG_LIBXL_HVM_COMPAT uint32_t qlen; void *qbuf; diff --git a/tools/libxc/xc_sr_restore_x86_hvm.c b/tools/libxc/xc_sr_restore_x86_hvm.c index 6f5af0e..929bee8 100644 --- a/tools/libxc/xc_sr_restore_x86_hvm.c +++ b/tools/libxc/xc_sr_restore_x86_hvm.c @@ -76,6 +76,14 @@ static int handle_hvm_params(struct xc_sr_context *ctx, ctx->restore.xenstore_gfn = entry->value; xc_clear_domain_page(xch, ctx->domid, entry->value); break; + case HVM_PARAM_IDENT_PT: + /* + * With Remus, we need to buffer this param because this + * can not be set multiple times, we will set this param + * at x86_hvm_stream_complete() + */ + ctx->x86_hvm.restore.ident_pt = entry->value; + continue; case HVM_PARAM_IOREQ_PFN: case HVM_PARAM_BUFIOREQ_PFN: xc_clear_domain_page(xch, ctx->domid, entry->value); @@ -278,6 +286,14 @@ static int x86_hvm_stream_complete(struct xc_sr_context *ctx) xc_interface *xch = ctx->xch; int rc; + rc = xc_hvm_param_set(xch, ctx->domid, HVM_PARAM_IDENT_PT, + ctx->x86_hvm.restore.ident_pt); + if ( rc ) + { + PERROR("Failed to set HVM_PARAM_IDENT_PT"); + return rc; + } + rc = xc_hvm_param_set(xch, ctx->domid, HVM_PARAM_STORE_EVTCHN, ctx->restore.xenstore_evtchn); if ( rc ) -- 1.9.1