All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Stefan ISAILA <aisaila@bitdefender.com>
To: "Paul.Durrant@citrix.com" <Paul.Durrant@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: "Ian.Jackson@citrix.com" <Ian.Jackson@citrix.com>,
	"wei.liu2@citrix.com" <wei.liu2@citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"Andrew.Cooper3@citrix.com" <Andrew.Cooper3@citrix.com>
Subject: Re: [PATCH v6 7/8] x86/hvm: Introduce viridian_save_vcpu_ctxt_one() func
Date: Wed, 6 Jun 2018 12:36:57 +0000	[thread overview]
Message-ID: <1528288617.25123.29.camel@bitdefender.com> (raw)
In-Reply-To: <ba55b36f205344488a1d65e11fac067a@AMSPEX02CL03.citrite.net>

On Mi, 2018-06-06 at 12:33 +0000, Paul Durrant wrote:
> > 
> > -----Original Message-----
> > From: Alexandru Isaila [mailto:aisaila@bitdefender.com]
> > Sent: 06 June 2018 13:25
> > To: xen-devel@lists.xen.org
> > Cc: Ian Jackson <Ian.Jackson@citrix.com>; Wei Liu <wei.liu2@citrix.
> > com>;
> > jbeulich@suse.com; Andrew Cooper <Andrew.Cooper3@citrix.com>; Paul
> > Durrant <Paul.Durrant@citrix.com>; Alexandru Isaila
> > <aisaila@bitdefender.com>
> > 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 <aisaila@bitdefender.com>
> > 
> > ---
> > 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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-06-06 12:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06 12:24 [PATCH v6 1/8] x86/cpu: Introduce vmce_save_vcpu_ctxt_one() func Alexandru Isaila
2018-06-06 12:24 ` [PATCH v6 2/8] x86/hvm: Introduce hvm_save_tsc_adjust_one() func Alexandru Isaila
2018-06-06 12:24 ` [PATCH v6 3/8] x86/hvm: Introduce hvm_save_cpu_ctxt_one func Alexandru Isaila
2018-06-06 12:24 ` [PATCH v6 4/8] x86/hvm: Introduce hvm_save_cpu_xsave_states_one Alexandru Isaila
2018-06-06 12:24 ` [PATCH v6 5/8] x86/hvm: Introduce hvm_save_cpu_msrs_one func Alexandru Isaila
2018-06-06 12:24 ` [PATCH v6 6/8] x86/hvm: Introduce hvm_save_mtrr_msr_one func Alexandru Isaila
2018-06-06 12:24 ` [PATCH v6 7/8] x86/hvm: Introduce viridian_save_vcpu_ctxt_one() func Alexandru Isaila
2018-06-06 12:33   ` Paul Durrant
2018-06-06 12:36     ` Alexandru Stefan ISAILA [this message]
2018-06-06 12:24 ` [PATCH v6 8/8] x86/domctl: Don't pause the whole domain if only getting vcpu state Alexandru Isaila
2018-06-06 12:38   ` Jan Beulich
2018-06-06 14:12     ` Alexandru Stefan ISAILA

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1528288617.25123.29.camel@bitdefender.com \
    --to=aisaila@bitdefender.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=Paul.Durrant@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.