From: "Jan Beulich" <jbeulich@novell.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] linux/i386: enhance dump_fault_path() in the highpte case
Date: Tue, 16 Jan 2007 12:59:42 +0000 [thread overview]
Message-ID: <45ACDA4E.76E4.0078.0@novell.com> (raw)
As long as the pte page isn't really located in highmem, there is no reason to
not access it, in order to print the complete page table hierarchy.
A functionally similar patch will go to lkml for native Linux.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: sle10-sp1-2007-01-12/arch/i386/mm/fault-xen.c
===================================================================
--- sle10-sp1-2007-01-12.orig/arch/i386/mm/fault-xen.c 2007-01-12 09:38:21.000000000 +0100
+++ sle10-sp1-2007-01-12/arch/i386/mm/fault-xen.c 2007-01-15 17:50:33.000000000 +0100
@@ -232,9 +232,12 @@ static void dump_fault_path(unsigned lon
p += (address >> 21) * 2;
printk(KERN_ALERT "%08lx -> *pme = %08lx:%08lx\n",
page, p[1], p[0]);
-#ifndef CONFIG_HIGHPTE
+ mfn = (p[0] >> PAGE_SHIFT) | (p[1] << 20);
+#ifdef CONFIG_HIGHPTE
+ if (mfn_to_pfn(mfn) >= highstart_pfn)
+ return;
+#endif
if (p[0] & 1) {
- mfn = (p[0] >> PAGE_SHIFT) | (p[1] << 20);
page = mfn_to_pfn(mfn) << PAGE_SHIFT;
p = (unsigned long *) __va(page);
address &= 0x001fffff;
@@ -242,7 +245,6 @@ static void dump_fault_path(unsigned lon
printk(KERN_ALERT "%08lx -> *pte = %08lx:%08lx\n",
page, p[1], p[0]);
}
-#endif
}
}
#else
@@ -254,13 +256,16 @@ static void dump_fault_path(unsigned lon
page = ((unsigned long *) __va(page))[address >> 22];
printk(KERN_ALERT "*pde = ma %08lx pa %08lx\n", page,
machine_to_phys(page));
+#ifdef CONFIG_HIGHPTE
/*
* We must not directly access the pte in the highpte
- * case, the page table might be allocated in highmem.
+ * case if the page table is located in highmem.
* And lets rather not kmap-atomic the pte, just in case
* it's allocated already.
*/
-#ifndef CONFIG_HIGHPTE
+ if ((page >> PAGE_SHIFT) >= highstart_pfn)
+ return;
+#endif
if (page & 1) {
page &= PAGE_MASK;
address &= 0x003ff000;
@@ -269,7 +274,6 @@ static void dump_fault_path(unsigned lon
printk(KERN_ALERT "*pte = ma %08lx pa %08lx\n", page,
machine_to_phys(page));
}
-#endif
}
#endif
reply other threads:[~2007-01-16 12:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45ACDA4E.76E4.0078.0@novell.com \
--to=jbeulich@novell.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.