aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 16:27:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 16:27:05 -0400
commitb9d7ccf56be1ac77b71a284a1c0e6337f9a7aff0 (patch)
tree6440e1c679e097d0ea23bf879cd30983c5838419
parent9301975ec251bab1ad7cfcb84a688b26187e4e4a (diff)
parent3038edabf48f01421c621cb77a712b446d3a5d67 (diff)
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/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
-rw-r--r--arch/x86/kernel/acpi/sleep.c3
-rw-r--r--mm/vmalloc.c18
2 files changed, 19 insertions, 2 deletions
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 426e5d91b63a..c44cd6dbfa14 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -10,6 +10,7 @@
10#include <linux/dmi.h> 10#include <linux/dmi.h>
11#include <linux/cpumask.h> 11#include <linux/cpumask.h>
12#include <asm/segment.h> 12#include <asm/segment.h>
13#include <asm/desc.h>
13 14
14#include "realmode/wakeup.h" 15#include "realmode/wakeup.h"
15#include "sleep.h" 16#include "sleep.h"
@@ -98,6 +99,8 @@ int acpi_save_state_mem(void)
98 header->trampoline_segment = setup_trampoline() >> 4; 99 header->trampoline_segment = setup_trampoline() >> 4;
99#ifdef CONFIG_SMP 100#ifdef CONFIG_SMP
100 stack_start.sp = temp_stack + 4096; 101 stack_start.sp = temp_stack + 4096;
102 early_gdt_descr.address =
103 (unsigned long)get_cpu_gdt_table(smp_processor_id());
101#endif 104#endif
102 initial_code = (unsigned long)wakeup_long64; 105 initial_code = (unsigned long)wakeup_long64;
103 saved_magic = 0x123456789abcdef0; 106 saved_magic = 0x123456789abcdef0;
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 712ae47af0bf..0797589d51f8 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -175,6 +175,21 @@ static int vmap_page_range(unsigned long addr, unsigned long end,
175 return nr; 175 return nr;
176} 176}
177 177
178static inline int is_vmalloc_or_module_addr(const void *x)
179{
180 /*
181 * x86-64 and sparc64 put modules in a special place,
182 * and fall back on vmalloc() if that fails. Others
183 * just put it in the vmalloc space.
184 */
185#if defined(CONFIG_MODULES) && defined(MODULES_VADDR)
186 unsigned long addr = (unsigned long)x;
187 if (addr >= MODULES_VADDR && addr < MODULES_END)
188 return 1;
189#endif
190 return is_vmalloc_addr(x);
191}
192
178/* 193/*
179 * Walk a vmap address to the struct page it maps. 194 * Walk a vmap address to the struct page it maps.
180 */ 195 */
@@ -188,8 +203,7 @@ struct page *vmalloc_to_page(const void *vmalloc_addr)
188 * XXX we might need to change this if we add VIRTUAL_BUG_ON for 203 * XXX we might need to change this if we add VIRTUAL_BUG_ON for
189 * architectures that do not vmalloc module space 204 * architectures that do not vmalloc module space
190 */ 205 */
191 VIRTUAL_BUG_ON(!is_vmalloc_addr(vmalloc_addr) && 206 VIRTUAL_BUG_ON(!is_vmalloc_or_module_addr(vmalloc_addr));
192 !is_module_address(addr));
193 207
194 if (!pgd_none(*pgd)) { 208 if (!pgd_none(*pgd)) {
195 pud_t *pud = pud_offset(pgd, addr); 209 pud_t *pud = pud_offset(pgd, addr);