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

Re: [Xen-devel] [PATCH] x86/hvm/viridian: save APIC assist vector



> -----Original Message-----
> From: Andrew Cooper [mailto:andrew.cooper3@xxxxxxxxxx]
> Sent: 24 March 2016 17:58
> To: Paul Durrant; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Jan Beulich
> Subject: Re: [Xen-devel] [PATCH] x86/hvm/viridian: save APIC assist vector
> 
> On 24/03/16 17:19, Paul Durrant wrote:
> > @@ -293,10 +292,11 @@ void viridian_start_apic_assist(struct vcpu *v, int
> vector)
> >       * wrong and the VM will most likely hang so force a crash now
> >       * to make the problem clear.
> >       */
> > -    if ( v->arch.hvm_vcpu.viridian.apic_assist.vector >= 0 )
> > +    if ( v->arch.hvm_vcpu.viridian.apic_assist.vector != 0 )
> >          domain_crash(v->domain);
> >
> > -    v->arch.hvm_vcpu.viridian.apic_assist.vector = vector;
> > +    /* Increment the value so that zero is always invalid. */
> > +    v->arch.hvm_vcpu.viridian.apic_assist.vector = vector + 1;
> 
> Can you add a comment to viridan_cpu that a variable named vector
> actually holds "vector + 1" ?
> 
> It can also be changed to an unsigned value.
> 
> >      *va |= 1u;
> >  }
> >
> > diff --git a/xen/include/public/arch-x86/hvm/save.h
> b/xen/include/public/arch-x86/hvm/save.h
> > index fbd1c6a..fc8e8f9 100644
> > --- a/xen/include/public/arch-x86/hvm/save.h
> > +++ b/xen/include/public/arch-x86/hvm/save.h
> > @@ -588,7 +588,8 @@ struct hvm_viridian_domain_context {
> >  DECLARE_HVM_SAVE_TYPE(VIRIDIAN_DOMAIN, 15, struct
> hvm_viridian_domain_context);
> >
> >  struct hvm_viridian_vcpu_context {
> > -    uint64_t apic_assist;
> > +    uint64_t apic_assist_msr;
> > +    uint16_t apic_assist_vector;
> 
> An explicit uint16_t[3] _pad; please.
> 

Given that I'm going to drop the biasing technique, I'll drop this to a uint8_t 
and add appropriate padding as requested.

  Paul

> ~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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