From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subject: patch x86-xen-disable-highmem-pte-allocation-even-when-config_highpte-y.patch added to 2.6.33-stable tree Date: Thu, 11 Mar 2010 11:32:29 -0800 Message-ID: <12683359492650@site> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: ian.campbell@citrix.com, gregkh@suse.de, hpa@zytor.com, jeremy@goop.org, mingo@elte.hu, pasik@iki.fi, xen-devel@lists.xensource.com Cc: stable@kernel.org, stable-commits@vger.kernel.org List-Id: xen-devel@lists.xenproject.org This is a note to let you know that we have just queued up the patch titl= ed Subject: x86, xen: Disable highmem PTE allocation even when CONFIG_HI= GHPTE=3Dy to the 2.6.33-stable tree. Its filename is x86-xen-disable-highmem-pte-allocation-even-when-config_highpte-y.pat= ch A git repo of this tree can be found at=20 http://www.kernel.org/git/?p=3Dlinux/kernel/git/stable/stable-queue.g= it;a=3Dsummary >>From 817a824b75b1475f1b067c8cee318c7b4d66fcde Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 26 Feb 2010 17:16:00 +0000 Subject: x86, xen: Disable highmem PTE allocation even when CONFIG_HIGHPT= E=3Dy MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit From: Ian Campbell commit 817a824b75b1475f1b067c8cee318c7b4d66fcde upstream. 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. Signed-off-by: Ian Campbell LKML-Reference: <1267204562-11844-1-git-send-email-ian.campbell@citrix.co= m> 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 --- arch/x86/xen/enlighten.c | 7 +++++++ arch/x86/xen/mmu.c | 11 ++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) --- 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 never + * 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" : "READ"); - return kmap_atomic_prot(page, type, prot); } #endif Patches currently in stable-queue which might be from ian.campbell@citrix= .com are