From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [RFC PATCH 14/16]: PVH xen: add xenmem_add_foreign_to_pmap() Date: Fri, 15 Feb 2013 16:17:35 -0800 Message-ID: <20130215161735.0d25c6dd@mantra.us.oracle.com> References: <20130111181103.5bfeed98@mantra.us.oracle.com> <20130124173118.GN20551@ocelot.phlegethon.org> <20130211181824.169b9d05@mantra.us.oracle.com> <20130214103927.GE83752@ocelot.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130214103927.GE83752@ocelot.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan Cc: "Xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Thu, 14 Feb 2013 10:39:27 +0000 Tim Deegan wrote: > 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? Yup, already changed the name to fgfn last week. >It may be that the memory is genuinely not there - since qemu doesn't >build the guest itself it doesn't necessarily know exactly where the >builder put all the memory. >If that's the case, then just failing the mapping is the right >response. Correct, and thats what PV dom0 does. I had it blatantly wrong! Fixed. Thanks, Mukesh