> -----Original Message-----
> From: Andrew Cooper
> Sent: 12 September 2017 08:10
> To: Alexandru Isaila <aisa...@bitdefender.com>; xen-devel@lists.xen.org
> Cc: Tim (Xen.org) <t...@xen.org>; George Dunlap
> <george.dun...@citrix.com>; jbeul...@suse.com; Ian Jackson
> <ian.jack...@citrix.com>; konrad.w...@oracle.com; sstabell...@kernel.org;
> Wei Liu <wei.l...@citrix.com>; Paul Durrant <paul.durr...@citrix.com>;
> boris.ostrov...@oracle.com; suravee.suthikulpa...@amd.com;
> jun.nakaj...@intel.com; Kevin Tian <kevin.t...@intel.com>; Razvan
> Cojocaru <rcojoc...@bitdefender.com>; Mihai Donțu
> <mdo...@bitdefender.com>
> 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@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to