Re: [Xen-devel] [PATCH for-next v2 05/10] x86/domain: factor out pv_vcpu_initialise

2017-04-26 Thread Wei Liu
On Wed, Apr 26, 2017 at 07:27:23AM -0600, Jan Beulich wrote: > >>> On 26.04.17 at 14:53, wrote: > > On Wed, Apr 26, 2017 at 06:25:32AM -0600, Jan Beulich wrote: > >> > if ( is_hvm_domain(d) ) > >> > -{ > >> > rc = hvm_vcpu_initialise(v); > >> > -goto done; > >> > -} >

Re: [Xen-devel] [PATCH for-next v2 05/10] x86/domain: factor out pv_vcpu_initialise

2017-04-26 Thread Jan Beulich
>>> On 26.04.17 at 14:53, wrote: > On Wed, Apr 26, 2017 at 06:25:32AM -0600, Jan Beulich wrote: >> > if ( is_hvm_domain(d) ) >> > -{ >> > rc = hvm_vcpu_initialise(v); >> > -goto done; >> > -} >> > - >> > - >> > -spin_lock_init(&v->arch.pv_vcpu.shadow_ldt_lock); >>

Re: [Xen-devel] [PATCH for-next v2 05/10] x86/domain: factor out pv_vcpu_initialise

2017-04-26 Thread Wei Liu
On Wed, Apr 26, 2017 at 06:25:32AM -0600, Jan Beulich wrote: > > if ( is_hvm_domain(d) ) > > -{ > > rc = hvm_vcpu_initialise(v); > > -goto done; > > -} > > - > > - > > -spin_lock_init(&v->arch.pv_vcpu.shadow_ldt_lock); > > - > > -if ( !is_idle_domain(d) ) > > -

Re: [Xen-devel] [PATCH for-next v2 05/10] x86/domain: factor out pv_vcpu_initialise

2017-04-26 Thread Jan Beulich
>>> On 25.04.17 at 15:52, wrote: > +static int pv_vcpu_initialise(struct vcpu *v) > +{ > +struct domain *d = v->domain; > +int rc; > + > +ASSERT(!is_idle_domain(d)); > + > +spin_lock_init(&v->arch.pv_vcpu.shadow_ldt_lock); > + > +rc = pv_create_gdt_ldt_l1tab(d, v); > +if (

Re: [Xen-devel] [PATCH for-next v2 05/10] x86/domain: factor out pv_vcpu_initialise

2017-04-25 Thread Wei Liu
On Tue, Apr 25, 2017 at 03:08:23PM +0100, Andrew Cooper wrote: > On 25/04/17 14:52, Wei Liu wrote: > > Move PV specific vcpu initialisation code to said function, but leave > > the only line needed by idle domain in vcpu_initialise. > > > > Use pv_vcpu_destroy in error path to simplify code. It is

Re: [Xen-devel] [PATCH for-next v2 05/10] x86/domain: factor out pv_vcpu_initialise

2017-04-25 Thread Andrew Cooper
On 25/04/17 14:52, Wei Liu wrote: > Move PV specific vcpu initialisation code to said function, but leave > the only line needed by idle domain in vcpu_initialise. > > Use pv_vcpu_destroy in error path to simplify code. It is safe to do so > because the destruction function accepts partially initia

[Xen-devel] [PATCH for-next v2 05/10] x86/domain: factor out pv_vcpu_initialise

2017-04-25 Thread Wei Liu
Move PV specific vcpu initialisation code to said function, but leave the only line needed by idle domain in vcpu_initialise. Use pv_vcpu_destroy in error path to simplify code. It is safe to do so because the destruction function accepts partially initialised vcpu struct. Signed-off-by: Wei Liu