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

Re: [Xen-devel] [PATCH v2 9/9] viridian: introduce struct viridian_page



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> Sent: 05 November 2018 13:06
> To: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
> Cc: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>; Wei Liu
> <wei.liu2@xxxxxxxxxx>; Ian Jackson <Ian.Jackson@xxxxxxxxxx>; xen-devel
> <xen-devel@xxxxxxxxxxxxxxxxxxxx>
> Subject: Re: [PATCH v2 9/9] viridian: introduce struct viridian_page
> 
> >>> On 31.10.18 at 13:43, <paul.durrant@xxxxxxxxxx> wrote:
> > The 'vp_assist' page is currently an example of a guest page which needs
> to
> > be kept mapped throughout the life-time of a guest, but there are other
> > such examples in the specifiction [1]. This patch therefore introduces a
> > generic 'viridian_page' type and converts the current
> vp_assist/apic_assist
> > related code to use it. Subsequent patches implementing other
> enlightments
> > can then also make use of it.
> 
> This sounds generic (as in "not synic specific), yet ...
> 

Actually Microsoft lump pretty much all the interrupt enlightenments under the 
synic section in the spec. so I thought it better to put them all together.

> > --- a/xen/arch/x86/hvm/viridian/synic.c
> > +++ b/xen/arch/x86/hvm/viridian/synic.c
> > @@ -37,14 +37,13 @@ static void dump_vp_assist(const struct vcpu *v)
> >             v, (unsigned long)va->fields.pfn);
> >  }
> >
> > -static void initialize_vp_assist(struct vcpu *v)
> > +static void initialize_guest_page(struct vcpu *v, struct viridian_page
> *vp)
> >  {
> >      struct domain *d = v->domain;
> > -    unsigned long gmfn = v->arch.hvm.viridian.vp_assist.msr.fields.pfn;
> > +    unsigned long gmfn = vp->msr.fields.pfn;
> >      struct page_info *page = get_page_from_gfn(d, gmfn, NULL,
> P2M_ALLOC);
> > -    HV_VP_ASSIST_PAGE *ptr;
> >
> > -    ASSERT(!v->arch.hvm.viridian.vp_assist.ptr);
> > +    ASSERT(!vp->ptr);
> >
> >      if ( !page )
> >          goto fail;
> 
> ... you retain the implementation here, when it would now perhaps
> more logically live in viridian.c (again). Is this intentional?
> 

Not really, it's down the patch ordering. I agree it makes more sense to put it 
under viridian.c now. I'll move it.

> > @@ -221,9 +218,9 @@ void viridian_synic_load_vcpu_ctxt(
> >  {
> >      v->arch.hvm.viridian.vp_assist.msr.raw = ctxt->vp_assist_msr;
> >      if ( v->arch.hvm.viridian.vp_assist.msr.fields.enabled )
> > -        initialize_vp_assist(v);
> > +        initialize_guest_page(v, &v->arch.hvm.viridian.vp_assist);
> >
> > -    v->arch.hvm.viridian.vp_assist.pending = !!ctxt->vp_assist_pending;
> > +    v->arch.hvm.viridian.apic_assist_pending = !!ctxt-
> >apic_assist_pending;
> 
> No need for !! anymore with ...
> 
> > --- a/xen/include/asm-x86/hvm/viridian.h
> > +++ b/xen/include/asm-x86/hvm/viridian.h
> > @@ -88,13 +88,16 @@ union viridian_page_msr
> >      } fields;
> >  };
> >
> > +struct viridian_page
> > +{
> > +    union viridian_page_msr msr;
> > +    void *ptr;
> > +};
> > +
> >  struct viridian_vcpu
> >  {
> > -    struct {
> > -        union viridian_page_msr msr;
> > -        void *ptr;
> > -        bool pending;
> > -    } vp_assist;
> > +    struct viridian_page vp_assist;
> > +    bool apic_assist_pending;
> 
> ... this being (and having been) bool.
> 

True, I'll get rid of that.

  Paul

> 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®.