xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: 'Alexandru Isaila' <aisaila@bitdefender.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: Ian Jackson <Ian.Jackson@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>
Subject: Re: [PATCH v12 07/11] x86/hvm: Introduce viridian_save_vcpu_ctxt_one() func
Date: Mon, 16 Jul 2018 15:34:16 +0000	[thread overview]
Message-ID: <10d44994e50c40639288de18acfd59a0@AMSPEX02CL02.citrite.net> (raw)
In-Reply-To: <1531752937-10478-8-git-send-email-aisaila@bitdefender.com>

> -----Original Message-----
> From: Alexandru Isaila [mailto:aisaila@bitdefender.com]
> Sent: 16 July 2018 15:56
> 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 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@bitdefender.com>
> ---
>  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@citrix.com>

> +        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@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-07-16 15:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16 14:55 [PATCH v12 00/11] x86/domctl: Save info for one vcpu instance Alexandru Isaila
2018-07-16 14:55 ` [PATCH v12 01/11] x86/cpu: Introduce vmce_save_vcpu_ctxt_one() func Alexandru Isaila
2018-07-16 14:55 ` [PATCH v12 02/11] x86/hvm: Introduce hvm_save_tsc_adjust_one() func Alexandru Isaila
2018-07-16 14:55 ` [PATCH v12 03/11] x86/hvm: Introduce hvm_save_cpu_ctxt_one func Alexandru Isaila
2018-07-16 15:29   ` Paul Durrant
2018-07-17 12:25     ` Isaila Alexandru
2018-07-17 14:03       ` Jan Beulich
2018-07-17 14:57         ` Isaila Alexandru
2018-07-16 14:55 ` [PATCH v12 04/11] x86/hvm: Introduce hvm_save_cpu_xsave_states_one Alexandru Isaila
2018-07-16 14:55 ` [PATCH v12 05/11] x86/hvm: Introduce hvm_save_cpu_msrs_one func Alexandru Isaila
2018-07-16 14:55 ` [PATCH v12 06/11] x86/hvm: Introduce hvm_save_mtrr_msr_one func Alexandru Isaila
2018-07-16 14:55 ` [PATCH v12 07/11] x86/hvm: Introduce viridian_save_vcpu_ctxt_one() func Alexandru Isaila
2018-07-16 15:34   ` Paul Durrant [this message]
2018-07-16 14:55 ` [PATCH v12 08/11] x86/hvm: Add handler for save_one funcs Alexandru Isaila
2018-07-16 14:55 ` [PATCH v12 09/11] x86/domctl: Don't pause the whole domain if only getting vcpu state Alexandru Isaila
2018-07-16 14:55 ` [PATCH v12 10/11] x86/hvm: Remove redundant save functions Alexandru Isaila
2018-07-16 14:55 ` [PATCH v12 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=10d44994e50c40639288de18acfd59a0@AMSPEX02CL02.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=aisaila@bitdefender.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).