From: Linus Torvalds Date: Mon, 20 Oct 2008 20:27:05 +0000 (-0700) Subject: Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git... X-Git-Tag: v2.6.28-rc1~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9d7ccf56be1ac77b71a284a1c0e6337f9a7aff0;p=profile%2Fivi%2Fkernel-x86-ivi.git Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86 ACPI: fix breakage of resume on 64-bit UP systems with SMP kernel Introduce is_vmalloc_or_module_addr() and use with DEBUG_VIRTUAL --- b9d7ccf56be1ac77b71a284a1c0e6337f9a7aff0 diff --cc mm/vmalloc.c index 712ae47,f018d7e..0797589 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@@ -168,15 -163,28 +168,30 @@@ static int vmap_page_range(unsigned lon if (err) break; } while (pgd++, addr = next, addr != end); - flush_cache_vmap((unsigned long) area->addr, end); - return err; + flush_cache_vmap(addr, end); + + if (unlikely(err)) + return err; + return nr; } -EXPORT_SYMBOL_GPL(map_vm_area); + static inline int is_vmalloc_or_module_addr(const void *x) + { + /* + * x86-64 and sparc64 put modules in a special place, + * and fall back on vmalloc() if that fails. Others + * just put it in the vmalloc space. + */ + #if defined(CONFIG_MODULES) && defined(MODULES_VADDR) + unsigned long addr = (unsigned long)x; + if (addr >= MODULES_VADDR && addr < MODULES_END) + return 1; + #endif + return is_vmalloc_addr(x); + } + /* - * Map a vmalloc()-space virtual address to the physical page. + * Walk a vmap address to the struct page it maps. */ struct page *vmalloc_to_page(const void *vmalloc_addr) { @@@ -188,16 -199,13 +203,15 @@@ * XXX we might need to change this if we add VIRTUAL_BUG_ON for * architectures that do not vmalloc module space */ - VIRTUAL_BUG_ON(!is_vmalloc_addr(vmalloc_addr) && - !is_module_address(addr)); + VIRTUAL_BUG_ON(!is_vmalloc_or_module_addr(vmalloc_addr)); if (!pgd_none(*pgd)) { - pud = pud_offset(pgd, addr); + pud_t *pud = pud_offset(pgd, addr); if (!pud_none(*pud)) { - pmd = pmd_offset(pud, addr); + pmd_t *pmd = pmd_offset(pud, addr); if (!pmd_none(*pmd)) { + pte_t *ptep, pte; + ptep = pte_offset_map(pmd, addr); pte = *ptep; if (pte_present(pte))