Commit:     4150d3f549fe2355625017b2a6ff72aec98bcef0
Parent:     298a5df45d497e66064fda22ef0abf13766d3333
Author:     Andrew Morton <[EMAIL PROTECTED]>
AuthorDate: Tue Sep 11 15:24:10 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Sep 11 17:21:27 2007 -0700

    revert "highmem: catch illegal nesting"
        commit 656dad312fb41ed95ef08325e9df9bece3aacbbb
        Author: Ingo Molnar <[EMAIL PROTECTED]>
        Date:   Sat Feb 10 01:46:36 2007 -0800
        [PATCH] highmem: catch illegal nesting
        Catch illegally nested kmap_atomic()s even if the page that is mapped by
        the 'inner' instance is from lowmem.
        This avoids spuriously zapped kmap-atomic ptes and turns hard to find
        crashes into clear asserts at the bug site.
    Problem is, a get_zeroed_page(GFP_KERNEL) from interrupt context will 
    this check if non-irq code on this CPU holds a KM_USER0 mapping.  But that
    get_zeroed_page() will never be altering the kmap slot anyway due to the
    Cc: Christoph Lameter <[EMAIL PROTECTED]>
    Cc: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 arch/i386/mm/highmem.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/i386/mm/highmem.c b/arch/i386/mm/highmem.c
index ad8d86c..1c3bf95 100644
--- a/arch/i386/mm/highmem.c
+++ b/arch/i386/mm/highmem.c
@@ -34,17 +34,16 @@ void *kmap_atomic_prot(struct page *page, enum km_type 
type, pgprot_t prot)
        /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
-       idx = type + KM_TYPE_NR*smp_processor_id();
-       BUG_ON(!pte_none(*(kmap_pte-idx)));
        if (!PageHighMem(page))
                return page_address(page);
+       idx = type + KM_TYPE_NR*smp_processor_id();
        vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
+       BUG_ON(!pte_none(*(kmap_pte-idx)));
        set_pte(kmap_pte-idx, mk_pte(page, prot));
-       return (void*) vaddr;
+       return (void *)vaddr;
 void *kmap_atomic(struct page *page, enum km_type type)
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to