* [PATCH] x86 ACPI: Add support for Always Running APIC timer
@ 2009-04-07 1:51 Pallipadi, Venkatesh
2009-04-07 4:45 ` Len Brown
0 siblings, 1 reply; 4+ messages in thread
From: Pallipadi, Venkatesh @ 2009-04-07 1:51 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H Peter Anvin, Len Brown; +Cc: linux-kernel
Add support for Always Running APIC timer, CPUID_0x6_EAX_Bit2.
This bit means the APIC timer continues to run even when CPU is
in deep C-states.
The advantage is that we can use LAPIC timer on these CPUs
always, and there is no need for "slow to read and program"
external timers (HPET/PIT) and the timer broadcast logic
and related code in C-state entry and exit.
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
---
arch/x86/include/asm/cpufeature.h | 1 +
arch/x86/kernel/apic/apic.c | 6 ++++++
arch/x86/kernel/cpu/addon_cpuid_features.c | 1 +
drivers/acpi/processor_idle.c | 3 +++
4 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 0beba0d..bb83b1c 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -154,6 +154,7 @@
* CPUID levels like 0x6, 0xA etc
*/
#define X86_FEATURE_IDA (7*32+ 0) /* Intel Dynamic Acceleration */
+#define X86_FEATURE_ARAT (7*32+ 1) /* Always Running APIC Timer */
/* Virtualization flags: Linux defined */
#define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 85eb8e1..4324435 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -431,6 +431,12 @@ static void __cpuinit setup_APIC_timer(void)
{
struct clock_event_device *levt = &__get_cpu_var(lapic_events);
+ if (cpu_has(¤t_cpu_data, X86_FEATURE_ARAT)) {
+ lapic_clockevent.features &= ~CLOCK_EVT_FEAT_C3STOP;
+ /* Make LAPIC timer preferrable over percpu HPET */
+ lapic_clockevent.rating = 150;
+ }
+
memcpy(levt, &lapic_clockevent, sizeof(*levt));
levt->cpumask = cpumask_of(smp_processor_id());
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index 8220ae6..c965e52 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -31,6 +31,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
{ X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 },
+ { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006 },
{ 0, 0, 0, 0 }
};
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 4e6e758..6fe1214 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -145,6 +145,9 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr,
struct acpi_processor_power *pwr = &pr->power;
u8 type = local_apic_timer_c2_ok ? ACPI_STATE_C3 : ACPI_STATE_C2;
+ if (cpu_has(&cpu_data(pr->id), X86_FEATURE_ARAT))
+ return;
+
/*
* Check, if one of the previous states already marked the lapic
* unstable
--
1.6.0.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] x86 ACPI: Add support for Always Running APIC timer
2009-04-07 1:51 [PATCH] x86 ACPI: Add support for Always Running APIC timer Pallipadi, Venkatesh
@ 2009-04-07 4:45 ` Len Brown
2009-04-07 4:55 ` H. Peter Anvin
0 siblings, 1 reply; 4+ messages in thread
From: Len Brown @ 2009-04-07 4:45 UTC (permalink / raw)
To: Pallipadi, Venkatesh
Cc: Thomas Gleixner, Ingo Molnar, H Peter Anvin, linux-kernel
applied to acpi-test tree, pending x86 maintainer ack.
thanks,
Len Brown, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86 ACPI: Add support for Always Running APIC timer
2009-04-07 4:45 ` Len Brown
@ 2009-04-07 4:55 ` H. Peter Anvin
2009-04-07 10:09 ` Ingo Molnar
0 siblings, 1 reply; 4+ messages in thread
From: H. Peter Anvin @ 2009-04-07 4:55 UTC (permalink / raw)
To: Len Brown
Cc: Pallipadi, Venkatesh, Thomas Gleixner, Ingo Molnar, linux-kernel
Len Brown wrote:
> applied to acpi-test tree, pending x86 maintainer ack.
>
> thanks,
> Len Brown, Intel Open Source Technology Center
>
Acked-by: H. Peter Anvin <hpa@zytor.com>
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86 ACPI: Add support for Always Running APIC timer
2009-04-07 4:55 ` H. Peter Anvin
@ 2009-04-07 10:09 ` Ingo Molnar
0 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2009-04-07 10:09 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Len Brown, Pallipadi, Venkatesh, Thomas Gleixner, linux-kernel
* H. Peter Anvin <hpa@zytor.com> wrote:
> Len Brown wrote:
> > applied to acpi-test tree, pending x86 maintainer ack.
> >
> > thanks,
> > Len Brown, Intel Open Source Technology Center
> >
>
> Acked-by: H. Peter Anvin <hpa@zytor.com>
hm, is this queued for v2.6.30 or v2.6.31?
If v31 then i'd prefer to have it in the x86 tree. The ACPI impact
is incidental only, 80% of the patch changes x86 files - and it
changes 'hub' files that frequently cause merge conflicts.
If it's going upstream real soon in v30, then no objections at all:
Acked-by: Ingo Molnar <mingo@elte.hu>
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-07 10:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-07 1:51 [PATCH] x86 ACPI: Add support for Always Running APIC timer Pallipadi, Venkatesh
2009-04-07 4:45 ` Len Brown
2009-04-07 4:55 ` H. Peter Anvin
2009-04-07 10:09 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox