From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= Subject: Re: [PATCH] xen/arm: Implement domain_get_maximum_gpfn Date: Wed, 2 Jul 2014 12:19:43 +0200 Message-ID: <53B3DCBF.5020801@citrix.com> References: <1404226666-7949-1-git-send-email-julien.grall@linaro.org> <1404292348.17692.0.camel@kazak.uk.xensource.com> <53B3CEBD.6090606@linaro.org> <1404292962.18330.1.camel@kazak.uk.xensource.com> <53B3D2E3.9060406@linaro.org> <1404294063.24733.0.camel@kazak.uk.xensource.com> <53B3F1EE020000780001F64B@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X2Hdx-0005rW-VZ for xen-devel@lists.xenproject.org; Wed, 02 Jul 2014 10:20:06 +0000 In-Reply-To: <53B3F1EE020000780001F64B@mail.emea.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 , Ian Campbell , Julien Grall Cc: xen-devel@lists.xenproject.org, Stefano Stabellini , Tim Deegan List-Id: xen-devel@lists.xenproject.org On 02/07/14 11:50, Jan Beulich wrote: >>>> On 02.07.14 at 11:41, wrote: >> On Wed, 2014-07-02 at 10:37 +0100, Julien Grall wrote: >>> On 02/07/14 10:22, Ian Campbell wrote: >>>> Any reason why both arm and x86 can't just use a fixed scratch pfn for >>>> this temporary mapping? Both of them surely have spaces which they can >>>> guarantee won't overlap with anything. >>> >>> This was the previous behavior until last November. >>> >>> commit db062c28f30eb68d1b5d7a910445a0ba1136179a >>> Date: Wed Nov 13 09:26:13 2013 +0100 >>> >>> libxc: move temporary grant table mapping to end of memory >>> >>> In order to set up the grant table for HVM guests, libxc needs to map >>> the grant table temporarily. At the moment, it does this by adding the >>> grant page to the HVM guest's p2m table in the MMIO hole (at gfn 0xFFFFE), >>> then mapping that gfn, setting up the table, then unmapping the gfn and >>> removing it from the p2m table. >>> >>> This breaks with PVH guests with 4G or more of ram, because there is >>> no MMIO hole; so it ends up clobbering a valid RAM p2m entry, then >>> leaving a "hole" when it removes the grant map from the p2m table. >>> Since the guest thinks this is normal ram, when it maps it and tries >>> to access the page, it crashes. >>> >>> This patch maps the page at max_gfn+1 instead. >>> >>> I'm not sure what to do for x86, so I was planning to introduce a per-arch >> hook to retrieve a scratch gpfn. >>> x86 would keep the current behavior, and ARM will use the GNTTAB space in >> the layout. >> >> Perhaps x86 could use some well known MMIO space, like the APIC at >> 0xfff???? > > Except that PVH has no LAPIC right now. Yet with the recent hole > punching patches I wonder whether "there is no MMIO hole" is actually > correct. Roger? For PVH guests there's still no MMIO hole (or any other kind of hole) at all, the hole(s) is only there for Dom0. Roger.