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

Re: [Xen-devel] [PATCH v2 4/4] x86/hvm: Implement hvmemul_write() using real mappings



> -----Original Message-----
> From: Andrew Cooper
> Sent: 12 September 2017 08:10
> To: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>; xen-devel@xxxxxxxxxxxxx
> Cc: Tim (Xen.org) <tim@xxxxxxx>; George Dunlap
> <George.Dunlap@xxxxxxxxxx>; jbeulich@xxxxxxxx; Ian Jackson
> <Ian.Jackson@xxxxxxxxxx>; konrad.wilk@xxxxxxxxxx; sstabellini@xxxxxxxxxx;
> Wei Liu <wei.liu2@xxxxxxxxxx>; Paul Durrant <Paul.Durrant@xxxxxxxxxx>;
> boris.ostrovsky@xxxxxxxxxx; suravee.suthikulpanit@xxxxxxx;
> jun.nakajima@xxxxxxxxx; Kevin Tian <kevin.tian@xxxxxxxxx>; Razvan
> Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>; Mihai Donțu
> <mdontu@xxxxxxxxxxxxxxx>
> Subject: Re: [PATCH v2 4/4] x86/hvm: Implement hvmemul_write() using
> real mappings
> 
> On 08/09/17 17:05, Alexandru Isaila wrote:
> > +    } while ( frame < final );
> > +
> > +    /* Entire access within a single frame? */
> > +    if ( first == final )
> > +        mapping = map_domain_page(hvmemul_ctxt->mfn[0]) + (linear &
> ~PAGE_MASK);
> > +    /* Multiple frames? Need to vmap(). */
> > +    else if ( (mapping = vmap(hvmemul_ctxt->mfn,
> > +                              mfn - hvmemul_ctxt->mfn)) == NULL )
> > +        goto unhandleable;
> > +
> > +#ifndef NDEBUG /* Poision unused mfn[]s with INVALID_MFN. */
> > +    while ( mfn < hvmemul_ctxt->mfn + ARRAY_SIZE(hvmemul_ctxt->mfn)
> )
> > +    {
> > +        ASSERT(mfn_x(*mfn) == 0);
> > +        *mfn++ = INVALID_MFN;
> > +    }
> > +#endif
> > +
> > +    return mapping;
> 
> /sigh - its sad what you notice when looking over your own code somewhat
> later...
> 
> the + (linear & ~PAGE_MASK) needs removing from the
> map_domain_page()
> call, and adding to this return statement, because it also needs to
> happen for the vmap() case.

Should vmap call through to map_domain_page() in the case of a single page I 
wonder?

  Paul

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

 


Rackspace

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