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 bug with get_page_type where validating an L2/L3/L4

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix bug with get_page_type where validating an L2/L3/L4 page which contained a self
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Mon, 18 Apr 2005 15:19:54 +0000
Delivery-date: Tue, 19 Apr 2005 01:03:09 +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 Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1310, 2005/04/18 16:19:54+01:00, maf46@xxxxxxxxxxxxxxxxx

        Fix bug with get_page_type where validating an L2/L3/L4 page which 
contained a self
        reference would cause xen to busy-wait forever.
        
        Signed-off-by: michael.fetterman@xxxxxxxxxxxx



 mm.c |   53 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 28 insertions(+), 25 deletions(-)


diff -Nru a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c 2005-04-18 21:03:25 -04:00
+++ b/xen/arch/x86/mm.c 2005-04-18 21:03:25 -04:00
@@ -1229,35 +1229,38 @@
                     nx |= PGT_validated;
             }
         }
-        else if ( unlikely(!(x & PGT_validated)) )
+        else
         {
-            /* Someone else is updating validation of this page. Wait... */
-            while ( (y = page->u.inuse.type_info) == x )
-                cpu_relax();
-            goto again;
-        }
-        else if ( unlikely((x & (PGT_type_mask|PGT_va_mask)) != type) )
-        {
-            if ( unlikely((x & PGT_type_mask) != (type & PGT_type_mask) ) )
-            {
-                if ( ((x & PGT_type_mask) != PGT_l2_page_table) ||
-                     ((type & PGT_type_mask) != PGT_l1_page_table) )
-                    MEM_LOG("Bad type (saw %08x != exp %08x) for pfn %p",
-                            x, type, page_to_pfn(page));
-                return 0;
-            }
-            else if ( (x & PGT_va_mask) == PGT_va_mutable )
+            if ( unlikely((x & (PGT_type_mask|PGT_va_mask)) != type) )
             {
-                /* The va backpointer is mutable, hence we update it. */
-                nx &= ~PGT_va_mask;
-                nx |= type; /* we know the actual type is correct */
+                if ( unlikely((x & PGT_type_mask) != (type & PGT_type_mask) ) )
+                {
+                    if ( ((x & PGT_type_mask) != PGT_l2_page_table) ||
+                         ((type & PGT_type_mask) != PGT_l1_page_table) )
+                        MEM_LOG("Bad type (saw %08x != exp %08x) for pfn %p",
+                                x, type, page_to_pfn(page));
+                    return 0;
+                }
+                else if ( (x & PGT_va_mask) == PGT_va_mutable )
+                {
+                    /* The va backpointer is mutable, hence we update it. */
+                    nx &= ~PGT_va_mask;
+                    nx |= type; /* we know the actual type is correct */
+                }
+                else if ( ((type & PGT_va_mask) != PGT_va_mutable) &&
+                          ((type & PGT_va_mask) != (x & PGT_va_mask)) )
+                {
+                    /* This table is potentially mapped at multiple locations. 
*/
+                    nx &= ~PGT_va_mask;
+                    nx |= PGT_va_unknown;
+                }
             }
-            else if ( ((type & PGT_va_mask) != PGT_va_mutable) &&
-                      ((type & PGT_va_mask) != (x & PGT_va_mask)) )
+            if ( unlikely(!(x & PGT_validated)) )
             {
-                /* This table is potentially mapped at multiple locations. */
-                nx &= ~PGT_va_mask;
-                nx |= PGT_va_unknown;
+                /* Someone else is updating validation of this page. Wait... */
+                while ( (y = page->u.inuse.type_info) == x )
+                    cpu_relax();
+                goto again;
             }
         }
     }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix bug with get_page_type where validating an L2/L3/L4 page which contained a self, BitKeeper Bot <=