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-changelog

[Xen-changelog] [linux-2.6.18-xen] xen/i386: Fix vmalloc_sync_all() for

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] xen/i386: Fix vmalloc_sync_all() for PAE.
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 27 Jul 2007 02:32:08 -0700
Delivery-date: Fri, 27 Jul 2007 02:30:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1184403059 -3600
# Node ID 34ebf92ad28d53f70ca02966c9f926f7d83bafbb
# Parent  9debaf36090515b4ce54712c4641781bc263b1a6
xen/i386: Fix vmalloc_sync_all() for PAE.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 arch/i386/mm/fault-xen.c |   33 +++++++++++++++++++++++----------
 1 files changed, 23 insertions(+), 10 deletions(-)

diff -r 9debaf360905 -r 34ebf92ad28d arch/i386/mm/fault-xen.c
--- a/arch/i386/mm/fault-xen.c  Fri Jul 13 16:15:37 2007 +0100
+++ b/arch/i386/mm/fault-xen.c  Sat Jul 14 09:50:59 2007 +0100
@@ -739,18 +739,31 @@ void vmalloc_sync_all(void)
         * problematic: insync can only get set bits added, and updates to
         * start are only improving performance (without affecting correctness
         * if undone).
-        */
-       static DECLARE_BITMAP(insync, PTRS_PER_PGD);
+        * XEN: To work on PAE, we need to iterate over PMDs rather than PGDs.
+        *      This change works just fine with 2-level paging too.
+        */
+#define sync_index(a) ((a) >> PMD_SHIFT)
+       static DECLARE_BITMAP(insync, PTRS_PER_PGD*PTRS_PER_PMD);
        static unsigned long start = TASK_SIZE;
        unsigned long address;
 
        BUILD_BUG_ON(TASK_SIZE & ~PGDIR_MASK);
-       for (address = start; address >= TASK_SIZE; address += PGDIR_SIZE) {
-               if (!test_bit(pgd_index(address), insync)) {
+       for (address = start;
+            address >= TASK_SIZE && address < hypervisor_virt_start;
+            address += 1UL << PMD_SHIFT) {
+               if (!test_bit(sync_index(address), insync)) {
                        unsigned long flags;
                        struct page *page;
 
                        spin_lock_irqsave(&pgd_lock, flags);
+                       /*
+                        * XEN: vmalloc_sync_one() failure path logic assumes
+                        * pgd_list is non-empty.
+                        */
+                       if (unlikely(!pgd_list)) {
+                               spin_unlock_irqrestore(&pgd_lock, flags);
+                               return;
+                       }
                        for (page = pgd_list; page; page =
                                        (struct page *)page->index)
                                if (!vmalloc_sync_one(page_address(page),
@@ -760,10 +773,10 @@ void vmalloc_sync_all(void)
                                }
                        spin_unlock_irqrestore(&pgd_lock, flags);
                        if (!page)
-                               set_bit(pgd_index(address), insync);
+                               set_bit(sync_index(address), insync);
                }
-               if (address == start && test_bit(pgd_index(address), insync))
-                       start = address + PGDIR_SIZE;
-       }
-}
-#endif
+               if (address == start && test_bit(sync_index(address), insync))
+                       start = address + (1UL << PMD_SHIFT);
+       }
+}
+#endif

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] xen/i386: Fix vmalloc_sync_all() for PAE., Xen patchbot-linux-2.6.18-xen <=