WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] fix inconsistency between change_page_attr and phys_pud_init

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] fix inconsistency between change_page_attr and phys_pud_init in x86-64
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Fri, 01 Jul 2005 16:30:53 +0200
Delivery-date: Fri, 01 Jul 2005 14:29:12 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Other than native x86-64 code, the XEN guest *does* use 4k mappings for the 
contiguous kernel mapping of (physical) memory. Thus the code in 
change_page_attr needs to work like on i386 (where large pages are used only 
conditionally) rather than like native x86-64. Patch below/attached. Not doing 
so triggered the BUG_ON during load of intel-agp on machines with i915 chipset.

Jan

diff -Nprux .list 2.6.11-xen/x86_64/mm/pageattr.c 
nxen-guest/x86_64/mm/pageattr.c
--- 2.6.11-xen/arch/xen/x86_64/mm/pageattr.c    2005-07-01 09:14:36.606227616 
-0700
+++ nxen-guest/arch/xen/x86_64/mm/pageattr.c    2005-07-01 09:15:43.387075384 
-0700
@@ -166,16 +166,23 @@ __change_page_attr(unsigned long address
                BUG();
 
        /* on x86-64 the direct mapping set at boot is not using 4k pages */
-       BUG_ON(PageReserved(kpte_page));
-
-       switch (page_count(kpte_page)) {
-       case 1:
-               save_page(address, kpte_page);               
-               revert_page(address, ref_prot);
-               break;
-       case 0:
-               BUG(); /* memleak and failed 2M page regeneration */
-       }
+//     BUG_ON(PageReserved(kpte_page));
+       /*
+        * ..., but the XEN guest kernels (currently) do:
+        * If the pte was reserved, it means it was created at boot
+        * time (not via split_large_page) and in turn we must not
+        * replace it with a large page.
+        */
+       if (!PageReserved(kpte_page)) {
+               switch (page_count(kpte_page)) {
+               case 1:
+                       save_page(address, kpte_page);               
+                       revert_page(address, ref_prot);
+                       break;
+               case 0:
+                       BUG(); /* memleak and failed 2M page regeneration */
+               }
+       }
        return 0;
 } 
 


Attachment: xenlinux-i915-agp.patch
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] fix inconsistency between change_page_attr and phys_pud_init in x86-64, Jan Beulich <=