From: Alexandru Stefan ISAILA <aisaila@bitdefender.com>
To: "JBeulich@suse.com" <JBeulich@suse.com>
Cc: "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
"paul.durrant@citrix.com" <paul.durrant@citrix.com>,
"Ian.Jackson@eu.citrix.com" <Ian.Jackson@eu.citrix.com>,
"wei.liu2@citrix.com" <wei.liu2@citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v9 03/11] x86/hvm: Introduce hvm_save_cpu_ctxt_one func
Date: Tue, 3 Jul 2018 12:05:44 +0000 [thread overview]
Message-ID: <1530619570.8880.34.camel@bitdefender.com> (raw)
In-Reply-To: <5B3657AD02000078001CF49B@prv1-mh.provo.novell.com>
On Vi, 2018-06-29 at 10:00 -0600, Jan Beulich wrote:
> >
> > >
> > > >
> > > > On 28.06.18 at 11:25, <aisaila@bitdefender.com> wrote:
> > +static int hvm_save_cpu_ctxt_one(struct vcpu *v,
> > hvm_domain_context_t *h)
> > +{
> > + struct segment_register seg;
> > + struct hvm_hw_cpu ctxt;
> > +
> > + memset(&ctxt, 0, sizeof(ctxt));
> > +
> > + /*
> > + * We don't need to save state for a vcpu that is down; the
> > restore
> > + * code will leave it down if there is nothing saved.
> > + */
> > + if ( v->pause_flags & VPF_down )
> > + return CONTINUE;
> Note how the original code had if() and memset() the other way
> around.
>
> >
> > static int hvm_save_cpu_ctxt(struct domain *d,
> > hvm_domain_context_t *h)
> > {
> > struct vcpu *v;
> > - struct hvm_hw_cpu ctxt;
> > - struct segment_register seg;
> > + int rc = 0;
> >
> > for_each_vcpu ( d, v )
> > {
> > - /* We don't need to save state for a vcpu that is down;
> > the restore
> > - * code will leave it down if there is nothing saved. */
> > - if ( v->pause_flags & VPF_down )
> > + rc = hvm_save_cpu_ctxt_one(v, h);
> > + if (rc == CONTINUE)
> Style. I'm pretty sure you were asked before to go through and
> check your additions for style.
>
> >
> > --- a/xen/include/asm-x86/hvm/support.h
> > +++ b/xen/include/asm-x86/hvm/support.h
> > @@ -52,6 +52,8 @@ extern unsigned int opt_hvm_debug_level;
> > #define HVM_DBG_LOG(level, _f, _a...) do {} while (0)
> > #endif
> >
> > +#define CONTINUE 2
> This is way too generic an identifier name. And it's not helpful at
> all without other possible values also enumerated. And please
> take "enumerated" as a hint ... Otoh, looking at its use - this is
> an agreement between hvm_save_cpu_ctxt() and
> hvm_save_cpu_ctxt_one() only. Why does such need a globally
> visible #define?
>
In the first patches(introduce*) it is used only between save*() and
save_one*() funcs but later in patch 9 it is used in hvm_save() so it
has to be visible from both places. I can move the enum(for the return
values) declaration to save.h if that is a good place for it.
Alex
________________________
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-07-03 12:05 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-28 9:25 [PATCH v9 00/11] x86/domctl: Save info for one vcpu instance Alexandru Isaila
2018-06-28 9:25 ` [PATCH v9 01/11] x86/cpu: Introduce vmce_save_vcpu_ctxt_one() func Alexandru Isaila
2018-06-29 15:54 ` Jan Beulich
2018-06-28 9:25 ` [PATCH v9 02/11] x86/hvm: Introduce hvm_save_tsc_adjust_one() func Alexandru Isaila
2018-06-28 9:25 ` [PATCH v9 03/11] x86/hvm: Introduce hvm_save_cpu_ctxt_one func Alexandru Isaila
2018-06-29 16:00 ` Jan Beulich
2018-07-03 12:05 ` Alexandru Stefan ISAILA [this message]
2018-07-03 12:17 ` Jan Beulich
2018-06-28 9:25 ` [PATCH v9 04/11] x86/hvm: Introduce hvm_save_cpu_xsave_states_one Alexandru Isaila
2018-06-28 9:25 ` [PATCH v9 05/11] x86/hvm: Introduce hvm_save_cpu_msrs_one func Alexandru Isaila
2018-06-28 9:25 ` [PATCH v9 06/11] x86/hvm: Introduce hvm_save_mtrr_msr_one func Alexandru Isaila
2018-06-28 9:25 ` [PATCH v9 07/11] x86/hvm: Introduce viridian_save_vcpu_ctxt_one() func Alexandru Isaila
2018-07-02 9:38 ` Paul Durrant
2018-07-02 13:15 ` Alexandru Stefan ISAILA
2018-07-02 13:27 ` Jan Beulich
2018-06-28 9:25 ` [PATCH v9 08/11] x86/hvm: Add handler for save_one funcs Alexandru Isaila
2018-06-28 9:25 ` [PATCH v9 09/11] x86/domctl: Don't pause the whole domain if only getting vcpu state Alexandru Isaila
2018-06-28 9:25 ` [PATCH v9 10/11] x86/hvm: Remove redundant save functions Alexandru Isaila
2018-06-28 9:25 ` [PATCH v9 11/11] x86/hvm: Remove save_one handler 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=1530619570.8880.34.camel@bitdefender.com \
--to=aisaila@bitdefender.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=paul.durrant@citrix.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.