Skip to contentSkip to conversation

x86/cleanups for v2.6.32

GIT PULL Ingo Molnar 1 participant 1 message Sep 11, 2009

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the x86-cleanups-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git x86-cleanups-for-linus

Thanks,

Ingo

------------------>
Alan Cox (1):
x86/cpu: Clean up various files a bit

Alexey Dobriyan (1):
x86: uv: Clean up uv_ptc_init(), use proc_create()

Cyrill Gorcunov (2):
x86: Clean up idt_descr and idt_tableby using NR_VECTORS instead of hardcoded number x86, ipi: Clean up safe_smp_processor_id() by using the cpu_has_apic() macro helper

Huang Weiyi (1):
x86: Remove duplicated #include

Ingo Molnar (1):
x86: Further clean up of mtrr/generic.c

Jaswinder Singh Rajput (10):
x86: ds.c fix invalid assignment
x86: Clean up mtrr/amd.c:
x86: Clean up mtrr/centaur.c
x86: Clean up mtrr/cleanup.c
x86: Clean up mtrr/cyrix.c
x86: Clean up mtrr/generic.c
x86: Clean up mtrr/if.c
x86: Clean up mtrr/mtrr.h
x86: Clean up mtrr/state.c
x86: Clean up mtrr/main.c

Marcin Slusarz (1):

      x86: Use printk_once()

Tobias Klauser (1):
x86: Make memtype_seq_ops const

 arch/x86/kernel/apic/ipi.c             |    2 +-
 arch/x86/kernel/cpu/amd.c              |   37 ++--
 arch/x86/kernel/cpu/bugs.c             |   10 +-
 arch/x86/kernel/cpu/bugs_64.c          |    2 +-
 arch/x86/kernel/cpu/common.c           |   10 +-
 arch/x86/kernel/cpu/cyrix.c            |   19 +-
 arch/x86/kernel/cpu/hypervisor.c       |    5 +-
 arch/x86/kernel/cpu/intel.c            |   11 +-
 arch/x86/kernel/cpu/intel_cacheinfo.c  |  116 +++++----
 arch/x86/kernel/cpu/mtrr/amd.c         |   97 ++++----
 arch/x86/kernel/cpu/mtrr/centaur.c     |  168 +++----------
 arch/x86/kernel/cpu/mtrr/cleanup.c     |  390 ++++++++++++++--------------
 arch/x86/kernel/cpu/mtrr/cyrix.c       |   94 ++++---
 arch/x86/kernel/cpu/mtrr/generic.c     |  304 ++++++++++++----------
 arch/x86/kernel/cpu/mtrr/if.c          |  135 ++++++----
 arch/x86/kernel/cpu/mtrr/main.c        |  455 +++++++++++++++++---------------
 arch/x86/kernel/cpu/mtrr/mtrr.h        |   19 +-
 arch/x86/kernel/cpu/mtrr/state.c       |   68 +++--
 arch/x86/kernel/cpu/perfctr-watchdog.c |   45 ++--
 arch/x86/kernel/cpu/proc.c             |    2 +-
 arch/x86/kernel/cpu/vmware.c           |   18 +-
 arch/x86/kernel/ds.c                   |    6 +-
 arch/x86/kernel/dumpstack.c            |    1 -
 arch/x86/kernel/irq_32.c               |    5 +-
 arch/x86/kernel/tlb_uv.c               |    4 +-
 arch/x86/kernel/traps.c                |    2 +-
 arch/x86/kvm/x86.c                     |    7 +-
 arch/x86/mm/pat.c                      |    2 +-
 28 files changed, 1024 insertions(+), 1010 deletions(-)
