On Mi, 2018-06-06 at 12:33 +0000, Paul Durrant wrote:
> >
> > -----Original Message-----
> > From: Alexandru Isaila [mailto:[email protected]]
> > Sent: 06 June 2018 13:25
> > To: [email protected]
> > Cc: Ian Jackson <[email protected]>; Wei Liu <wei.liu2@citrix.
> > com>;
> > [email protected]; Andrew Cooper <[email protected]>; Paul
> > Durrant <[email protected]>; Alexandru Isaila
> > <[email protected]>
> > Subject: [PATCH v6 7/8] x86/hvm: Introduce
> > viridian_save_vcpu_ctxt_one()
> > func
> >
> > This is used to save data from a single instance.
> >
> > Signed-off-by: Alexandru Isaila <[email protected]>
> >
> > ---
> > Changes since V5:
> > - Add memset to 0 for ctxt->_pad
> > ---
> > xen/arch/x86/hvm/viridian.c | 14 ++++++++++----
> > 1 file changed, 10 insertions(+), 4 deletions(-)
> >
> > diff --git a/xen/arch/x86/hvm/viridian.c
> > b/xen/arch/x86/hvm/viridian.c
> > index 694eae6..9be5ed2 100644
> > --- a/xen/arch/x86/hvm/viridian.c
> > +++ b/xen/arch/x86/hvm/viridian.c
> > @@ -1026,6 +1026,13 @@ 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 void viridian_save_vcpu_ctxt_one(struct vcpu *v, struct
> > hvm_viridian_vcpu_context *ctxt)
> > +{
> > + 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;
> > + memset(ctxt->_pad, 0, sizeof(ctxt->_pad));
> Sorry, this is not what I meant. What I meant was:
>
> memset(ctx, 0, sizeof(*ctx));
> 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;
>
Sorry for the misunderstanding, I'll fix it on the next version
Alex
>
> >
> > +}
> > +
> > static int viridian_save_vcpu_ctxt(struct domain *d,
> > hvm_domain_context_t
> > *h)
> > {
> > struct vcpu *v;
> > @@ -1034,10 +1041,9 @@ static int viridian_save_vcpu_ctxt(struct
> > domain
> > *d, hvm_domain_context_t *h)
> > return 0;
> >
> > for_each_vcpu( d, v ) {
> > - 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,
> > - };
> > + struct hvm_viridian_vcpu_context ctxt;
> > +
> > + viridian_save_vcpu_ctxt_one(v, &ctxt);
> >
> > if ( hvm_save_entry(VIRIDIAN_VCPU, v->vcpu_id, h, &ctxt)
> > != 0 )
> > return 1;
> > --
> > 2.7.4
>
> ________________________
> This email was scanned by Bitdefender
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel