From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [V8 PATCH 5/8] pvh dom0: Add and remove foreign pages Date: Fri, 4 Apr 2014 18:17:04 -0700 Message-ID: <20140404181704.0cb0c289@mantra.us.oracle.com> References: <1395452357-1598-1-git-send-email-mukesh.rathor@oracle.com> <1395452357-1598-6-git-send-email-mukesh.rathor@oracle.com> <5330087202000078000013AA@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WWFEU-0007l3-8S for xen-devel@lists.xenproject.org; Sat, 05 Apr 2014 01:17:18 +0000 In-Reply-To: <5330087202000078000013AA@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: George.Dunlap@eu.citrix.com, tim@xen.org, eddie.dong@intel.com, keir.xen@gmail.com, jun.nakajima@intel.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Mon, 24 Mar 2014 09:26:58 +0000 "Jan Beulich" wrote: > >>> On 22.03.14 at 02:39, 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