arch/x86/kernel/apic/ipi.c +1 -1
index 6ef00ba..08385e0 100644
@@ -153,7 +153,7 @@ int safe_smp_processor_id(void)
 {
 	int apicid, cpuid;
 
-	if (!boot_cpu_has(X86_FEATURE_APIC))
+	if (!cpu_has_apic)
 		return 0;
 
 	apicid = hard_smp_processor_id();
arch/x86/kernel/cpu/amd.c +21 -16
index 63fddcd..83b217c 100644
@@ -2,7 +2,7 @@
 #include <linux/bitops.h>
 #include <linux/mm.h>
 
-#include <asm/io.h>
+#include <linux/io.h>
 #include <asm/processor.h>
 #include <asm/apic.h>
 #include <asm/cpu.h>
@@ -45,8 +45,8 @@ static void __cpuinit init_amd_k5(struct cpuinfo_x86 *c)
 #define CBAR_ENB	(0x80000000)
 #define CBAR_KEY	(0X000000CB)
 	if (c->x86_model == 9 || c->x86_model == 10) {
-		if (inl (CBAR) & CBAR_ENB)
-			outl (0 | CBAR_KEY, CBAR);
+		if (inl(CBAR) & CBAR_ENB)
+			outl(0 | CBAR_KEY, CBAR);
 	}
 }
 
@@ -87,9 +87,10 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c)
 		d = d2-d;
 
 		if (d > 20*K6_BUG_LOOP)
-			printk("system stability may be impaired when more than 32 MB are used.\n");
+			printk(KERN_CONT
+				"system stability may be impaired when more than 32 MB are used.\n");
 		else
-			printk("probably OK (after B9730xxxx).\n");
+			printk(KERN_CONT "probably OK (after B9730xxxx).\n");
 		printk(KERN_INFO "Please see http://membres.lycos.fr/poulot/k6bug.html\n");
 	}
 
@@ -219,8 +220,9 @@ static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c)
 	if ((c->x86_model == 8 && c->x86_mask >= 1) || (c->x86_model > 8)) {
 		rdmsr(MSR_K7_CLK_CTL, l, h);
 		if ((l & 0xfff00000) != 0x20000000) {
-			printk ("CPU: CLK_CTL MSR was %x. Reprogramming to %x\n", l,
-				((l & 0x000fffff)|0x20000000));
+			printk(KERN_INFO
+			    "CPU: CLK_CTL MSR was %x. Reprogramming to %x\n",
+					l, ((l & 0x000fffff)|0x20000000));
 			wrmsr(MSR_K7_CLK_CTL, (l & 0x000fffff)|0x20000000, h);
 		}
 	}
@@ -398,7 +400,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
 		u32 level;
 
 		level = cpuid_eax(1);
-		if((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58)
+		if ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58)
 			set_cpu_cap(c, X86_FEATURE_REP_GOOD);
 
 		/*
@@ -494,27 +496,30 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
 		 * benefit in doing so.
 		 */
 		if (!rdmsrl_safe(MSR_K8_TSEG_ADDR, &tseg)) {
-		    printk(KERN_DEBUG "tseg: %010llx\n", tseg);
-		    if ((tseg>>PMD_SHIFT) <
+			printk(KERN_DEBUG "tseg: %010llx\n", tseg);
+			if ((tseg>>PMD_SHIFT) <
 				(max_low_pfn_mapped>>(PMD_SHIFT-PAGE_SHIFT)) ||
-			((tseg>>PMD_SHIFT) <
+				((tseg>>PMD_SHIFT) <
 				(max_pfn_mapped>>(PMD_SHIFT-PAGE_SHIFT)) &&
-			 (tseg>>PMD_SHIFT) >= (1ULL<<(32 - PMD_SHIFT))))
-			set_memory_4k((unsigned long)__va(tseg), 1);
+				(tseg>>PMD_SHIFT) >= (1ULL<<(32 - PMD_SHIFT))))
+				set_memory_4k((unsigned long)__va(tseg), 1);
 		}
 	}
 #endif
 }
 
 #ifdef CONFIG_X86_32
