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

Re: [Xen-devel] [V8 PATCH 5/8] pvh dom0: Add and remove foreign pages



On Mon, 24 Mar 2014 09:26:58 +0000
"Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> >>> On 22.03.14 at 02:39, <mukesh.rathor@xxxxxxxxxx> wrote:
> > +static inline void atomic_write_ept_entry(ept_entry_t *entryptr,
......
> > because it
> > +     * will update the m2p table which will result in  mfn -> gpfn
> > of dom0
> > +     * and not fgfn of domU.
> > +     */
> > +    if ( set_foreign_p2m_entry(tdom, gpfn, _mfn(mfn)) == 0 )
> > +        gdprintk(XENLOG_WARNING, "set_foreign_p2m_entry failed. "
> > +                 "gpfn:%lx mfn:%lx fgfn:%lx td:%d fd:%d\n",
> > +                 gpfn, mfn, fgfn, tdom->domain_id,
> > fdom->domain_id);
> > +    else
> > +        rc = 0;
> 
> Can't you make set_foreign_p2m_entry() return a proper error code
> (if it doesn't already) and use that here instead of the relatively
> meaningless -EINVAL inherited from above (I suppose the function
> could e.g. also return -ENOMEM)?

Well, I wsa trying to keep set_foreign_p2m_entry symmetrical with
set_mmio_p2m_entry as they both call the common function 
set_typed_p2m_entry which returns 0 for failure. But, no reason
why I can't break the symmetry and flip that in set_foreign_p2m_entry.
It could return -EINVAL for error, since could be any reason for 
failure, invalid type or access being more likely. That is not propogated 
back up from set_p2m_entry() unfortunately.

thanks
Mukesh


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