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 v7 08/15] x86/cpu: Remove loop form vmce_save_vcpu_ctxt() func
Date: Fri, 8 Jun 2018 08:51:20 +0000 [thread overview]
Message-ID: <1528447880.25123.36.camel@bitdefender.com> (raw)
In-Reply-To: <d459cb16ab834f15907b75b4266a22b8@AMSPEX02CL03.citrite.net>
On Vi, 2018-06-08 at 08:33 +0000, Paul Durrant wrote:
> >
> > -----Original Message-----
> > From: Alexandru Isaila [mailto:aisaila@bitdefender.com]
> > Sent: 07 June 2018 15:59
> > 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 v7 08/15] x86/cpu: Remove loop form
> > vmce_save_vcpu_ctxt() func
> >
> > Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
> > ---
> > xen/arch/x86/cpu/mcheck/vmce.c | 27 +++++++--------------------
> > 1 file changed, 7 insertions(+), 20 deletions(-)
> >
> > diff --git a/xen/arch/x86/cpu/mcheck/vmce.c
> > b/xen/arch/x86/cpu/mcheck/vmce.c
> > index 404f27e..ead1f73 100644
> > --- a/xen/arch/x86/cpu/mcheck/vmce.c
> > +++ b/xen/arch/x86/cpu/mcheck/vmce.c
> > @@ -349,30 +349,17 @@ int vmce_wrmsr(uint32_t msr, uint64_t val)
> > return ret;
> > }
> >
> > -static void vmce_save_vcpu_ctxt_one(struct vcpu *v, struct
> > hvm_vmce_vcpu *ctxt)
> > -{
> > - ctxt->caps = v->arch.vmce.mcg_cap;
> > - ctxt->mci_ctl2_bank0 = v->arch.vmce.bank[0].mci_ctl2;
> > - ctxt->mci_ctl2_bank1 = v->arch.vmce.bank[1].mci_ctl2;
> > - ctxt->mcg_ext_ctl = v->arch.vmce.mcg_ext_ctl;
> > -}
> > -
> > static int vmce_save_vcpu_ctxt(struct domain *d,
> > hvm_domain_context_t
> > *h)
> > {
> > - struct vcpu *v;
> > - int err = 0;
> > -
> > - for_each_vcpu ( d, v )
> > - {
> > - struct hvm_vmce_vcpu ctxt;
> > + struct hvm_vmce_vcpu ctxt;
> > + struct vcpu *v = NULL;
> >
> > - vmce_save_vcpu_ctxt_one(v, &ctxt);
> > - err = hvm_save_entry(VMCE_VCPU, v->vcpu_id, h, &ctxt);
> > - if ( err )
> > - break;
> > - }
> > + ctxt.caps = v->arch.vmce.mcg_cap;
> There's a typo in the commit title (s/form/from), but I don't
> understand what you're doing here. You set v to NULL above and
> dereference it below. AFAICT, until patch #15 is applied context
> saving will be completely broken.
Yes, this is true, but it could't find a better way to split the last
patch further.
Alex
> >
> > + ctxt.mci_ctl2_bank0 = v->arch.vmce.bank[0].mci_ctl2;
> > + ctxt.mci_ctl2_bank1 = v->arch.vmce.bank[1].mci_ctl2;
> > + ctxt.mcg_ext_ctl = v->arch.vmce.mcg_ext_ctl;
> >
> > - return err;
> > + return hvm_save_entry(VMCE_VCPU, v->vcpu_id, h, &ctxt);
> > }
> >
> > static int vmce_load_vcpu_ctxt(struct domain *d,
> > hvm_domain_context_t
> > *h)
> > --
> > 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
next prev parent reply other threads:[~2018-06-08 8:51 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-07 14:59 [PATCH v7 00/15] x86/domctl: Save info for one vcpu instance Alexandru Isaila
2018-06-07 14:59 ` [PATCH v7 01/15] x86/cpu: Introduce vmce_save_vcpu_ctxt_one() func Alexandru Isaila
2018-06-08 14:45 ` Jan Beulich
2018-06-07 14:59 ` [PATCH v7 02/15] x86/hvm: Introduce hvm_save_tsc_adjust_one() func Alexandru Isaila
2018-06-07 14:59 ` [PATCH v7 03/15] x86/hvm: Introduce hvm_save_cpu_ctxt_one func Alexandru Isaila
2018-06-08 14:47 ` Jan Beulich
2018-06-07 14:59 ` [PATCH v7 04/15] x86/hvm: Introduce hvm_save_cpu_xsave_states_one Alexandru Isaila
2018-06-08 14:49 ` Jan Beulich
2018-06-07 14:59 ` [PATCH v7 05/15] x86/hvm: Introduce hvm_save_cpu_msrs_one func Alexandru Isaila
2018-06-08 14:50 ` Jan Beulich
2018-06-07 14:59 ` [PATCH v7 06/15] x86/hvm: Introduce hvm_save_mtrr_msr_one func Alexandru Isaila
2018-06-08 14:57 ` Jan Beulich
2018-06-07 14:59 ` [PATCH v7 07/15] x86/hvm: Introduce viridian_save_vcpu_ctxt_one() func Alexandru Isaila
2018-06-08 8:27 ` Paul Durrant
2018-06-07 14:59 ` [PATCH v7 08/15] x86/cpu: Remove loop form vmce_save_vcpu_ctxt() func Alexandru Isaila
2018-06-08 8:33 ` Paul Durrant
2018-06-08 8:51 ` Alexandru Stefan ISAILA [this message]
2018-06-08 12:46 ` Paul Durrant
2018-06-08 14:42 ` Jan Beulich
2018-06-20 8:56 ` Alexandru Stefan ISAILA
2018-06-21 7:39 ` Jan Beulich
2018-06-21 7:47 ` Alexandru Stefan ISAILA
2018-06-21 8:15 ` Jan Beulich
2018-06-07 14:59 ` [PATCH v7 09/15] x86/hvm: Remove loop from hvm_save_tsc_adjust() func Alexandru Isaila
2018-06-07 14:59 ` [PATCH v7 10/15] x86/hvm: Remove loop from hvm_save_cpu_ctxt func Alexandru Isaila
2018-06-07 14:59 ` [PATCH v7 11/15] x86/hvm: Remove loop from hvm_save_cpu_xsave_states Alexandru Isaila
2018-06-07 14:59 ` [PATCH v7 12/15] x86/hvm: Remove loop from hvm_save_cpu_msrs func Alexandru Isaila
2018-06-07 14:59 ` [PATCH v7 13/15] x86/hvm: Remove loop from hvm_save_mtrr_msr func Alexandru Isaila
2018-06-07 14:59 ` [PATCH v7 14/15] x86/hvm: Remove loop from viridian_save_vcpu_ctxt() func Alexandru Isaila
2018-06-07 14:59 ` [PATCH v7 15/15] x86/domctl: Don't pause the whole domain if only getting vcpu state Alexandru 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=1528447880.25123.36.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.