Skip to contentSkip to conversation

x86, AMD: Set ARAT feature on AMD processors

PATCH RESEND In review Boris Ostrovsky 2 participants 2 messages Mar 15, 2011 – Mar 16, 2011 x86

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 x86, AMD: Set ARAT feature on AMD processors

From: Boris Ostrovsky <[email protected]>

Support for Always Running APIC timer (ARAT) was introduced in commit db954b5898dd3ef3ef93f4144158ea8f97deb058. This feature allows us to avoid switching timers from LAPIC to something else (e.g. HPET) and go into timer broadcasts when entering deep C-states.

AMD processors don't provide a CPUID bit for that feature but they also keep APIC timers running in deep C-states (except for cases when the processor is affected by erratum 400). Therefore we should set ARAT feature bit on AMD CPUs.

---
 arch/x86/kernel/cpu/amd.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/x86/kernel/cpu/amd.c +4 -0
index 7c7bedb..48eaa1b 100644
@@ -594,6 +594,10 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
 		}
 	}
 #endif
+
+	/* As a rule processors have APIC timer running in deep C states */
+	if (c->x86 >= 0xf && !cpu_has_amd_erratum(amd_erratum_400))
+		set_cpu_cap(c, X86_FEATURE_ARAT);
 }
 
 #ifdef CONFIG_X86_32
Signature · 1 line
1.7.1
#1 lore raw
Commit-ID:  b87cf80af3ba4b4c008b4face3c68d604e1715c6
Gitweb:     http://git.kernel.org/tip/b87cf80af3ba4b4c008b4face3c68d604e1715c6
Author:     Boris Ostrovsky <[email protected]>
AuthorDate: Tue, 15 Mar 2011 12:13:44 -0400
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 16 Mar 2011 14:03:33 +0100

x86, AMD: Set ARAT feature on AMD processors

Support for Always Running APIC timer (ARAT) was introduced in commit db954b5898dd3ef3ef93f4144158ea8f97deb058. This feature allows us to avoid switching timers from LAPIC to something else (e.g. HPET) and go into timer broadcasts when entering deep C-states.

AMD processors don't provide a CPUID bit for that feature but they also keep APIC timers running in deep C-states (except for cases when the processor is affected by erratum 400). Therefore we should set ARAT feature bit on AMD CPUs.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/cpu/amd.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/x86/kernel/cpu/amd.c +4 -0
index 7c7bedb..48eaa1b 100644
@@ -594,6 +594,10 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
 		}
 	}
 #endif
+
+	/* As a rule processors have APIC timer running in deep C states */
+	if (c->x86 >= 0xf && !cpu_has_amd_erratum(amd_erratum_400))
+		set_cpu_cap(c, X86_FEATURE_ARAT);
 }
 
 #ifdef CONFIG_X86_32