Skip to contentSkip to conversation

fix for recursive PTEs

PATCH New Christoph Egger 1 participant 1 message Oct 19, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix for recursive PTEs

Hi!

Fix Xen kernel to silence a message on recursive Page Table Entries for level >= 3.

Keir: Please also apply this to Xen 3.1.2 if it's not too late for this.

Signature · 12 lines
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy
xen/arch/x86/mm.c +20 -9
diff -r 2372f89c0447 xen/arch/x86/mm.c
@@ -1769,15 +1769,26 @@ int get_page_type(struct page_info *page
                     nx |= PGT_validated;
             }
         }
-        else if ( unlikely((x & (PGT_type_mask|PGT_pae_xen_l2)) != type) )
-        {
-            if ( ((x & PGT_type_mask) != PGT_l2_page_table) ||
-                 (type != PGT_l1_page_table) )
-                MEM_LOG("Bad type (saw %" PRtype_info
-                        " != exp %" PRtype_info ") "
-                        "for mfn %lx (pfn %lx)",
-                        x, type, page_to_mfn(page),
-                        get_gpfn_from_mfn(page_to_mfn(page)));
+        else if (unlikely((x & (PGT_type_mask|PGT_pae_xen_l2)) != type) )
+        {
+	    /*
+	     * if it's a recursive mapping failure here is expected.
+	     * Don't log it
+	     */
+	    if ((x & PGT_type_mask) == PGT_l2_page_table &&
+		type == PGT_l1_page_table)
+			return 0;
+	    if ((x & PGT_type_mask) == PGT_l3_page_table &&
+		type == PGT_l2_page_table)
+			return 0;
+	    if ((x & PGT_type_mask) == PGT_l4_page_table &&
+		type == PGT_l3_page_table)
+			return 0;
+            MEM_LOG("Bad type (saw %" PRtype_info
+                    " != exp %" PRtype_info ") "
+                    "for mfn %lx (pfn %lx)",
+                    x, type, page_to_mfn(page),
+                    get_gpfn_from_mfn(page_to_mfn(page)));
             return 0;
         }
         else if ( unlikely(!(x & PGT_validated)) )

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel