From: "Stefan Lippers-Hollmann" Subject: Re: patch x86-xen-disable-highmem-pte-allocation-even-when-config_highpte-y.patch added to 2.6.33-stable tree Date: Fri, 12 Mar 2010 15:08:50 +0100 Message-ID: <201003121508.54384.s.L-H@gmx.de> References: <12683359492650@site> Mime-Version: 1.0 Content-Type: Text/Plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <12683359492650@site> Sender: linux-kernel-owner@vger.kernel.org To: gregkh@suse.de Cc: linux-kernel@vger.kernel.org, ian.campbell@citrix.com, hpa@zytor.com, jeremy@goop.org, mingo@elte.hu, pasik@iki.fi, xen-devel@lists.xensource.com, stable@kernel.org List-Id: xen-devel@lists.xenproject.org Hi On Friday 12 March 2010, gregkh@suse.de wrote: > This is a note to let you know that we have just queued up the patch = titled >=20 > Subject: x86, xen: Disable highmem PTE allocation even when CONFI= G_HIGHPTE=3Dy >=20 > to the 2.6.33-stable tree. Its filename is >=20 > x86-xen-disable-highmem-pte-allocation-even-when-config_highpte-y= =2Epatch >=20 > A git repo of this tree can be found at=20 > http://www.kernel.org/git/?p=3Dlinux/kernel/git/stable/stable-que= ue.git;a=3Dsummary >=20 >=20 > From 817a824b75b1475f1b067c8cee318c7b4d66fcde Mon Sep 17 00:00:00 200= 1 > From: Ian Campbell > Date: Fri, 26 Feb 2010 17:16:00 +0000 > Subject: x86, xen: Disable highmem PTE allocation even when CONFIG_HI= GHPTE=3Dy > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-8 > Content-Transfer-Encoding: 8bit >=20 > From: Ian Campbell >=20 > commit 817a824b75b1475f1b067c8cee318c7b4d66fcde upstream. >=20 > There's a path in the pagefault code where the kernel deliberately > breaks its own locking rules by kmapping a high pte page without > holding the pagetable lock (in at least page_check_address). This > breaks Xen's ability to track the pinned/unpinned state of the > page. There does not appear to be a viable workaround for this > behaviour so simply disable HIGHPTE for all Xen guests. This patch breaks compilation of the current 2.6.33 -stable queue and m= ight also affect queue-2.6.32 (untested): CC arch/x86/xen/enlighten.o arch/x86/xen/enlighten.c: In function =E2=80=98xen_start_kernel=E2=80=99= : arch/x86/xen/enlighten.c:1102: error: =E2=80=98__userpte_alloc_gfp=E2=80= =99 undeclared (first use in this function) arch/x86/xen/enlighten.c:1102: error: (Each undeclared identifier is re= ported only once arch/x86/xen/enlighten.c:1102: error: for each function it appears in.) make[2]: *** [arch/x86/xen/enlighten.o] Error 1 make[1]: *** [arch/x86/xen] Error 2 as it seems to depend (tested) on: commit 14315592009c17035cac81f4954d5a1f4d71e489 Author: Ian Campbell Date: Wed Feb 17 10:38:10 2010 +0000 x86, mm: Allow highmem user page tables to be disabled at boot time Regards Stefan Lippers-Hollmann --=20 > Signed-off-by: Ian Campbell > LKML-Reference: <1267204562-11844-1-git-send-email-ian.campbell@citri= x.com> > Cc: Jeremy Fitzhardinge > Cc: Ingo Molnar > Cc: Pasi K=C3=A4rkk=C3=A4inen > Cc: > Signed-off-by: H. Peter Anvin > Signed-off-by: Greg Kroah-Hartman >=20 > --- > arch/x86/xen/enlighten.c | 7 +++++++ > arch/x86/xen/mmu.c | 11 ++++++----- > 2 files changed, 13 insertions(+), 5 deletions(-) >=20 > --- a/arch/x86/xen/enlighten.c > +++ b/arch/x86/xen/enlighten.c > @@ -50,6 +50,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -1094,6 +1095,12 @@ asmlinkage void __init xen_start_kernel( > =20 > __supported_pte_mask |=3D _PAGE_IOMAP; > =20 > + /* > + * Prevent page tables from being allocated in highmem, even > + * if CONFIG_HIGHPTE is enabled. > + */ > + __userpte_alloc_gfp &=3D ~__GFP_HIGHMEM; > + > /* Work out if we support NX */ > x86_configure_nx(); > =20 > --- a/arch/x86/xen/mmu.c > +++ b/arch/x86/xen/mmu.c > @@ -1432,14 +1432,15 @@ static void *xen_kmap_atomic_pte(struct > { > pgprot_t prot =3D PAGE_KERNEL; > =20 > + /* > + * We disable highmem allocations for page tables so we should neve= r > + * see any calls to kmap_atomic_pte on a highmem page. > + */ > + BUG_ON(PageHighMem(page)); > + > if (PagePinned(page)) > prot =3D PAGE_KERNEL_RO; > =20 > - if (0 && PageHighMem(page)) > - printk("mapping highpte %lx type %d prot %s\n", > - page_to_pfn(page), type, > - (unsigned long)pgprot_val(prot) & _PAGE_RW ? "WRITE" : "REA= D"); > - > return kmap_atomic_prot(page, type, prot); > } > #endif