|   | 
      | 
  
  
      | 
      | 
  
 
     | 
    | 
  
  
     | 
    | 
  
  
    |   | 
      | 
  
  
    | 
         
xen-devel
[Xen-devel] [114/145] x86,	xen: Disable highmem PTE allocation even when
 
| 
To:  | 
linux-kernel@xxxxxxxxxxxxxxx, stable@xxxxxxxxxx | 
 
| 
Subject:  | 
[Xen-devel] [114/145] x86,	xen: Disable highmem PTE allocation even when CONFIG_HIGHPTE=y | 
 
| 
From:  | 
Greg KH <gregkh@xxxxxxx> | 
 
| 
Date:  | 
Fri, 12 Mar 2010 16:27:27 -0800 | 
 
| 
Cc:  | 
Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx,	Ian Campbell <ian.campbell@xxxxxxxxxx>,	Ingo Molnar <mingo@xxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>,	akpm@xxxxxxxxxxxxxxxxxxxx, torvalds@xxxxxxxxxxxxxxxxxxxx,	stable-review@xxxxxxxxxx, alan@xxxxxxxxxxxxxxxxxxx | 
 
| 
Delivery-date:  | 
Fri, 12 Mar 2010 16:32:58 -0800 | 
 
| 
Envelope-to:  | 
www-data@xxxxxxxxxxxxxxxxxxx | 
 
| 
In-reply-to:  | 
<20100313002816.GA18903@xxxxxxxxx> | 
 
| 
List-help:  | 
<mailto:xen-devel-request@lists.xensource.com?subject=help> | 
 
| 
List-id:  | 
Xen developer discussion <xen-devel.lists.xensource.com> | 
 
| 
List-post:  | 
<mailto:xen-devel@lists.xensource.com> | 
 
| 
List-subscribe:  | 
<http://lists.xensource.com/mailman/listinfo/xen-devel>,	<mailto:xen-devel-request@lists.xensource.com?subject=subscribe> | 
 
| 
List-unsubscribe:  | 
<http://lists.xensource.com/mailman/listinfo/xen-devel>,	<mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> | 
 
| 
Sender:  | 
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx | 
 
| 
User-agent:  | 
quilt/0.48-4.4 | 
 
 
 
2.6.32-stable review patch.  If anyone has any objections, please let me know.
----------------
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
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 <ian.campbell@xxxxxxxxxx>
LKML-Reference: <1267204562-11844-1-git-send-email-ian.campbell@xxxxxxxxxx>
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Pasi Kärkkäinen <pasik@xxxxxx>
Cc: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: H. Peter Anvin <hpa@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
 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
@@ -48,6 +48,7 @@
 #include <asm/traps.h>
 #include <asm/setup.h>
 #include <asm/desc.h>
+#include <asm/pgalloc.h>
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/reboot.h>
@@ -1092,6 +1093,12 @@ asmlinkage void __init xen_start_kernel(
 
        __supported_pte_mask |= _PAGE_IOMAP;
 
+       /*
+        * Prevent page tables from being allocated in highmem, even
+        * if CONFIG_HIGHPTE is enabled.
+        */
+       __userpte_alloc_gfp &= ~__GFP_HIGHMEM;
+
 #ifdef CONFIG_X86_64
        /* Work out if we support NX */
        check_efer();
--- 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 = PAGE_KERNEL;
 
+       /*
+        * 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 = PAGE_KERNEL_RO;
 
-       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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
 |   
 
| <Prev in Thread] | 
Current Thread | 
[Next in Thread> |  
- [Xen-devel] [114/145] x86,	xen: Disable highmem PTE allocation even when CONFIG_HIGHPTE=y,
Greg KH <=
  
 |  
  
 | 
    | 
  
  
    |   | 
    |