-static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c, unsigned int size)
+static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c,
+							unsigned int size)
 {
 	/* AMD errata T13 (order #21922) */
 	if ((c->x86 == 6)) {
-		if (c->x86_model == 3 && c->x86_mask == 0)	/* Duron Rev A0 */
+		/* Duron Rev A0 */
+		if (c->x86_model == 3 && c->x86_mask == 0)
 			size = 64;
+		/* Tbird rev A1/A2 */
 		if (c->x86_model == 4 &&
-		    (c->x86_mask == 0 || c->x86_mask == 1))	/* Tbird rev A1/A2 */
+			(c->x86_mask == 0 || c->x86_mask == 1))
 			size = 256;
 	}
 	return size;
arch/x86/kernel/cpu/bugs.c +5 -5
index c8e315f..01a2652 100644
@@ -81,7 +81,7 @@ static void __init check_fpu(void)
 
 	boot_cpu_data.fdiv_bug = fdiv_bug;
 	if (boot_cpu_data.fdiv_bug)
-		printk("Hmm, FPU with FDIV bug.\n");
+		printk(KERN_WARNING "Hmm, FPU with FDIV bug.\n");
 }
 
 static void __init check_hlt(void)
@@ -98,7 +98,7 @@ static void __init check_hlt(void)
 	halt();
 	halt();
 	halt();
-	printk("OK.\n");
+	printk(KERN_CONT "OK.\n");
 }
 
 /*
@@ -122,9 +122,9 @@ static void __init check_popad(void)
 	 * CPU hard. Too bad.
 	 */
 	if (res != 12345678)
-		printk("Buggy.\n");
+		printk(KERN_CONT "Buggy.\n");
 	else
-		printk("OK.\n");
+		printk(KERN_CONT "OK.\n");
 #endif
 }
 
@@ -156,7 +156,7 @@ void __init check_bugs(void)
 {
 	identify_boot_cpu();
 #ifndef CONFIG_SMP
-	printk("CPU: ");
+	printk(KERN_INFO "CPU: ");
 	print_cpu_info(&boot_cpu_data);
 #endif
 	check_config();
arch/x86/kernel/cpu/bugs_64.c +1 -1
index 9a3ed06..04f0fe5 100644
@@ -15,7 +15,7 @@ void __init check_bugs(void)
 {
 	identify_boot_cpu();
 #if !defined(CONFIG_SMP)
-	printk("CPU: ");
+	printk(KERN_INFO "CPU: ");
 	print_cpu_info(&boot_cpu_data);
 #endif
 	alternative_instructions();
arch/x86/kernel/cpu/common.c +5 -5
index 5ce60a8..734eaad 100644
@@ -18,8 +18,8 @@
 #include <asm/hypervisor.h>
 #include <asm/processor.h>
 #include <asm/sections.h>
-#include <asm/topology.h>
-#include <asm/cpumask.h>
+#include <linux/topology.h>
+#include <linux/cpumask.h>
 #include <asm/pgtable.h>
 #include <asm/atomic.h>
 #include <asm/proto.h>
@@ -28,13 +28,13 @@
 #include <asm/desc.h>
 #include <asm/i387.h>
 #include <asm/mtrr.h>
-#include <asm/numa.h>
+#include <linux/numa.h>
 #include <asm/asm.h>
 #include <asm/cpu.h>
 #include <asm/mce.h>
 #include <asm/msr.h>
 #include <asm/pat.h>
-#include <asm/smp.h>
+#include <linux/smp.h>
 
 #ifdef CONFIG_X86_LOCAL_APIC
 #include <asm/uv/uv.h>
@@ -982,7 +982,7 @@ static __init int setup_disablecpuid(char *arg)
 __setup("clearcpuid=", setup_disablecpuid);
 
 #ifdef CONFIG_X86_64
-struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table };
+struct desc_ptr idt_descr = { NR_VECTORS * 16 - 1, (unsigned long) idt_table };
 
 DEFINE_PER_CPU_FIRST(union irq_stack_union,
 		     irq_stack_union) __aligned(PAGE_SIZE);
arch/x86/kernel/cpu/cyrix.c +12 -7
index 593171e..19807b8 100644
@@ -3,10 +3,10 @@
 #include <linux/delay.h>
 #include <linux/pci.h>
 #include <asm/dma.h>
-#include <asm/io.h>
+#include <linux/io.h>
 #include <asm/processor-cyrix.h>
 #include <asm/processor-flags.h>
-#include <asm/timer.h>
+#include <linux/timer.h>
 #include <asm/pci-direct.h>
 #include <asm/tsc.h>
 
@@ -282,7 +282,8 @@ static void __cpuinit init_cyrix(struct cpuinfo_x86 *c)
 		 *  The 5510/5520 companion chips have a funky PIT.
 		 */
 		if (vendor == PCI_VENDOR_ID_CYRIX &&
-	 (device == PCI_DEVICE_ID_CYRIX_5510 || device == PCI_DEVICE_ID_CYRIX_5520))
+			(device == PCI_DEVICE_ID_CYRIX_5510 ||
+					device == PCI_DEVICE_ID_CYRIX_5520))
 			mark_tsc_unstable("cyrix 5510/5520 detected");
 	}
 #endif
@@ -299,7 +300,8 @@ static void __cpuinit init_cyrix(struct cpuinfo_x86 *c)
 			 *  ?  : 0x7x
 			 * GX1 : 0x8x          GX1  datasheet 56
 			 */
-			if ((0x30 <= dir1 && dir1 <= 0x6f) || (0x80 <= dir1 && dir1 <= 0x8f))
+			if ((0x30 <= dir1 && dir1 <= 0x6f) ||
+					(0x80 <= dir1 && dir1 <= 0x8f))
 				geode_configure();
 			return;
 		} else { /* MediaGX */
@@ -427,9 +429,12 @@ static void __cpuinit cyrix_identify(struct cpuinfo_x86 *c)
 			printk(KERN_INFO "Enabling CPUID on Cyrix processor.\n");
 			local_irq_save(flags);
 			ccr3 = getCx86(CX86_CCR3);
-			setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);       /* enable MAPEN  */
-			setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80);  /* enable cpuid  */
-			setCx86(CX86_CCR3, ccr3);                       /* disable MAPEN */
+			/* enable MAPEN  */
+			setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);
+			/* enable cpuid  */
+			setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80);
+			/* disable MAPEN */
+			setCx86(CX86_CCR3, ccr3);
 			local_irq_restore(flags);
 		}
 	}
arch/x86/kernel/cpu/hypervisor.c +2 -3
index fb5b86a..93ba8ee 100644
@@ -28,11 +28,10 @@
 static inline void __cpuinit
 detect_hypervisor_vendor(struct cpuinfo_x86 *c)
 {
-	if (vmware_platform()) {
+	if (vmware_platform())
 		c->x86_hyper_vendor = X86_HYPER_VENDOR_VMWARE;
-	} else {
+	else
 		c->x86_hyper_vendor = X86_HYPER_VENDOR_NONE;
-	}
 }
 
 unsigned long get_hypervisor_tsc_freq(void)
arch/x86/kernel/cpu/intel.c +6 -5
index 3260ab0..80a722a 100644
@@ -7,17 +7,17 @@
 #include <linux/sched.h>
 #include <linux/thread_info.h>
 #include <linux/module.h>
+#include <linux/uaccess.h>
 
 #include <asm/processor.h>
 #include <asm/pgtable.h>
 #include <asm/msr.h>
-#include <asm/uaccess.h>
 #include <asm/ds.h>
 #include <asm/bugs.h>
 #include <asm/cpu.h>
 
 #ifdef CONFIG_X86_64
-#include <asm/topology.h>
+#include <linux/topology.h>
 #include <asm/numa_64.h>
 #endif
 
