Skip to contentSkip to conversation

x86/timer updates for 4.16

GIT PULL Thomas Gleixner 1 participant 1 message Jan 29, 2018

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

Linus,

please pull the latest x86-timers-for-linus git tree from:

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

A small set of updates for x86 specific timers:

- Mark TSC invariant on a subset of Centaur CPUs

- Allow TSC calibration without PIT on mobile platforms which lack legacy devices.

Thanks,

tglx

------------------>
Peter Zijlstra (3):
x86/tsc: Allow TSC calibration without PIT x86/time: Unconditionally register legacy timer interrupt x86/tsc: Introduce early tsc clocksource

davidwang (1):
x86/centaur: Mark TSC invariant

 arch/x86/include/asm/i8259.h  |  5 ++++
 arch/x86/kernel/cpu/centaur.c |  4 +++
 arch/x86/kernel/time.c        |  9 ++++---
 arch/x86/kernel/tsc.c         | 61 ++++++++++++++++++++++++++++++++++++-------
 drivers/acpi/processor_idle.c |  1 +
 5 files changed, 67 insertions(+), 13 deletions(-)
arch/x86/include/asm/i8259.h +5 -0
index c8376b40e882..5cdcdbd4d892 100644
@@ -69,6 +69,11 @@ struct legacy_pic {
 extern struct legacy_pic *legacy_pic;
 extern struct legacy_pic null_legacy_pic;
 
+static inline bool has_legacy_pic(void)
+{
+	return legacy_pic != &null_legacy_pic;
+}
+
 static inline int nr_legacy_irqs(void)
 {
 	return legacy_pic->nr_legacy_irqs;
arch/x86/kernel/cpu/centaur.c +4 -0
index 68bc6d9b3132..c578cd29c2d2 100644
@@ -106,6 +106,10 @@ static void early_init_centaur(struct cpuinfo_x86 *c)
 #ifdef CONFIG_X86_64
 	set_cpu_cap(c, X86_FEATURE_SYSENTER32);
 #endif
+	if (c->x86_power & (1 << 8)) {
+		set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
+		set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
+	}
 }
 
 static void init_centaur(struct cpuinfo_x86 *c)
arch/x86/kernel/time.c +6 -3
index 749d189f8cd4..774ebafa97c4 100644
@@ -69,9 +69,12 @@ static struct irqaction irq0  = {
 
 static void __init setup_default_timer_irq(void)
 {
-	if (!nr_legacy_irqs())
-		return;
-	setup_irq(0, &irq0);
+	/*
+	 * Unconditionally register the legacy timer; even without legacy
+	 * PIC/PIT we need this for the HPET0 in legacy replacement mode.
+	 */
+	if (setup_irq(0, &irq0))
+		pr_info("Failed to register legacy timer interrupt\n");
 }
 
 /* Default timer init function */
arch/x86/kernel/tsc.c +51 -10

134 lines not on this page · raw message

drivers/acpi/processor_idle.c +1 -0
index d50a7b6ccddd..5f0071c7e2e1 100644
@@ -207,6 +207,7 @@ static void tsc_check_state(int state)
 	switch (boot_cpu_data.x86_vendor) {
 	case X86_VENDOR_AMD:
 	case X86_VENDOR_INTEL:
+	case X86_VENDOR_CENTAUR:
 		/*
 		 * AMD Fam10h TSC will tick in all
 		 * C/P/S0/S1 states when this bit is set.