aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-02 19:29:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-02 19:29:05 -0400
commit1982269a5c51c70cddceb8d157f07b522aee0a2d (patch)
treecfa5d233a527b15324f6d2756d8fe275aa17f5d1 /arch
parentfdd78889aad2ec85b2f5a8ed232215dca7a22a3b (diff)
parent4f4319a02a6108be3e65b9d44d1b7f5e8f520535 (diff)
Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 mm changes from Ingo Molnar: "Misc improvements: - Fix /proc/mtrr reporting - Fix ioremap printout - Remove the unused pvclock fixmap entry on 32-bit - misc cleanups" * 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/ioremap: Correct function name output x86: Fix /proc/mtrr with base/size more than 44bits ix86: Don't waste fixmap entries x86/mm: Drop unneeded include <asm/*pgtable, page*_types.h> x86_64: Correct phys_addr in cleanup_highmap comment
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/boot/compressed/head_64.S2
-rw-r--r--arch/x86/include/asm/fixmap.h2
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c21
-rw-r--r--arch/x86/kernel/cpu/mtrr/main.c16
-rw-r--r--arch/x86/mm/init_64.c2
-rw-r--r--arch/x86/mm/ioremap.c8
6 files changed, 26 insertions, 25 deletions
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index 16f24e6dad79..06e71c2c16bf 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -27,8 +27,6 @@
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/linkage.h> 28#include <linux/linkage.h>
29#include <asm/segment.h> 29#include <asm/segment.h>
30#include <asm/pgtable_types.h>
31#include <asm/page_types.h>
32#include <asm/boot.h> 30#include <asm/boot.h>
33#include <asm/msr.h> 31#include <asm/msr.h>
34#include <asm/processor-flags.h> 32#include <asm/processor-flags.h>
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h
index 0dc7d9e21c34..e846225265ed 100644
--- a/arch/x86/include/asm/fixmap.h
+++ b/arch/x86/include/asm/fixmap.h
@@ -81,11 +81,11 @@ enum fixed_addresses {
81 + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1, 81 + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1,
82 VVAR_PAGE, 82 VVAR_PAGE,
83 VSYSCALL_HPET, 83 VSYSCALL_HPET,
84#endif
85#ifdef CONFIG_PARAVIRT_CLOCK 84#ifdef CONFIG_PARAVIRT_CLOCK
86 PVCLOCK_FIXMAP_BEGIN, 85 PVCLOCK_FIXMAP_BEGIN,
87 PVCLOCK_FIXMAP_END = PVCLOCK_FIXMAP_BEGIN+PVCLOCK_VSYSCALL_NR_PAGES-1, 86 PVCLOCK_FIXMAP_END = PVCLOCK_FIXMAP_BEGIN+PVCLOCK_VSYSCALL_NR_PAGES-1,
88#endif 87#endif
88#endif
89 FIX_DBGP_BASE, 89 FIX_DBGP_BASE,
90 FIX_EARLYCON_MEM_BASE, 90 FIX_EARLYCON_MEM_BASE,
91#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT 91#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index 00f557b95b16..d4cdfa67509e 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -510,8 +510,9 @@ generic_get_free_region(unsigned long base, unsigned long size, int replace_reg)
510static void generic_get_mtrr(unsigned int reg, unsigned long *base, 510static void generic_get_mtrr(unsigned int reg, unsigned long *base,
511 unsigned long *size, mtrr_type *type) 511 unsigned long *size, mtrr_type *type)
512{ 512{
513 unsigned int mask_lo, mask_hi, base_lo, base_hi; 513 u32 mask_lo, mask_hi, base_lo, base_hi;
514 unsigned int tmp, hi; 514 unsigned int hi;
515 u64 tmp, mask;
515 516
516 /* 517 /*
517 * get_mtrr doesn't need to update mtrr_state, also it could be called 518 * get_mtrr doesn't need to update mtrr_state, also it could be called
@@ -532,18 +533,18 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
532 rdmsr(MTRRphysBase_MSR(reg), base_lo, base_hi); 533 rdmsr(MTRRphysBase_MSR(reg), base_lo, base_hi);
533 534
534 /* Work out the shifted address mask: */ 535 /* Work out the shifted address mask: */
535 tmp = mask_hi << (32 - PAGE_SHIFT) | mask_lo >> PAGE_SHIFT; 536 tmp = (u64)mask_hi << (32 - PAGE_SHIFT) | mask_lo >> PAGE_SHIFT;
536 mask_lo = size_or_mask | tmp; 537 mask = size_or_mask | tmp;
537 538
538 /* Expand tmp with high bits to all 1s: */ 539 /* Expand tmp with high bits to all 1s: */
539 hi = fls(tmp); 540 hi = fls64(tmp);
540 if (hi > 0) { 541 if (hi > 0) {
541 tmp |= ~((1<<(hi - 1)) - 1); 542 tmp |= ~((1ULL<<(hi - 1)) - 1);
542 543
543 if (tmp != mask_lo) { 544 if (tmp != mask) {
544 printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n"); 545 printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n");
545 add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK); 546 add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
546 mask_lo = tmp; 547 mask = tmp;
547 } 548 }
548 } 549 }
549 550
@@ -551,8 +552,8 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
551 * This works correctly if size is a power of two, i.e. a 552 * This works correctly if size is a power of two, i.e. a
552 * contiguous range: 553 * contiguous range:
553 */ 554 */
554 *size = -mask_lo; 555 *size = -mask;
555 *base = base_hi << (32 - PAGE_SHIFT) | base_lo >> PAGE_SHIFT; 556 *base = (u64)base_hi << (32 - PAGE_SHIFT) | base_lo >> PAGE_SHIFT;
556 *type = base_lo & 0xff; 557 *type = base_lo & 0xff;
557 558
558out_put_cpu: 559out_put_cpu:
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index 726bf963c227..ca22b73aaa25 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -305,7 +305,8 @@ int mtrr_add_page(unsigned long base, unsigned long size,
305 return -EINVAL; 305 return -EINVAL;
306 } 306 }
307 307
308 if (base & size_or_mask || size & size_or_mask) { 308 if ((base | (base + size - 1)) >>
309 (boot_cpu_data.x86_phys_bits - PAGE_SHIFT)) {
309 pr_warning("mtrr: base or size exceeds the MTRR width\n"); 310 pr_warning("mtrr: base or size exceeds the MTRR width\n");
310 return -EINVAL; 311 return -EINVAL;
311 } 312 }
@@ -583,6 +584,7 @@ static struct syscore_ops mtrr_syscore_ops = {
583 584
584int __initdata changed_by_mtrr_cleanup; 585int __initdata changed_by_mtrr_cleanup;
585 586
587#define SIZE_OR_MASK_BITS(n) (~((1ULL << ((n) - PAGE_SHIFT)) - 1))
586/** 588/**
587 * mtrr_bp_init - initialize mtrrs on the boot CPU 589 * mtrr_bp_init - initialize mtrrs on the boot CPU
588 * 590 *
@@ -600,7 +602,7 @@ void __init mtrr_bp_init(void)
600 602
601 if (cpu_has_mtrr) { 603 if (cpu_has_mtrr) {
602 mtrr_if = &generic_mtrr_ops; 604 mtrr_if = &generic_mtrr_ops;
603 size_or_mask = 0xff000000; /* 36 bits */ 605 size_or_mask = SIZE_OR_MASK_BITS(36);
604 size_and_mask = 0x00f00000; 606 size_and_mask = 0x00f00000;
605 phys_addr = 36; 607 phys_addr = 36;
606 608
@@ -619,7 +621,7 @@ void __init mtrr_bp_init(void)
619 boot_cpu_data.x86_mask == 0x4)) 621 boot_cpu_data.x86_mask == 0x4))
620 phys_addr = 36; 622 phys_addr = 36;
621 623
622 size_or_mask = ~((1ULL << (phys_addr - PAGE_SHIFT)) - 1); 624 size_or_mask = SIZE_OR_MASK_BITS(phys_addr);
623 size_and_mask = ~size_or_mask & 0xfffff00000ULL; 625 size_and_mask = ~size_or_mask & 0xfffff00000ULL;
624 } else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR && 626 } else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR &&
625 boot_cpu_data.x86 == 6) { 627 boot_cpu_data.x86 == 6) {
@@ -627,7 +629,7 @@ void __init mtrr_bp_init(void)
627 * VIA C* family have Intel style MTRRs, 629 * VIA C* family have Intel style MTRRs,
628 * but don't support PAE 630 * but don't support PAE
629 */ 631 */
630 size_or_mask = 0xfff00000; /* 32 bits */ 632 size_or_mask = SIZE_OR_MASK_BITS(32);
631 size_and_mask = 0; 633 size_and_mask = 0;
632 phys_addr = 32; 634 phys_addr = 32;
633 } 635 }
@@ -637,21 +639,21 @@ void __init mtrr_bp_init(void)
637 if (cpu_has_k6_mtrr) { 639 if (cpu_has_k6_mtrr) {
638 /* Pre-Athlon (K6) AMD CPU MTRRs */ 640 /* Pre-Athlon (K6) AMD CPU MTRRs */
639 mtrr_if = mtrr_ops[X86_VENDOR_AMD]; 641 mtrr_if = mtrr_ops[X86_VENDOR_AMD];
640 size_or_mask = 0xfff00000; /* 32 bits */ 642 size_or_mask = SIZE_OR_MASK_BITS(32);
641 size_and_mask = 0; 643 size_and_mask = 0;
642 } 644 }
643 break; 645 break;
644 case X86_VENDOR_CENTAUR: 646 case X86_VENDOR_CENTAUR:
645 if (cpu_has_centaur_mcr) { 647 if (cpu_has_centaur_mcr) {
646 mtrr_if = mtrr_ops[X86_VENDOR_CENTAUR]; 648 mtrr_if = mtrr_ops[X86_VENDOR_CENTAUR];
647 size_or_mask = 0xfff00000; /* 32 bits */ 649 size_or_mask = SIZE_OR_MASK_BITS(32);
648 size_and_mask = 0; 650 size_and_mask = 0;
649 } 651 }
650 break; 652 break;
651 case X86_VENDOR_CYRIX: 653 case X86_VENDOR_CYRIX:
652 if (cpu_has_cyrix_arr) { 654 if (cpu_has_cyrix_arr) {
653 mtrr_if = mtrr_ops[X86_VENDOR_CYRIX]; 655 mtrr_if = mtrr_ops[X86_VENDOR_CYRIX];
654 size_or_mask = 0xfff00000; /* 32 bits */ 656 size_or_mask = SIZE_OR_MASK_BITS(32);
655 size_and_mask = 0; 657 size_and_mask = 0;
656 } 658 }
657 break; 659 break;
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index bb00c4672ad6..b3940b6b4d7e 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -368,7 +368,7 @@ void __init init_extra_mapping_uc(unsigned long phys, unsigned long size)
368 * 368 *
369 * from __START_KERNEL_map to __START_KERNEL_map + size (== _end-_text) 369 * from __START_KERNEL_map to __START_KERNEL_map + size (== _end-_text)
370 * 370 *
371 * phys_addr holds the negative offset to the kernel, which is added 371 * phys_base holds the negative offset to the kernel, which is added
372 * to the compile time generated pmds. This results in invalid pmds up 372 * to the compile time generated pmds. This results in invalid pmds up
373 * to the point where we hit the physaddr 0 mapping. 373 * to the point where we hit the physaddr 0 mapping.
374 * 374 *
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 9a1e6583910c..0215e2c563ef 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -501,15 +501,15 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
501 } 501 }
502 502
503 if (slot < 0) { 503 if (slot < 0) {
504 printk(KERN_INFO "early_iomap(%08llx, %08lx) not found slot\n", 504 printk(KERN_INFO "%s(%08llx, %08lx) not found slot\n",
505 (u64)phys_addr, size); 505 __func__, (u64)phys_addr, size);
506 WARN_ON(1); 506 WARN_ON(1);
507 return NULL; 507 return NULL;
508 } 508 }
509 509
510 if (early_ioremap_debug) { 510 if (early_ioremap_debug) {
511 printk(KERN_INFO "early_ioremap(%08llx, %08lx) [%d] => ", 511 printk(KERN_INFO "%s(%08llx, %08lx) [%d] => ",
512 (u64)phys_addr, size, slot); 512 __func__, (u64)phys_addr, size, slot);
513 dump_stack(); 513 dump_stack();
514 } 514 }
515 515