[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v12 07/11] x86/hvm: Introduce viridian_save_vcpu_ctxt_one() func
> -----Original Message----- > From: Alexandru Isaila [mailto:aisaila@xxxxxxxxxxxxxxx] > Sent: 16 July 2018 15:56 > To: xen-devel@xxxxxxxxxxxxx > Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxx>; Wei Liu <wei.liu2@xxxxxxxxxx>; > jbeulich@xxxxxxxx; Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>; Paul > Durrant <Paul.Durrant@xxxxxxxxxx>; Alexandru Isaila > <aisaila@xxxxxxxxxxxxxxx> > Subject: [PATCH v12 07/11] x86/hvm: Introduce > viridian_save_vcpu_ctxt_one() func > > This is used to save data from a single instance. > > Signed-off-by: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx> > --- > xen/arch/x86/hvm/viridian.c | 29 +++++++++++++++++++---------- > 1 file changed, 19 insertions(+), 10 deletions(-) > > diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c > index 694eae6..f3430bb 100644 > --- a/xen/arch/x86/hvm/viridian.c > +++ b/xen/arch/x86/hvm/viridian.c > @@ -1026,24 +1026,33 @@ static int viridian_load_domain_ctxt(struct > domain *d, hvm_domain_context_t *h) > HVM_REGISTER_SAVE_RESTORE(VIRIDIAN_DOMAIN, > viridian_save_domain_ctxt, > viridian_load_domain_ctxt, 1, HVMSR_PER_DOM); > > -static int viridian_save_vcpu_ctxt(struct domain *d, > hvm_domain_context_t *h) > +static int viridian_save_vcpu_ctxt_one(struct vcpu *v, > hvm_domain_context_t *h) > { > - struct vcpu *v; > + struct hvm_viridian_vcpu_context ctxt = {}; > > - if ( !is_viridian_domain(d) ) > + if ( !is_viridian_domain(v->domain) ) > return 0; > > + ctxt.vp_assist_msr = v->arch.hvm_vcpu.viridian.vp_assist.msr.raw; > + ctxt.vp_assist_pending = v->arch.hvm_vcpu.viridian.vp_assist.pending; > + > + return hvm_save_entry(VIRIDIAN_VCPU, v->vcpu_id, h, &ctxt); > +} > + > +static int viridian_save_vcpu_ctxt(struct domain *d, > hvm_domain_context_t *h) > +{ > + struct vcpu *v; > + int err = 0; > + > for_each_vcpu( d, v ) { Sorry for not noticing earlier but, whilst you're not actually changing this line, it needs a style fix. So if you re-spin this then it would be good to correct it. > - struct hvm_viridian_vcpu_context ctxt = { > - .vp_assist_msr = v->arch.hvm_vcpu.viridian.vp_assist.msr.raw, > - .vp_assist_pending = v->arch.hvm_vcpu.viridian.vp_assist.pending, > - }; > > - if ( hvm_save_entry(VIRIDIAN_VCPU, v->vcpu_id, h, &ctxt) != 0 ) > - return 1; > + err = viridian_save_vcpu_ctxt_one(v, h); > + I think you can lose the blank line here, but that's a small nit so... Reviewed-by: Paul Durrant <paul.durrant@xxxxxxxxxx> > + if ( err ) > + break; > } > > - return 0; > + return err; > } > > static int viridian_load_vcpu_ctxt(struct domain *d, hvm_domain_context_t > *h) > -- > 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |