[PATCH RESEND] x86, AMD: Set ARAT feature on AMD processors

From: Boris Ostrovsky
Date: Tue Mar 15 2011 - 13:14:03 EST


From: Boris Ostrovsky <boris.ostrovsky@xxxxxxx>

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.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxx>
Tested-by: Borislav Petkov <borislav.petkov@xxxxxxx>
Acked-by: Andreas Herrmann <andreas.herrmann3@xxxxxxx>
Acked-by: Mark Langsdorf <mark.langsdorf@xxxxxxx>
---
arch/x86/kernel/cpu/amd.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 7c7bedb..48eaa1b 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -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
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/