Skip to contentSkip to conversation

x86 fixes

GIT PULL Ingo Molnar 1 participant 1 message Aug 25, 2008

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

Linus,

Please pull the latest x86-fixes-for-linus git tree from:

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

I'd like to highlight this commit:

x86: fix HPET regression in 2.6.26 versus 2.6.25, check hpet against BAR, v3

... which solves the bug for v2.6.27 but the long-term solution would IMO be to:

1) convert all x86 platform device support to the generic struct platform_device abstraction

2) and to extend the resource manager in kernel/resource.c with the ability to make resources registered by a platform device 'sticky/aliasable'.

That way platform devices would run first and register their resources, and the PCI code would then later on automatically recognize a resource already registered by a platform driver and would not re-allocate that PCI BAR and thus confuse the platform driver into not working. I havent seen such current capability/flag in kernel/resource.c - but i might have overlooked it.

We can delay that commit/fix if you can see a better solution for v2.6.27.

Ingo

------------------>
Austin Zhang (1):

      x86: add X86_FEATURE_XMM4_2 definitions

Linus Torvalds (1):
x86: do not enable TSC notifier if we don't need it

Peter Zijlstra (1):
x86: fix cpufreq + sched_clock() regression

Rafael J. Wysocki (1):
x86 MCE: Fix CPU hotplug problem with multiple multicore AMD CPUs

Robert Richter (2):
x86: fix: do not run code in amd_bus.c on non-AMD CPUs
x86: fix: make PCI ECS for AMD CPUs hotplug capable

Yinghai Lu (1):
x86: fix HPET regression in 2.6.26 versus 2.6.25, check hpet against BAR, v3

 arch/x86/kernel/cpu/mcheck/mce_64.c     |    5 ++
 arch/x86/kernel/cpu/mcheck/mce_amd_64.c |   18 ++-----
 arch/x86/kernel/tsc.c                   |    6 ++-
 arch/x86/pci/amd_bus.c                  |   52 ++++++++++++++++++--
 arch/x86/pci/i386.c                     |   78 +++++++++++++++++++++++++++++++
 include/asm-x86/cpufeature.h            |    2 +
 include/asm-x86/mce.h                   |    1 +
 7 files changed, 142 insertions(+), 20 deletions(-)
arch/x86/kernel/cpu/mcheck/mce_64.c +5 -0
index 65a3396..726a5fc 100644
@@ -759,6 +759,7 @@ static struct sysdev_class mce_sysclass = {
 };
 
 DEFINE_PER_CPU(struct sys_device, device_mce);
+void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu) __cpuinitdata;
 
 /* Why are there no generic functions for this? */
 #define ACCESSOR(name, var, start) \
@@ -883,9 +884,13 @@ static int __cpuinit mce_cpu_callback(struct notifier_block *nfb,
 	case CPU_ONLINE:
 	case CPU_ONLINE_FROZEN:
 		mce_create_device(cpu);
+		if (threshold_cpu_callback)
+			threshold_cpu_callback(action, cpu);
 		break;
 	case CPU_DEAD:
 	case CPU_DEAD_FROZEN:
+		if (threshold_cpu_callback)
+			threshold_cpu_callback(action, cpu);
 		mce_remove_device(cpu);
 		break;
 	}
arch/x86/kernel/cpu/mcheck/mce_amd_64.c +5 -13
index 88736ca..5eb390a 100644
@@ -628,6 +628,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
 	deallocate_threshold_block(cpu, bank);
 
 free_out:
+	kobject_del(b->kobj);
 	kobject_put(b->kobj);
 	kfree(b);
 	per_cpu(threshold_banks, cpu)[bank] = NULL;
@@ -645,14 +646,11 @@ static void threshold_remove_device(unsigned int cpu)
 }
 
 /* get notified when a cpu comes on/off */
-static int __cpuinit threshold_cpu_callback(struct notifier_block *nfb,
-					    unsigned long action, void *hcpu)
+static void __cpuinit amd_64_threshold_cpu_callback(unsigned long action,
+						     unsigned int cpu)
 {
-	/* cpu was unsigned int to begin with */
-	unsigned int cpu = (unsigned long)hcpu;
-
 	if (cpu >= NR_CPUS)
-		goto out;
+		return;
 
 	switch (action) {
 	case CPU_ONLINE:
@@ -666,14 +664,8 @@ static int __cpuinit threshold_cpu_callback(struct notifier_block *nfb,
 	default:
 		break;
 	}
-      out:
-	return NOTIFY_OK;
 }
 
-static struct notifier_block threshold_cpu_notifier __cpuinitdata = {
-	.notifier_call = threshold_cpu_callback,
-};
-
 static __init int threshold_init_device(void)
 {
 	unsigned lcpu = 0;
@@ -684,7 +676,7 @@ static __init int threshold_init_device(void)
 		if (err)
 			return err;
 	}
-	register_hotcpu_notifier(&threshold_cpu_notifier);
+	threshold_cpu_callback = amd_64_threshold_cpu_callback;
 	return 0;
 }
 
arch/x86/kernel/tsc.c +5 -1
index 46af716..8e786b0 100644
@@ -314,7 +314,7 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
 			mark_tsc_unstable("cpufreq changes");
 	}
 
-	set_cyc2ns_scale(tsc_khz_ref, freq->cpu);
+	set_cyc2ns_scale(tsc_khz, freq->cpu);
 
 	return 0;
 }
@@ -325,6 +325,10 @@ static struct notifier_block time_cpufreq_notifier_block = {
 
 static int __init cpufreq_tsc(void)
 {
+	if (!cpu_has_tsc)
+		return 0;
+	if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
+		return 0;
 	cpufreq_register_notifier(&time_cpufreq_notifier_block,
 				CPUFREQ_TRANSITION_NOTIFIER);
 	return 0;
arch/x86/pci/amd_bus.c +46 -6

81 lines not on this page · raw message

arch/x86/pci/i386.c +78 -0

104 lines not on this page · raw message

include/asm-x86/cpufeature.h +2 -0
index 2f5a792..762f6a6 100644
@@ -91,6 +91,7 @@
 #define X86_FEATURE_CX16	(4*32+13) /* CMPXCHG16B */
 #define X86_FEATURE_XTPR	(4*32+14) /* Send Task Priority Messages */
 #define X86_FEATURE_DCA		(4*32+18) /* Direct Cache Access */
+#define X86_FEATURE_XMM4_2	(4*32+20) /* Streaming SIMD Extensions-4.2 */
 
 /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
 #define X86_FEATURE_XSTORE	(5*32+ 2) /* on-CPU RNG present (xstore insn) */
@@ -189,6 +190,7 @@ extern const char * const x86_power_flags[32];
 #define cpu_has_gbpages		boot_cpu_has(X86_FEATURE_GBPAGES)
 #define cpu_has_arch_perfmon	boot_cpu_has(X86_FEATURE_ARCH_PERFMON)
 #define cpu_has_pat		boot_cpu_has(X86_FEATURE_PAT)
+#define cpu_has_xmm4_2		boot_cpu_has(X86_FEATURE_XMM4_2)
 
 #if defined(CONFIG_X86_INVLPG) || defined(CONFIG_X86_64)
 # define cpu_has_invlpg		1
include/asm-x86/mce.h +1 -0
index 94f1fd7..531eaa5 100644
@@ -92,6 +92,7 @@ extern int mce_disabled;
 
 void mce_log(struct mce *m);
 DECLARE_PER_CPU(struct sys_device, device_mce);
+extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
 
 #ifdef CONFIG_X86_MCE_INTEL
 void mce_intel_feature_init(struct cpuinfo_x86 *c);