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

[Xen-devel] [PATCH] linux/x86-64: kern_addr_valid() must not walk page t

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux/x86-64: kern_addr_valid() must not walk page tables mapping hypervisor space
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Mon, 12 Apr 2010 14:56:42 +0100
Delivery-date: Mon, 12 Apr 2010 06:57:51 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- a/arch/x86_64/mm/init-xen.c
+++ b/arch/x86_64/mm/init-xen.c
@@ -1160,6 +1160,19 @@ int kern_addr_valid(unsigned long addr)
        if (above != 0 && above != -1UL)
                return 0; 
        
+#ifdef CONFIG_XEN
+       /*
+        * Don't walk page tables for hypervisor addresses, but allow
+        * the M2P table to be accessed through e.g. /proc/kcore.
+        */
+       if (addr >= (unsigned long)machine_to_phys_mapping &&
+           addr < (unsigned long)(machine_to_phys_mapping +
+                                  (1UL << machine_to_phys_order)))
+               return 1;
+       if (addr >= HYPERVISOR_VIRT_START && addr < HYPERVISOR_VIRT_END)
+               return 0;
+#endif
+
        pgd = pgd_offset_k(addr);
        if (pgd_none(*pgd))
                return 0;



Attachment: xen-x86_64-kern_addr_valid.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux/x86-64: kern_addr_valid() must not walk page tables mapping hypervisor space, Jan Beulich <=