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: force _PAGE_NX on the 1:1 mapping (mat

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux/x86-64: force _PAGE_NX on the 1:1 mapping (matching native)
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Tue, 15 May 2007 14:29:53 +0200
Delivery-date: Tue, 15 May 2007 05:27:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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>

Index: head-2007-04-27/arch/x86_64/mm/init-xen.c
===================================================================
--- head-2007-04-27.orig/arch/x86_64/mm/init-xen.c      2007-05-10 
13:23:24.000000000 +0200
+++ head-2007-04-27/arch/x86_64/mm/init-xen.c   2007-05-10 13:24:27.000000000 
+0200
@@ -479,18 +479,15 @@ phys_pmd_init(pmd_t *pmd_page, unsigned 
                pte = alloc_static_page(&pte_phys);
                pte_save = pte;
                for (k = 0; k < PTRS_PER_PTE; pte++, k++, address += PTE_SIZE) {
+                       unsigned long pteval = address | _PAGE_NX | 
_KERNPG_TABLE;
+
                        if ((address >= end) ||
                            ((address >> PAGE_SHIFT) >=
-                            xen_start_info->nr_pages)) { 
-                               __set_pte(pte, __pte(0)); 
-                               continue;
-                       }
-                       if (make_readonly(address)) {
-                               __set_pte(pte, 
-                                         __pte(address | (_KERNPG_TABLE & 
~_PAGE_RW)));
-                               continue;
-                       }
-                       __set_pte(pte, __pte(address | _KERNPG_TABLE));
+                            xen_start_info->nr_pages))
+                               pteval = 0;
+                       else if (make_readonly(address))
+                               pteval &= ~_PAGE_RW;
+                       __set_pte(pte, __pte(pteval & __supported_pte_mask));
                }
                pte = pte_save;
                early_make_page_readonly(pte, XENFEAT_writable_page_tables);




_______________________________________________
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: force _PAGE_NX on the 1:1 mapping (matching native), Jan Beulich <=