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 a bug in shadow_remove_all_access_in_page.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix a bug in shadow_remove_all_access_in_page.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Sep 2005 10:06:13 +0000
Delivery-date: Tue, 13 Sep 2005 10:04:45 +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 36e74b5dfa95e5a5e990df277dfba1b7b2774ff7
# Parent  1cb7adaa33555ac81d79c3f3cc868bc981557220
Fix a bug in shadow_remove_all_access_in_page.

Fixes a fairly obvious bug, in which an if statement was reversed.  The
bug has been present for a while, so apparently this code isn't well
tested.

Signed-off-by: Michael Vrable <mvrable@xxxxxxxxxxx>

diff -r 1cb7adaa3355 -r 36e74b5dfa95 xen/arch/x86/shadow32.c
--- a/xen/arch/x86/shadow32.c   Tue Sep 13 08:35:41 2005
+++ b/xen/arch/x86/shadow32.c   Tue Sep 13 09:09:59 2005
@@ -2214,7 +2214,7 @@
     struct domain *d, unsigned long l1mfn, unsigned long forbidden_gmfn)
 {
     l1_pgentry_t *pl1e = map_domain_page(l1mfn);
-    l1_pgentry_t match;
+    l1_pgentry_t match, ol2e;
     unsigned long flags  = _PAGE_PRESENT;
     int i;
     u32 count = 0;
@@ -2226,17 +2226,17 @@
     
     for (i = 0; i < L1_PAGETABLE_ENTRIES; i++)
     {
-        if ( unlikely(!l1e_has_changed(pl1e[i], match, flags) == 0) )
-        {
-            l1_pgentry_t ol2e = pl1e[i];
-            pl1e[i] = l1e_empty();
-            count++;
-
-            if ( is_l1_shadow )
-                shadow_put_page_from_l1e(ol2e, d);
-            else /* must be an hl2 page */
-                put_page(&frame_table[forbidden_gmfn]);
-        }
+        if ( l1e_has_changed(pl1e[i], match, flags) )
+            continue;
+
+        ol2e = pl1e[i];
+        pl1e[i] = l1e_empty();
+        count++;
+
+        if ( is_l1_shadow )
+            shadow_put_page_from_l1e(ol2e, d);
+        else /* must be an hl2 page */
+            put_page(&frame_table[forbidden_gmfn]);
     }
 
     unmap_domain_page(pl1e);
diff -r 1cb7adaa3355 -r 36e74b5dfa95 xen/arch/x86/shadow_public.c
--- a/xen/arch/x86/shadow_public.c      Tue Sep 13 08:35:41 2005
+++ b/xen/arch/x86/shadow_public.c      Tue Sep 13 09:09:59 2005
@@ -1622,7 +1622,7 @@
     struct domain *d, unsigned long l1mfn, unsigned long forbidden_gmfn)
 {
     l1_pgentry_t *pl1e = map_domain_page(l1mfn);
-    l1_pgentry_t match;
+    l1_pgentry_t match, ol2e;
     unsigned long flags  = _PAGE_PRESENT;
     int i;
     u32 count = 0;
@@ -1634,17 +1634,17 @@
 
     for (i = 0; i < L1_PAGETABLE_ENTRIES; i++)
     {
-        if ( unlikely(!l1e_has_changed(pl1e[i], match, flags) == 0) )
-        {
-            l1_pgentry_t ol2e = pl1e[i];
-            pl1e[i] = l1e_empty();
-            count++;
-
-            if ( is_l1_shadow )
-                shadow_put_page_from_l1e(ol2e, d);
-            else /* must be an hl2 page */
-                put_page(&frame_table[forbidden_gmfn]);
-        }
+        if ( l1e_has_changed(pl1e[i], match, flags) )
+            continue;
+
+        ol2e = pl1e[i];
+        pl1e[i] = l1e_empty();
+        count++;
+
+        if ( is_l1_shadow )
+            shadow_put_page_from_l1e(ol2e, d);
+        else /* must be an hl2 page */
+            put_page(&frame_table[forbidden_gmfn]);
     }
 
     unmap_domain_page(pl1e);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix a bug in shadow_remove_all_access_in_page., Xen patchbot -unstable <=