Skip to content

Commit

Permalink
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/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
  • Loading branch information
torvalds committed May 8, 2009
2 parents 825118d + e529992 commit d9d05fd
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 15 deletions.
10 changes: 6 additions & 4 deletions arch/x86/kernel/cpu/mcheck/mce_intel_64.c
Expand Up @@ -151,10 +151,11 @@ static void print_update(char *type, int *hdr, int num)
static void cmci_discover(int banks, int boot)
{
unsigned long *owned = (void *)&__get_cpu_var(mce_banks_owned);
unsigned long flags;
int hdr = 0;
int i;

spin_lock(&cmci_discover_lock);
spin_lock_irqsave(&cmci_discover_lock, flags);
for (i = 0; i < banks; i++) {
u64 val;

Expand Down Expand Up @@ -184,7 +185,7 @@ static void cmci_discover(int banks, int boot)
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)
printk(KERN_CONT "\n");
}
Expand All @@ -211,13 +212,14 @@ void cmci_recheck(void)
*/
void cmci_clear(void)
{
unsigned long flags;
int i;
int banks;
u64 val;

if (!cmci_supported(&banks))
return;
spin_lock(&cmci_discover_lock);
spin_lock_irqsave(&cmci_discover_lock, flags);
for (i = 0; i < banks; i++) {
if (!test_bit(i, __get_cpu_var(mce_banks_owned)))
continue;
Expand All @@ -227,7 +229,7 @@ void cmci_clear(void)
wrmsrl(MSR_IA32_MC0_CTL2 + i, val);
__clear_bit(i, __get_cpu_var(mce_banks_owned));
}
spin_unlock(&cmci_discover_lock);
spin_unlock_irqrestore(&cmci_discover_lock, flags);
}

/*
Expand Down
11 changes: 6 additions & 5 deletions arch/x86/kernel/e820.c
Expand Up @@ -1074,12 +1074,13 @@ u64 __init early_reserve_e820(u64 startt, u64 sizet, u64 align)
u64 addr;
u64 start;

start = startt;
while (size < sizet && (start + 1))
for (start = startt; ; start += size) {
start = find_e820_area_size(start, &size, align);

if (size < sizet)
return 0;
if (!(start + 1))
return 0;
if (size >= sizet)
break;
}

#ifdef CONFIG_X86_32
if (start >= MAXMEM)
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/kernel/machine_kexec_32.c
Expand Up @@ -194,7 +194,7 @@ void machine_kexec(struct kimage *image)
unsigned int preserve_context);

#ifdef CONFIG_KEXEC_JUMP
if (kexec_image->preserve_context)
if (image->preserve_context)
save_processor_state();
#endif

Expand Down Expand Up @@ -253,7 +253,7 @@ void machine_kexec(struct kimage *image)
image->preserve_context);

#ifdef CONFIG_KEXEC_JUMP
if (kexec_image->preserve_context)
if (image->preserve_context)
restore_processor_state();
#endif

Expand Down
4 changes: 2 additions & 2 deletions arch/x86/kernel/machine_kexec_64.c
Expand Up @@ -274,7 +274,7 @@ void machine_kexec(struct kimage *image)
int save_ftrace_enabled;

#ifdef CONFIG_KEXEC_JUMP
if (kexec_image->preserve_context)
if (image->preserve_context)
save_processor_state();
#endif

Expand Down Expand Up @@ -333,7 +333,7 @@ void machine_kexec(struct kimage *image)
image->preserve_context);

#ifdef CONFIG_KEXEC_JUMP
if (kexec_image->preserve_context)
if (image->preserve_context)
restore_processor_state();
#endif

Expand Down
18 changes: 17 additions & 1 deletion arch/x86/mm/init.c
Expand Up @@ -7,6 +7,7 @@
#include <asm/page.h>
#include <asm/page_types.h>
#include <asm/sections.h>
#include <asm/setup.h>
#include <asm/system.h>
#include <asm/tlbflush.h>

Expand Down Expand Up @@ -304,8 +305,23 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
#endif

#ifdef CONFIG_X86_64
if (!after_bootmem)
if (!after_bootmem && !start) {
pud_t *pud;
pmd_t *pmd;

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
__flush_tlb_all();

Expand Down
2 changes: 1 addition & 1 deletion arch/x86/mm/srat_32.c
Expand Up @@ -216,7 +216,7 @@ int __init get_memcfg_from_srat(void)

if (num_memory_chunks == 0) {
printk(KERN_WARNING
"could not finy any ACPI SRAT memory areas.\n");
"could not find any ACPI SRAT memory areas.\n");
goto out_fail;
}

Expand Down
1 change: 1 addition & 0 deletions arch/x86/mm/srat_64.c
Expand Up @@ -361,6 +361,7 @@ static void __init unparse_node(int node)
{
int i;
node_clear(node, nodes_parsed);
node_clear(node, cpu_nodes_parsed);
for (i = 0; i < MAX_LOCAL_APIC; i++) {
if (apicid_to_node[i] == node)
apicid_to_node[i] = NUMA_NO_NODE;
Expand Down
5 changes: 5 additions & 0 deletions arch/x86/xen/mmu.c
Expand Up @@ -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)));

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;
}
#endif /* CONFIG_X86_64 */
Expand Down

0 comments on commit d9d05fd

Please sign in to comment.