@@ -174,7 +174,8 @@ static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c)
 #ifdef CONFIG_X86_F00F_BUG
 	/*
 	 * All current models of Pentium and Pentium with MMX technology CPUs
-	 * have the F0 0F bug, which lets nonprivileged users lock up the system.
+	 * have the F0 0F bug, which lets nonprivileged users lock up the
+	 * system.
 	 * Note that the workaround only should be initialized once...
 	 */
 	c->f00f_bug = 0;
@@ -207,7 +208,7 @@ static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c)
 			printk (KERN_INFO "CPU: C0 stepping P4 Xeon detected.\n");
 			printk (KERN_INFO "CPU: Disabling hardware prefetching (Errata 037)\n");
 			lo |= MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE;
-			wrmsr (MSR_IA32_MISC_ENABLE, lo, hi);
+			wrmsr(MSR_IA32_MISC_ENABLE, lo, hi);
 		}
 	}
 
@@ -283,7 +284,7 @@ static int __cpuinit intel_num_cpu_cores(struct cpuinfo_x86 *c)
 	/* Intel has a non-standard dependency on %ecx for this CPUID level. */
 	cpuid_count(4, 0, &eax, &ebx, &ecx, &edx);
 	if (eax & 0x1f)
-		return ((eax >> 26) + 1);
+		return (eax >> 26) + 1;
 	else
 		return 1;
 }
arch/x86/kernel/cpu/intel_cacheinfo.c +60 -56

286 lines not on this page · raw message

arch/x86/kernel/cpu/mtrr/amd.c +51 -46

145 lines not on this page · raw message

arch/x86/kernel/cpu/mtrr/centaur.c +35 -133

241 lines not on this page · raw message

arch/x86/kernel/cpu/mtrr/cleanup.c +195 -195

868 lines not on this page · raw message

arch/x86/kernel/cpu/mtrr/cyrix.c +51 -43

209 lines not on this page · raw message

arch/x86/kernel/cpu/mtrr/generic.c +169 -135

610 lines not on this page · raw message

arch/x86/kernel/cpu/mtrr/if.c +76 -59

265 lines not on this page · raw message

arch/x86/kernel/cpu/mtrr/main.c +242 -213

103 lines not on this page · raw message

arch/x86/kernel/cpu/mtrr/mtrr.h +9 -10
index 7538b76..a501dee 100644

Lines of this file are not shown. View the raw message.

arch/x86/kernel/cpu/mtrr/state.c +40 -28

68 lines not on this page · raw message

arch/x86/kernel/cpu/perfctr-watchdog.c +23 -22

45 lines not on this page · raw message

arch/x86/kernel/cpu/proc.c +1 -1
index d5e3039..1e90434 100644

Lines of this file are not shown. View the raw message.

arch/x86/kernel/cpu/vmware.c +9 -9
index 284c399..bc24f51 100644

Lines of this file are not shown. View the raw message.

arch/x86/kernel/ds.c +3 -3
index 48bfe13..ef42a03 100644

Lines of this file are not shown. View the raw message.

arch/x86/kernel/dumpstack.c +0 -1
index c840571..2d8a371 100644

Lines of this file are not shown. View the raw message.

arch/x86/kernel/irq_32.c +2 -3
index 3b09634..7d35d0f 100644

Lines of this file are not shown. View the raw message.

arch/x86/kernel/tlb_uv.c +2 -2
index 77b9689..503c1f2 100644

Lines of this file are not shown. View the raw message.

arch/x86/kernel/traps.c +1 -1
index 5204332..7e4b1f5 100644

Lines of this file are not shown. View the raw message.

arch/x86/kvm/x86.c +1 -6
index 3d45290..633ccc7 100644

Lines of this file are not shown. View the raw message.

arch/x86/mm/pat.c +1 -1
index e6718bb..e2900a3 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.