aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-03-07 18:57:38 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-03-07 18:57:38 -0500
commit47b3bc907328db968bc9b43c41f48f8d1e140750 (patch)
tree00475e210f6b6c86554fad8a33a3baf7385bfbcc /arch
parentaf2841cdd4cb35248e41f7427d996c8f6b563051 (diff)
parentcc67708891319dbdc9f29c04154833a67d23212c (diff)
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Peter Anvin: "Several boot fixes (MacBook, legacy EFI bootloaders), another please-don't-brick fix, and some minor stuff." * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: Do not try to sync identity map for non-mapped pages x86, doc: Be explicit about what the x86 struct boot_params requires x86: Don't clear efi_info even if the sentinel hits x86, mm: Make sure to find a 2M free block for the first mapped area x86: Fix 32-bit *_cpu_data initializers efivarfs: return accurate error code in efivarfs_fill_super() efivars: efivarfs_valid_name() should handle pstore syntax efi: be more paranoid about available space when creating variables iommu, x86: Add DMA remap fault reason x86, smpboot: Remove unused variable
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/bootparam_utils.h20
-rw-r--r--arch/x86/kernel/setup.c10
-rw-r--r--arch/x86/kernel/smpboot.c3
-rw-r--r--arch/x86/mm/init.c5
-rw-r--r--arch/x86/mm/pat.c7
5 files changed, 36 insertions, 9 deletions
diff --git a/arch/x86/include/asm/bootparam_utils.h b/arch/x86/include/asm/bootparam_utils.h
index 5b5e9cb774b5..653668d140f9 100644
--- a/arch/x86/include/asm/bootparam_utils.h
+++ b/arch/x86/include/asm/bootparam_utils.h
@@ -14,13 +14,29 @@
14 * analysis of kexec-tools; if other broken bootloaders initialize a 14 * analysis of kexec-tools; if other broken bootloaders initialize a
15 * different set of fields we will need to figure out how to disambiguate. 15 * different set of fields we will need to figure out how to disambiguate.
16 * 16 *
17 * Note: efi_info is commonly left uninitialized, but that field has a
18 * private magic, so it is better to leave it unchanged.
17 */ 19 */
18static void sanitize_boot_params(struct boot_params *boot_params) 20static void sanitize_boot_params(struct boot_params *boot_params)
19{ 21{
22 /*
23 * IMPORTANT NOTE TO BOOTLOADER AUTHORS: do not simply clear
24 * this field. The purpose of this field is to guarantee
25 * compliance with the x86 boot spec located in
26 * Documentation/x86/boot.txt . That spec says that the
27 * *whole* structure should be cleared, after which only the
28 * portion defined by struct setup_header (boot_params->hdr)
29 * should be copied in.
30 *
31 * If you're having an issue because the sentinel is set, you
32 * need to change the whole structure to be cleared, not this
33 * (or any other) individual field, or you will soon have
34 * problems again.
35 */
20 if (boot_params->sentinel) { 36 if (boot_params->sentinel) {
21 /*fields in boot_params are not valid, clear them */ 37 /* fields in boot_params are left uninitialized, clear them */
22 memset(&boot_params->olpc_ofw_header, 0, 38 memset(&boot_params->olpc_ofw_header, 0,
23 (char *)&boot_params->alt_mem_k - 39 (char *)&boot_params->efi_info -
24 (char *)&boot_params->olpc_ofw_header); 40 (char *)&boot_params->olpc_ofw_header);
25 memset(&boot_params->kbd_status, 0, 41 memset(&boot_params->kbd_status, 0,
26 (char *)&boot_params->hdr - 42 (char *)&boot_params->hdr -
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 84d32855f65c..90d8cc930f5e 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -171,9 +171,15 @@ static struct resource bss_resource = {
171 171
172#ifdef CONFIG_X86_32 172#ifdef CONFIG_X86_32
173/* cpu data as detected by the assembly code in head.S */ 173/* cpu data as detected by the assembly code in head.S */
174struct cpuinfo_x86 new_cpu_data __cpuinitdata = {0, 0, 0, 0, -1, 1, 0, 0, -1}; 174struct cpuinfo_x86 new_cpu_data __cpuinitdata = {
175 .wp_works_ok = -1,
176 .fdiv_bug = -1,
177};
175/* common cpu data for all cpus */ 178/* common cpu data for all cpus */
176struct cpuinfo_x86 boot_cpu_data __read_mostly = {0, 0, 0, 0, -1, 1, 0, 0, -1}; 179struct cpuinfo_x86 boot_cpu_data __read_mostly = {
180 .wp_works_ok = -1,
181 .fdiv_bug = -1,
182};
177EXPORT_SYMBOL(boot_cpu_data); 183EXPORT_SYMBOL(boot_cpu_data);
178 184
179unsigned int def_to_bigsmp; 185unsigned int def_to_bigsmp;
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index a6ceaedc396a..9f190a2a00e9 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1365,9 +1365,8 @@ static inline void mwait_play_dead(void)
1365 unsigned int eax, ebx, ecx, edx; 1365 unsigned int eax, ebx, ecx, edx;
1366 unsigned int highest_cstate = 0; 1366 unsigned int highest_cstate = 0;
1367 unsigned int highest_subcstate = 0; 1367 unsigned int highest_subcstate = 0;
1368 int i;
1369 void *mwait_ptr; 1368 void *mwait_ptr;
1370 struct cpuinfo_x86 *c = __this_cpu_ptr(&cpu_info); 1369 int i;
1371 1370
1372 if (!this_cpu_has(X86_FEATURE_MWAIT)) 1371 if (!this_cpu_has(X86_FEATURE_MWAIT))
1373 return; 1372 return;
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 4903a03ae876..59b7fc453277 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -410,9 +410,8 @@ void __init init_mem_mapping(void)
410 /* the ISA range is always mapped regardless of memory holes */ 410 /* the ISA range is always mapped regardless of memory holes */
411 init_memory_mapping(0, ISA_END_ADDRESS); 411 init_memory_mapping(0, ISA_END_ADDRESS);
412 412
413 /* xen has big range in reserved near end of ram, skip it at first */ 413 /* xen has big range in reserved near end of ram, skip it at first.*/
414 addr = memblock_find_in_range(ISA_END_ADDRESS, end, PMD_SIZE, 414 addr = memblock_find_in_range(ISA_END_ADDRESS, end, PMD_SIZE, PMD_SIZE);
415 PAGE_SIZE);
416 real_end = addr + PMD_SIZE; 415 real_end = addr + PMD_SIZE;
417 416
418 /* step_size need to be small so pgt_buf from BRK could cover it */ 417 /* step_size need to be small so pgt_buf from BRK could cover it */
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index 2610bd93c896..657438858e83 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -563,6 +563,13 @@ int kernel_map_sync_memtype(u64 base, unsigned long size, unsigned long flags)
563 if (base > __pa(high_memory-1)) 563 if (base > __pa(high_memory-1))
564 return 0; 564 return 0;
565 565
566 /*
567 * some areas in the middle of the kernel identity range
568 * are not mapped, like the PCI space.
569 */
570 if (!page_is_ram(base >> PAGE_SHIFT))
571 return 0;
572
566 id_sz = (__pa(high_memory-1) <= base + size) ? 573 id_sz = (__pa(high_memory-1) <= base + size) ?
567 __pa(high_memory) - base : 574 __pa(high_memory) - base :
568 size; 575 size;