From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 2/2] x86/xen: during early setup, only 1:1 map the ISA region Date: Fri, 16 Aug 2013 11:25:53 -0400 Message-ID: <20130816152553.GD12047@konrad-lan.dumpdata.com> References: <1376664176-27535-1-git-send-email-david.vrabel@citrix.com> <1376664176-27535-3-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1376664176-27535-3-git-send-email-david.vrabel@citrix.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: David Vrabel Cc: Boris Ostrovsky , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, Aug 16, 2013 at 03:42:56PM +0100, David Vrabel wrote: > From: David Vrabel > > During early setup, when the reserved regions and MMIO holes are being > setup as 1:1 in the p2m, clear any mappings instead of making them 1:1 > (execept for the ISA region which is expected to be mapped). > > This reverts a change in behaviour introduced in 3.5 by 83d51ab473dd > (xen/setup: update VA mapping when releasing memory during setup). So it won't cause the original issues to reappear which is that we get this (XEN) page_alloc.c:1148:d0 Over-allocation for domain 0: 2097153 > 2097152 (XEN) memory.c:133:d0 Could not allocate order=0 extent: id=0 memflags=0 (0 of 17) if we boot without dom0_mem_max ? > > Signed-off-by: David Vrabel > --- > arch/x86/xen/setup.c | 16 +++++++++++----- > 1 files changed, 11 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c > index 5a093b7..081292e 100644 > --- a/arch/x86/xen/setup.c > +++ b/arch/x86/xen/setup.c > @@ -215,13 +215,19 @@ static void __init xen_set_identity_and_release_chunk( > unsigned long pfn; > > /* > - * If the PFNs are currently mapped, the VA mapping also needs > - * to be updated to be 1:1. > + * If the PFNs are currently mapped, clear the mappings > + * (except for the ISA region which must be 1:1 mapped) to > + * release the refcounts (in Xen) on the original frames. > */ > - for (pfn = start_pfn; pfn <= max_pfn_mapped && pfn < end_pfn; pfn++) > + for (pfn = start_pfn; pfn <= max_pfn_mapped && pfn < end_pfn; pfn++) { > + pte_t pte = __pte_ma(0); > + > + if (pfn < PFN_UP(ISA_END_ADDRESS)) > + pte = mfn_pte(pfn, PAGE_KERNEL_IO); > + > (void)HYPERVISOR_update_va_mapping( > - (unsigned long)__va(pfn << PAGE_SHIFT), > - mfn_pte(pfn, PAGE_KERNEL_IO), 0); > + (unsigned long)__va(pfn << PAGE_SHIFT), pte, 0); > + } > > if (start_pfn < nr_pages) > *released += xen_release_chunk( > -- > 1.7.2.5 >