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] [xen-unstable] [XEN][PAE] Handle non-page-aligned CR3 wh

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN][PAE] Handle non-page-aligned CR3 when walking
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 Jun 2006 15:40:49 +0000
Delivery-date: Mon, 19 Jun 2006 08:42:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 kfraser@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID a27f56a0ff43e9299a73b9979de68571ade25bf3
# Parent  f7eb907d9bcd15989a1899358ca8e26116e88b14
[XEN][PAE] Handle non-page-aligned CR3 when walking
page tables.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/traps.c        |    9 +++++++--
 xen/arch/x86/x86_32/traps.c |    7 +++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff -r f7eb907d9bcd -r a27f56a0ff43 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Mon Jun 19 13:06:10 2006 +0100
+++ b/xen/arch/x86/traps.c      Mon Jun 19 14:03:04 2006 +0100
@@ -633,7 +633,7 @@ static int __spurious_page_fault(
 static int __spurious_page_fault(
     unsigned long addr, struct cpu_user_regs *regs)
 {
-    unsigned long mfn = read_cr3() >> PAGE_SHIFT;
+    unsigned long mfn, cr3 = read_cr3();
 #if CONFIG_PAGING_LEVELS >= 4
     l4_pgentry_t l4e, *l4t;
 #endif
@@ -658,6 +658,8 @@ static int __spurious_page_fault(
     if ( regs->error_code & PGERR_instr_fetch )
         disallowed_flags |= _PAGE_NX;
 
+    mfn = cr3 >> PAGE_SHIFT;
+
 #if CONFIG_PAGING_LEVELS >= 4
     l4t = map_domain_page(mfn);
     l4e = l4t[l4_table_offset(addr)];
@@ -669,7 +671,10 @@ static int __spurious_page_fault(
 #endif
 
 #if CONFIG_PAGING_LEVELS >= 3
-    l3t = map_domain_page(mfn);
+    l3t  = map_domain_page(mfn); 
+#ifdef CONFIG_X86_PAE
+    l3t += (cr3 & 0xFE0UL) >> 3;
+#endif
     l3e = l3t[l3_table_offset(addr)];
     mfn = l3e_get_pfn(l3e);
     unmap_domain_page(l3t);
diff -r f7eb907d9bcd -r a27f56a0ff43 xen/arch/x86/x86_32/traps.c
--- a/xen/arch/x86/x86_32/traps.c       Mon Jun 19 13:06:10 2006 +0100
+++ b/xen/arch/x86/x86_32/traps.c       Mon Jun 19 14:03:04 2006 +0100
@@ -72,7 +72,7 @@ void show_registers(struct cpu_user_regs
 
 void show_page_walk(unsigned long addr)
 {
-    unsigned long pfn, mfn = read_cr3() >> PAGE_SHIFT;
+    unsigned long pfn, mfn, cr3 = read_cr3();
 #ifdef CONFIG_X86_PAE
     l3_pgentry_t l3e, *l3t;
 #endif
@@ -81,8 +81,11 @@ void show_page_walk(unsigned long addr)
 
     printk("Pagetable walk from %08lx:\n", addr);
 
+    mfn = cr3 >> PAGE_SHIFT;
+
 #ifdef CONFIG_X86_PAE
-    l3t = map_domain_page(mfn);
+    l3t  = map_domain_page(mfn);
+    l3t += (cr3 & 0xFE0UL) >> 3;
     l3e = l3t[l3_table_offset(addr)];
     mfn = l3e_get_pfn(l3e);
     pfn = get_gpfn_from_mfn(mfn);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEN][PAE] Handle non-page-aligned CR3 when walking, Xen patchbot-unstable <=