From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zhai, Edwin" Subject: Re: Re: HVM smp guest save/restore support Date: Thu, 25 Jan 2007 11:30:54 +0800 Message-ID: <20070125033054.GE15711@edwin-srv.sh.intel.com> References: <20070124133024.GC15711@edwin-srv.sh.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Yylu36WmvOXNoKYn" Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com, "Zhai, Edwin" List-Id: xen-devel@lists.xenproject.org --Yylu36WmvOXNoKYn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline thanks for your comments, update it. thanks, On Wed, Jan 24, 2007 at 06:32:36PM +0000, Keir Fraser wrote: > On 24/1/07 13:30, "Zhai, Edwin" wrote: > > >> All hvm vcpu context restore should be done via the new hvm domctl, and the > >> wakeup of APs can be implemented there (rather than in common/ directory). > > > > how about this patch? > > thanks, > > This new piece of code is not VMX specific. Define an hvm_load_cpu_ctxt() > function which executes that new piece of code after calling the VMX/SVM > specific hook function. Also you shouldn't need to check if the vcpu is HVM, > as otherwise you wouldn't be in this function! > > -- Keir > -- best rgds, edwin --Yylu36WmvOXNoKYn Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="smp_fix2.patch" diff -r bea505a69722 xen/arch/x86/hvm/hvm.c --- a/xen/arch/x86/hvm/hvm.c Tue Jan 23 15:58:05 2007 +0000 +++ b/xen/arch/x86/hvm/hvm.c Thu Jan 25 10:29:18 2007 +0800 @@ -170,12 +170,27 @@ void hvm_domain_destroy(struct domain *d unmap_domain_page_global((void *)d->arch.hvm_domain.buffered_io_va); } +int hvm_load_cpu_ctxt(hvm_domain_context_t *h, void *opaque, int version) +{ + struct vcpu *v = opaque; + + if ( hvm_funcs.load_cpu_ctxt(h, opaque, version) < 0 ) + return -EINVAL; + + /* wake up this vcpu for smp support */ + if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) ) { + vcpu_wake(v); + } + + return 0; +} + int hvm_vcpu_initialise(struct vcpu *v) { int rc; hvm_register_savevm(v->domain, "xen_hvm_cpu", v->vcpu_id, 1, - hvm_funcs.save_cpu_ctxt, hvm_funcs.load_cpu_ctxt, + hvm_funcs.save_cpu_ctxt, hvm_load_cpu_ctxt, (void *)v); if ( (rc = vlapic_init(v)) != 0 ) --Yylu36WmvOXNoKYn Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Yylu36WmvOXNoKYn--