* Ingo Molnar <mingo@elte.hu> wrote:i.e. something like the (tested) patch below. It is not clear whether your testcase is on 32-bit or 64-bit - so i went for the more likely 32-bit case first. Ingo ------------------> Subject: x86: patches/x86-debug-bad-page.patch From: Ingo Molnar <mingo@elte.hu> Date: Mon Mar 03 09:53:17 CET 2008 Signed-off-by: Ingo Molnar <mingo@elte.hu> --- arch/x86/mm/pgtable_32.c | 7 +++++++ include/asm-x86/pgtable_32.h | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) Index: linux-x86.q/arch/x86/mm/pgtable_32.c =================================================================== --- linux-x86.q.orig/arch/x86/mm/pgtable_32.c +++ linux-x86.q/arch/x86/mm/pgtable_32.c @@ -381,3 +381,10 @@ void __pmd_free_tlb(struct mmu_gather *t } #endif + +int pmd_bad(pmd_t pmd) +{ + WARN_ON_ONCE(pmd_bad_v1(pmd) != pmd_bad_v2(pmd)); + + return pmd_bad_v1(pmd); +} Index: linux-x86.q/include/asm-x86/pgtable_32.h =================================================================== --- linux-x86.q.orig/include/asm-x86/pgtable_32.h +++ linux-x86.q/include/asm-x86/pgtable_32.h @@ -92,7 +92,11 @@ extern unsigned long pg0[]; /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */ #define pmd_none(x) (!(unsigned long)pmd_val(x)) #define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) -#define pmd_bad(x) ((pmd_val(x) \ + +extern int pmd_bad(pmd_t pmd); + +#define pmd_bad_v1(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) +#define pmd_bad_v2(x) ((pmd_val(x) \ & ~(PAGE_MASK | _PAGE_USER | _PAGE_PSE | _PAGE_NX)) \ != _KERNPG_TABLE) --
| Ingo Molnar | Re: [PATCH 6/6] sched: disabled rt-bandwidth by default |
| Maciej W. Rozycki | [PATCH 2/2] acpi: Disable IRQ 0 through I/O APIC for some HP systems |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Ryan Hope | reiser4 for 2.6.27-rc1 |
git: | |
| Johannes Schindelin | Re: [PATCH] use natural ordering to display list of branches. |
| David Kastrup | Terminology question about remote branches. |
| David Kastrup | Re: If you would write git from scratch now, what would you change? |
| Johannes Schindelin | [PATCH 1/2] clone: Add an option to set up a mirror |
| Martin Toft | Mysterious transfer speed differences |
| Joachim Schipper | Re: OpenBSD/alpha Status |
| Richard Daemon | OpenBSD 4.3 running in VirtualBox? Anyone have it working properly? |
| Diana Eichert | Re: In Memoriam: Jun-ichiro Hagino |
| binto | Before & After Under The Giant Lock |
| Florent Thoumie | Re: New wpi driver |
| Peter Jeremy | Re: repeatedly opening the same .so(s) is slow? |
| Dirk Engling | Re: Strange keyboard (viral?) behaviour |
