Commit 605f3750 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, amd-ucode: Check UCODE_MAGIC before loading the container file
  x86: Fix error return sequence in __ioremap_caller()
  x86: Add Phoenix/MSC BIOSes to lowmem corruption list
parents 16fe4101 506f90ee
...@@ -317,6 +317,12 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device) ...@@ -317,6 +317,12 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device)
return UCODE_NFOUND; return UCODE_NFOUND;
} }
if (*(u32 *)firmware->data != UCODE_MAGIC) {
printk(KERN_ERR "microcode: invalid UCODE_MAGIC (0x%08x)\n",
*(u32 *)firmware->data);
return UCODE_ERROR;
}
ret = generic_load_microcode(cpu, firmware->data, firmware->size); ret = generic_load_microcode(cpu, firmware->data, firmware->size);
release_firmware(firmware); release_firmware(firmware);
......
...@@ -659,6 +659,13 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = { ...@@ -659,6 +659,13 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"), DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"),
}, },
}, },
{
.callback = dmi_low_memory_corruption,
.ident = "Phoenix/MSC BIOS",
.matches = {
DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix/MSC"),
},
},
{ {
/* /*
* AMI BIOS with low memory corruption was found on Intel DG45ID board. * AMI BIOS with low memory corruption was found on Intel DG45ID board.
......
...@@ -170,8 +170,7 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, ...@@ -170,8 +170,7 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,
(unsigned long long)phys_addr, (unsigned long long)phys_addr,
(unsigned long long)(phys_addr + size), (unsigned long long)(phys_addr + size),
prot_val, new_prot_val); prot_val, new_prot_val);
free_memtype(phys_addr, phys_addr + size); goto err_free_memtype;
return NULL;
} }
prot_val = new_prot_val; prot_val = new_prot_val;
} }
...@@ -197,26 +196,25 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, ...@@ -197,26 +196,25 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,
*/ */
area = get_vm_area_caller(size, VM_IOREMAP, caller); area = get_vm_area_caller(size, VM_IOREMAP, caller);
if (!area) if (!area)
return NULL; goto err_free_memtype;
area->phys_addr = phys_addr; area->phys_addr = phys_addr;
vaddr = (unsigned long) area->addr; vaddr = (unsigned long) area->addr;
if (kernel_map_sync_memtype(phys_addr, size, prot_val)) { if (kernel_map_sync_memtype(phys_addr, size, prot_val))
free_memtype(phys_addr, phys_addr + size); goto err_free_area;
free_vm_area(area);
return NULL;
}
if (ioremap_page_range(vaddr, vaddr + size, phys_addr, prot)) { if (ioremap_page_range(vaddr, vaddr + size, phys_addr, prot))
free_memtype(phys_addr, phys_addr + size); goto err_free_area;
free_vm_area(area);
return NULL;
}
ret_addr = (void __iomem *) (vaddr + offset); ret_addr = (void __iomem *) (vaddr + offset);
mmiotrace_ioremap(unaligned_phys_addr, unaligned_size, ret_addr); mmiotrace_ioremap(unaligned_phys_addr, unaligned_size, ret_addr);
return ret_addr; return ret_addr;
err_free_area:
free_vm_area(area);
err_free_memtype:
free_memtype(phys_addr, phys_addr + size);
return NULL;
} }
/** /**
......
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