[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v14 07/11] x86/hvm: Introduce viridian_save_vcpu_ctxt_one() func



>>> On 25.07.18 at 14:14, <aisaila@xxxxxxxxxxxxxxx> wrote:
> --- a/xen/arch/x86/hvm/viridian.c
> +++ b/xen/arch/x86/hvm/viridian.c
> @@ -1026,24 +1026,32 @@ 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;

Despite this conditional I think it wouldn't be overly expensive to
the non-Viridian case to move ...

> -    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,
> -        };
> +    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;

... these back into ctxt's initializer.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.