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] Fix map_domain_page() by reverting a bogus simplificatio

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix map_domain_page() by reverting a bogus simplification
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 02 Nov 2005 19:30:08 +0000
Delivery-date: Wed, 02 Nov 2005 19:27:44 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 76fbcb25d174095d211712e52b43bbe9fff35bdc
# Parent  9cdfcecf4968fb4fd9b2db6795442b1cdc7aec42
Fix map_domain_page() by reverting a bogus simplification
that I committed in changeset 5303:d68bc64e2cfe38a85483a8c5d349b4ee45e91fb9
This fixes some very weird and nasty Xen crashes.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 9cdfcecf4968 -r 76fbcb25d174 xen/arch/x86/x86_32/domain_page.c
--- a/xen/arch/x86/x86_32/domain_page.c Wed Nov  2 16:29:32 2005
+++ b/xen/arch/x86/x86_32/domain_page.c Wed Nov  2 18:12:30 2005
@@ -27,6 +27,19 @@
 static unsigned int map_idx, epoch, shadow_epoch[NR_CPUS];
 static spinlock_t map_lock = SPIN_LOCK_UNLOCKED;
 
+/* Use a spare PTE bit to mark entries ready for recycling. */
+#define READY_FOR_TLB_FLUSH (1<<10)
+
+static void flush_all_ready_maps(void)
+{
+    l1_pgentry_t *cache = mapcache;
+    unsigned int i;
+
+    for ( i = 0; i < MAPCACHE_ENTRIES; i++ )
+        if ( (l1e_get_flags(cache[i]) & READY_FOR_TLB_FLUSH) )
+            cache[i] = l1e_empty();
+}
+
 void *map_domain_page(unsigned long pfn)
 {
     unsigned long va;
@@ -54,6 +67,7 @@
         if ( unlikely(idx == 0) )
         {
             ASSERT(flush_count++ == 0);
+            flush_all_ready_maps();
             perfc_incrc(domain_page_tlb_flush);
             local_flush_tlb();
             shadow_epoch[cpu] = ++epoch;
@@ -75,5 +89,5 @@
     ASSERT((void *)MAPCACHE_VIRT_START <= va);
     ASSERT(va < (void *)MAPCACHE_VIRT_END);
     idx = ((unsigned long)va - MAPCACHE_VIRT_START) >> PAGE_SHIFT;
-    mapcache[idx] = l1e_empty();
+    l1e_add_flags(mapcache[idx], READY_FOR_TLB_FLUSH);
 }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix map_domain_page() by reverting a bogus simplification, Xen patchbot -unstable <=