From: Tim Deegan Subject: Re: [RFC PATCH 14/16]: PVH xen: add xenmem_add_foreign_to_pmap() Date: Thu, 14 Feb 2013 10:39:27 +0000 Message-ID: <20130214103927.GE83752@ocelot.phlegethon.org> References: <20130111181103.5bfeed98@mantra.us.oracle.com> <20130124173118.GN20551@ocelot.phlegethon.org> <20130211181824.169b9d05@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20130211181824.169b9d05@mantra.us.oracle.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: Mukesh Rathor Cc: "Xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org At 18:18 -0800 on 11 Feb (1360606704), Mukesh Rathor wrote: > > > + if (!is_hvm_domain(fdom)) { > > > + printk("mmio type for non-hvm domain. fd:%d fgmfn:%lx > > > gpfn:%lx\n", > > > + foreign_domid, fgmfn, gpfn); > > > + return -EINVAL; > > > + } > > > + mfn = fgmfn; /* map 1 to 1 */ > > > > Surely not -- you want to map the _actual_ MMIO range, right, not just > > whatever GFN-address the foreigh domain mapped it at? > > Actually, fgmfn here is the machine address of the mmio page. I hope not! You've just passed it to a p2m lookup a little earlier, so it had better be a gfn. (And in either case it could do with a more explicit name: maybe fmfn if it's an mfn or fgfn if it's a gfn? Tim.