diff options
author | Yinghai Lu <yinghai@kernel.org> | 2009-06-12 04:36:52 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@cs.helsinki.fi> | 2009-06-12 06:50:24 -0400 |
commit | 55cd63676e0c5710fbe1ea86dfd9f8ea9aaa90f2 (patch) | |
tree | 1154bbd5e720ce4300c0cf11dd168b665b802878 /arch/x86 | |
parent | 28be225b23b115573e0ecc8ef9996f42a1652f74 (diff) |
x86: make zap_low_mapping could be used early
Only one cpu is there, just call __flush_tlb for it. Fixes the following boot
warning on x86:
[ 0.000000] Memory: 885032k/915540k available (5993k kernel code, 29844k reserved, 3842k data, 428k init, 0k highmem)
[ 0.000000] virtual kernel memory layout:
[ 0.000000] fixmap : 0xffe17000 - 0xfffff000 (1952 kB)
[ 0.000000] vmalloc : 0xf8615000 - 0xffe15000 ( 120 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xf7e15000 ( 894 MB)
[ 0.000000] .init : 0xc19a5000 - 0xc1a10000 ( 428 kB)
[ 0.000000] .data : 0xc15da4bb - 0xc199af6c (3842 kB)
[ 0.000000] .text : 0xc1000000 - 0xc15da4bb (5993 kB)
[ 0.000000] Checking if this processor honours the WP bit even in supervisor mode...Ok.
[ 0.000000] ------------[ cut here ]------------
[ 0.000000] WARNING: at kernel/smp.c:369 smp_call_function_many+0x50/0x1b0()
[ 0.000000] Hardware name: System Product Name
[ 0.000000] Modules linked in:
[ 0.000000] Pid: 0, comm: swapper Not tainted 2.6.30-tip #52504
[ 0.000000] Call Trace:
[ 0.000000] [<c104aa16>] warn_slowpath_common+0x65/0x95
[ 0.000000] [<c104aa58>] warn_slowpath_null+0x12/0x15
[ 0.000000] [<c1073bbe>] smp_call_function_many+0x50/0x1b0
[ 0.000000] [<c1037615>] ? do_flush_tlb_all+0x0/0x41
[ 0.000000] [<c1037615>] ? do_flush_tlb_all+0x0/0x41
[ 0.000000] [<c1073d4f>] smp_call_function+0x31/0x58
[ 0.000000] [<c1037615>] ? do_flush_tlb_all+0x0/0x41
[ 0.000000] [<c104f635>] on_each_cpu+0x26/0x65
[ 0.000000] [<c10374b5>] flush_tlb_all+0x19/0x1b
[ 0.000000] [<c1032ab3>] zap_low_mappings+0x4d/0x56
[ 0.000000] [<c15d64b5>] ? printk+0x14/0x17
[ 0.000000] [<c19b42a8>] mem_init+0x23d/0x245
[ 0.000000] [<c19a56a1>] start_kernel+0x17a/0x2d5
[ 0.000000] [<c19a5347>] ? unknown_bootoption+0x0/0x19a
[ 0.000000] [<c19a5039>] __init_begin+0x39/0x41
[ 0.000000] ---[ end trace 4eaa2a86a8e2da22 ]---
Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/tlbflush.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/init_32.c | 10 |
3 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h index a5ecc9c33e92..7f3eba08e7de 100644 --- a/arch/x86/include/asm/tlbflush.h +++ b/arch/x86/include/asm/tlbflush.h | |||
@@ -172,6 +172,6 @@ static inline void flush_tlb_kernel_range(unsigned long start, | |||
172 | flush_tlb_all(); | 172 | flush_tlb_all(); |
173 | } | 173 | } |
174 | 174 | ||
175 | extern void zap_low_mappings(void); | 175 | extern void zap_low_mappings(bool early); |
176 | 176 | ||
177 | #endif /* _ASM_X86_TLBFLUSH_H */ | 177 | #endif /* _ASM_X86_TLBFLUSH_H */ |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 7c80007ea5f7..2fecda69ee64 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -873,7 +873,7 @@ int __cpuinit native_cpu_up(unsigned int cpu) | |||
873 | 873 | ||
874 | err = do_boot_cpu(apicid, cpu); | 874 | err = do_boot_cpu(apicid, cpu); |
875 | 875 | ||
876 | zap_low_mappings(); | 876 | zap_low_mappings(false); |
877 | low_mappings = 0; | 877 | low_mappings = 0; |
878 | #else | 878 | #else |
879 | err = do_boot_cpu(apicid, cpu); | 879 | err = do_boot_cpu(apicid, cpu); |
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 949708d7a481..9ff3c0816d15 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -564,7 +564,7 @@ static inline void save_pg_dir(void) | |||
564 | } | 564 | } |
565 | #endif /* !CONFIG_ACPI_SLEEP */ | 565 | #endif /* !CONFIG_ACPI_SLEEP */ |
566 | 566 | ||
567 | void zap_low_mappings(void) | 567 | void zap_low_mappings(bool early) |
568 | { | 568 | { |
569 | int i; | 569 | int i; |
570 | 570 | ||
@@ -581,7 +581,11 @@ void zap_low_mappings(void) | |||
581 | set_pgd(swapper_pg_dir+i, __pgd(0)); | 581 | set_pgd(swapper_pg_dir+i, __pgd(0)); |
582 | #endif | 582 | #endif |
583 | } | 583 | } |
584 | flush_tlb_all(); | 584 | |
585 | if (early) | ||
586 | __flush_tlb(); | ||
587 | else | ||
588 | flush_tlb_all(); | ||
585 | } | 589 | } |
586 | 590 | ||
587 | pteval_t __supported_pte_mask __read_mostly = ~(_PAGE_NX | _PAGE_GLOBAL | _PAGE_IOMAP); | 591 | pteval_t __supported_pte_mask __read_mostly = ~(_PAGE_NX | _PAGE_GLOBAL | _PAGE_IOMAP); |
@@ -956,7 +960,7 @@ void __init mem_init(void) | |||
956 | test_wp_bit(); | 960 | test_wp_bit(); |
957 | 961 | ||
958 | save_pg_dir(); | 962 | save_pg_dir(); |
959 | zap_low_mappings(); | 963 | zap_low_mappings(true); |
960 | } | 964 | } |
961 | 965 | ||
962 | #ifdef CONFIG_MEMORY_HOTPLUG | 966 | #ifdef CONFIG_MEMORY_HOTPLUG |