Commit d9d05fda authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'x86-fixes-for-linus' of...

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: MCE: make cmci_discover_lock irq-safe
  x86: xen, i386: reserve Xen pagetables
  x86, kexec: fix crashdump panic with CONFIG_KEXEC_JUMP
  x86-64: finish cleanup_highmaps()'s job wrt. _brk_end
  x86: fix boot hang in early_reserve_e820()
  x86: Fix a typo in a printk message
  x86, srat: do not register nodes beyond e820 map
parents 825118d1 e5299926
...@@ -151,10 +151,11 @@ static void print_update(char *type, int *hdr, int num) ...@@ -151,10 +151,11 @@ static void print_update(char *type, int *hdr, int num)
static void cmci_discover(int banks, int boot) static void cmci_discover(int banks, int boot)
{ {
unsigned long *owned = (void *)&__get_cpu_var(mce_banks_owned); unsigned long *owned = (void *)&__get_cpu_var(mce_banks_owned);
unsigned long flags;
int hdr = 0; int hdr = 0;
int i; int i;
spin_lock(&cmci_discover_lock); spin_lock_irqsave(&cmci_discover_lock, flags);
for (i = 0; i < banks; i++) { for (i = 0; i < banks; i++) {
u64 val; u64 val;
...@@ -184,7 +185,7 @@ static void cmci_discover(int banks, int boot) ...@@ -184,7 +185,7 @@ static void cmci_discover(int banks, int boot)
WARN_ON(!test_bit(i, __get_cpu_var(mce_poll_banks))); WARN_ON(!test_bit(i, __get_cpu_var(mce_poll_banks)));
} }
} }
spin_unlock(&cmci_discover_lock); spin_unlock_irqrestore(&cmci_discover_lock, flags);
if (hdr) if (hdr)
printk(KERN_CONT "\n"); printk(KERN_CONT "\n");
} }
...@@ -211,13 +212,14 @@ void cmci_recheck(void) ...@@ -211,13 +212,14 @@ void cmci_recheck(void)
*/ */
void cmci_clear(void) void cmci_clear(void)
{ {
unsigned long flags;
int i; int i;
int banks; int banks;
u64 val; u64 val;
if (!cmci_supported(&banks)) if (!cmci_supported(&banks))
return; return;
spin_lock(&cmci_discover_lock); spin_lock_irqsave(&cmci_discover_lock, flags);
for (i = 0; i < banks; i++) { for (i = 0; i < banks; i++) {
if (!test_bit(i, __get_cpu_var(mce_banks_owned))) if (!test_bit(i, __get_cpu_var(mce_banks_owned)))
continue; continue;
...@@ -227,7 +229,7 @@ void cmci_clear(void) ...@@ -227,7 +229,7 @@ void cmci_clear(void)
wrmsrl(MSR_IA32_MC0_CTL2 + i, val); wrmsrl(MSR_IA32_MC0_CTL2 + i, val);
__clear_bit(i, __get_cpu_var(mce_banks_owned)); __clear_bit(i, __get_cpu_var(mce_banks_owned));
} }
spin_unlock(&cmci_discover_lock); spin_unlock_irqrestore(&cmci_discover_lock, flags);
} }
/* /*
......
...@@ -1074,12 +1074,13 @@ u64 __init early_reserve_e820(u64 startt, u64 sizet, u64 align) ...@@ -1074,12 +1074,13 @@ u64 __init early_reserve_e820(u64 startt, u64 sizet, u64 align)
u64 addr; u64 addr;
u64 start; u64 start;
start = startt; for (start = startt; ; start += size) {
while (size < sizet && (start + 1))
start = find_e820_area_size(start, &size, align); start = find_e820_area_size(start, &size, align);
if (!(start + 1))
if (size < sizet) return 0;
return 0; if (size >= sizet)
break;
}
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
if (start >= MAXMEM) if (start >= MAXMEM)
......
...@@ -194,7 +194,7 @@ void machine_kexec(struct kimage *image) ...@@ -194,7 +194,7 @@ void machine_kexec(struct kimage *image)
unsigned int preserve_context); unsigned int preserve_context);
#ifdef CONFIG_KEXEC_JUMP #ifdef CONFIG_KEXEC_JUMP
if (kexec_image->preserve_context) if (image->preserve_context)
save_processor_state(); save_processor_state();
#endif #endif
...@@ -253,7 +253,7 @@ void machine_kexec(struct kimage *image) ...@@ -253,7 +253,7 @@ void machine_kexec(struct kimage *image)
image->preserve_context); image->preserve_context);
#ifdef CONFIG_KEXEC_JUMP #ifdef CONFIG_KEXEC_JUMP
if (kexec_image->preserve_context) if (image->preserve_context)
restore_processor_state(); restore_processor_state();
#endif #endif
......
...@@ -274,7 +274,7 @@ void machine_kexec(struct kimage *image) ...@@ -274,7 +274,7 @@ void machine_kexec(struct kimage *image)
int save_ftrace_enabled; int save_ftrace_enabled;
#ifdef CONFIG_KEXEC_JUMP #ifdef CONFIG_KEXEC_JUMP
if (kexec_image->preserve_context) if (image->preserve_context)
save_processor_state(); save_processor_state();
#endif #endif
...@@ -333,7 +333,7 @@ void machine_kexec(struct kimage *image) ...@@ -333,7 +333,7 @@ void machine_kexec(struct kimage *image)
image->preserve_context); image->preserve_context);
#ifdef CONFIG_KEXEC_JUMP #ifdef CONFIG_KEXEC_JUMP
if (kexec_image->preserve_context) if (image->preserve_context)
restore_processor_state(); restore_processor_state();
#endif #endif
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <asm/page.h> #include <asm/page.h>
#include <asm/page_types.h> #include <asm/page_types.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/setup.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
...@@ -304,8 +305,23 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, ...@@ -304,8 +305,23 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
#endif #endif
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
if (!after_bootmem) if (!after_bootmem && !start) {
pud_t *pud;
pmd_t *pmd;
mmu_cr4_features = read_cr4(); mmu_cr4_features = read_cr4();
/*
* _brk_end cannot change anymore, but it and _end may be
* located on different 2M pages. cleanup_highmap(), however,
* can only consider _end when it runs, so destroy any
* mappings beyond _brk_end here.
*/
pud = pud_offset(pgd_offset_k(_brk_end), _brk_end);
pmd = pmd_offset(pud, _brk_end - 1);
while (++pmd <= pmd_offset(pud, (unsigned long)_end - 1))
pmd_clear(pmd);
}
#endif #endif
__flush_tlb_all(); __flush_tlb_all();
......
...@@ -216,7 +216,7 @@ int __init get_memcfg_from_srat(void) ...@@ -216,7 +216,7 @@ int __init get_memcfg_from_srat(void)
if (num_memory_chunks == 0) { if (num_memory_chunks == 0) {
printk(KERN_WARNING printk(KERN_WARNING
"could not finy any ACPI SRAT memory areas.\n"); "could not find any ACPI SRAT memory areas.\n");
goto out_fail; goto out_fail;
} }
......
...@@ -361,6 +361,7 @@ static void __init unparse_node(int node) ...@@ -361,6 +361,7 @@ static void __init unparse_node(int node)
{ {
int i; int i;
node_clear(node, nodes_parsed); node_clear(node, nodes_parsed);
node_clear(node, cpu_nodes_parsed);
for (i = 0; i < MAX_LOCAL_APIC; i++) { for (i = 0; i < MAX_LOCAL_APIC; i++) {
if (apicid_to_node[i] == node) if (apicid_to_node[i] == node)
apicid_to_node[i] = NUMA_NO_NODE; apicid_to_node[i] = NUMA_NO_NODE;
......
...@@ -1794,6 +1794,11 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, ...@@ -1794,6 +1794,11 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(swapper_pg_dir))); pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(swapper_pg_dir)));
reserve_early(__pa(xen_start_info->pt_base),
__pa(xen_start_info->pt_base +
xen_start_info->nr_pt_frames * PAGE_SIZE),
"XEN PAGETABLES");
return swapper_pg_dir; return swapper_pg_dir;
} }
#endif /* CONFIG_X86_64 */ #endif /* CONFIG_X86_64 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment