Thomas Gleixner | a61127c | 2019-05-29 16:57:49 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 2 | /* |
| 3 | * intel_idle.c - native hardware idle loop for modern Intel processors |
| 4 | * |
Rafael J. Wysocki | 317e5ec | 2020-02-06 18:45:49 +0100 | [diff] [blame] | 5 | * Copyright (c) 2013 - 2020, Intel Corporation. |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 6 | * Len Brown <len.brown@intel.com> |
Rafael J. Wysocki | 317e5ec | 2020-02-06 18:45:49 +0100 | [diff] [blame] | 7 | * Rafael J. Wysocki <rafael.j.wysocki@intel.com> |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | /* |
| 11 | * intel_idle is a cpuidle driver that loads on specific Intel processors |
| 12 | * in lieu of the legacy ACPI processor_idle driver. The intent is to |
| 13 | * make Linux more efficient on these processors, as intel_idle knows |
| 14 | * more than ACPI, as well as make Linux more immune to ACPI BIOS bugs. |
| 15 | */ |
| 16 | |
| 17 | /* |
| 18 | * Design Assumptions |
| 19 | * |
| 20 | * All CPUs have same idle states as boot CPU |
| 21 | * |
| 22 | * Chipset BM_STS (bus master status) bit is a NOP |
| 23 | * for preventing entry into deep C-stats |
| 24 | */ |
| 25 | |
| 26 | /* |
| 27 | * Known limitations |
| 28 | * |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 29 | * ACPI has a .suspend hack to turn off deep c-statees during suspend |
| 30 | * to avoid complications with the lapic timer workaround. |
| 31 | * Have not seen issues with suspend, but may need same workaround here. |
| 32 | * |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 33 | */ |
| 34 | |
| 35 | /* un-comment DEBUG to enable pr_debug() statements */ |
| 36 | #define DEBUG |
| 37 | |
Joe Perches | 654d08a | 2017-06-09 12:29:20 -0700 | [diff] [blame] | 38 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 39 | |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 40 | #include <linux/acpi.h> |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 41 | #include <linux/kernel.h> |
| 42 | #include <linux/cpuidle.h> |
Thomas Gleixner | 76962ca | 2015-04-03 02:02:34 +0200 | [diff] [blame] | 43 | #include <linux/tick.h> |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 44 | #include <trace/events/power.h> |
| 45 | #include <linux/sched.h> |
Shaohua Li | 2a2d31c | 2011-01-10 09:38:12 +0800 | [diff] [blame] | 46 | #include <linux/notifier.h> |
| 47 | #include <linux/cpu.h> |
Paul Gortmaker | 02c4fae | 2016-06-17 01:28:33 -0400 | [diff] [blame] | 48 | #include <linux/moduleparam.h> |
Andi Kleen | b66b8b9 | 2012-01-26 00:09:07 +0100 | [diff] [blame] | 49 | #include <asm/cpu_device_id.h> |
Dave Hansen | db73c5a | 2016-06-02 17:19:32 -0700 | [diff] [blame] | 50 | #include <asm/intel-family.h> |
H. Peter Anvin | bc83ccc | 2010-09-17 15:36:40 -0700 | [diff] [blame] | 51 | #include <asm/mwait.h> |
Len Brown | 14796fc | 2011-01-18 20:48:27 -0500 | [diff] [blame] | 52 | #include <asm/msr.h> |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 53 | |
Rafael J. Wysocki | 317e5ec | 2020-02-06 18:45:49 +0100 | [diff] [blame] | 54 | #define INTEL_IDLE_VERSION "0.5.1" |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 55 | |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 56 | static struct cpuidle_driver intel_idle_driver = { |
| 57 | .name = "intel_idle", |
| 58 | .owner = THIS_MODULE, |
| 59 | }; |
| 60 | /* intel_idle.max_cstate=0 disables driver */ |
Len Brown | 137ecc7 | 2013-02-01 21:35:35 -0500 | [diff] [blame] | 61 | static int max_cstate = CPUIDLE_STATE_MAX - 1; |
Rafael J. Wysocki | 4dcb78e | 2020-02-03 11:57:18 +0100 | [diff] [blame] | 62 | static unsigned int disabled_states_mask; |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 63 | |
Rafael J. Wysocki | 6eb0443 | 2020-02-06 18:45:18 +0100 | [diff] [blame] | 64 | static struct cpuidle_device __percpu *intel_idle_cpuidle_devices; |
Rafael J. Wysocki | 7f843dd | 2020-02-06 18:41:24 +0100 | [diff] [blame] | 65 | |
| 66 | static unsigned long auto_demotion_disable_flags; |
| 67 | static bool disable_promotion_to_c1e; |
| 68 | |
Andi Kleen | b66b8b9 | 2012-01-26 00:09:07 +0100 | [diff] [blame] | 69 | struct idle_cpu { |
| 70 | struct cpuidle_state *state_table; |
| 71 | |
| 72 | /* |
| 73 | * Hardware C-state auto-demotion may not always be optimal. |
| 74 | * Indicate which enable bits to clear here. |
| 75 | */ |
| 76 | unsigned long auto_demotion_disable_flags; |
Len Brown | 8c058d53 | 2014-07-31 15:21:24 -0400 | [diff] [blame] | 77 | bool byt_auto_demotion_disable_flag; |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 78 | bool disable_promotion_to_c1e; |
Rafael J. Wysocki | bff8e60 | 2019-12-13 09:56:21 +0100 | [diff] [blame] | 79 | bool use_acpi; |
Andi Kleen | b66b8b9 | 2012-01-26 00:09:07 +0100 | [diff] [blame] | 80 | }; |
| 81 | |
Rafael J. Wysocki | 7f843dd | 2020-02-06 18:41:24 +0100 | [diff] [blame] | 82 | static const struct idle_cpu *icpu __initdata; |
Rafael J. Wysocki | 7f843dd | 2020-02-06 18:41:24 +0100 | [diff] [blame] | 83 | static struct cpuidle_state *cpuidle_state_table __initdata; |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 84 | |
Rafael J. Wysocki | 6eb0443 | 2020-02-06 18:45:18 +0100 | [diff] [blame] | 85 | static unsigned int mwait_substates __initdata; |
| 86 | |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 87 | /* |
Rafael J. Wysocki | bff8e60 | 2019-12-13 09:56:21 +0100 | [diff] [blame] | 88 | * Enable this state by default even if the ACPI _CST does not list it. |
| 89 | */ |
| 90 | #define CPUIDLE_FLAG_ALWAYS_ENABLE BIT(15) |
| 91 | |
| 92 | /* |
Len Brown | 956d033 | 2011-01-12 02:51:20 -0500 | [diff] [blame] | 93 | * Set this flag for states where the HW flushes the TLB for us |
| 94 | * and so we don't need cross-calls to keep it consistent. |
| 95 | * If this flag is set, SW flushes the TLB, so even if the |
| 96 | * HW doesn't do the flushing, this flag is safe to use. |
| 97 | */ |
Rafael J. Wysocki | a472e4b | 2020-02-06 18:45:39 +0100 | [diff] [blame] | 98 | #define CPUIDLE_FLAG_TLB_FLUSHED BIT(16) |
Len Brown | 956d033 | 2011-01-12 02:51:20 -0500 | [diff] [blame] | 99 | |
| 100 | /* |
Len Brown | b1beab4 | 2013-01-31 19:55:37 -0500 | [diff] [blame] | 101 | * MWAIT takes an 8-bit "hint" in EAX "suggesting" |
| 102 | * the C-state (top nibble) and sub-state (bottom nibble) |
| 103 | * 0x00 means "MWAIT(C1)", 0x10 means "MWAIT(C2)" etc. |
| 104 | * |
| 105 | * We store the hint at the top of our "flags" for each state. |
| 106 | */ |
| 107 | #define flg2MWAIT(flags) (((flags) >> 24) & 0xFF) |
| 108 | #define MWAIT2flg(eax) ((eax & 0xFF) << 24) |
| 109 | |
Rafael J. Wysocki | 30a996f | 2020-02-06 18:41:15 +0100 | [diff] [blame] | 110 | /** |
| 111 | * intel_idle - Ask the processor to enter the given idle state. |
| 112 | * @dev: cpuidle device of the target CPU. |
| 113 | * @drv: cpuidle driver (assumed to point to intel_idle_driver). |
| 114 | * @index: Target idle state index. |
| 115 | * |
| 116 | * Use the MWAIT instruction to notify the processor that the CPU represented by |
| 117 | * @dev is idle and it can try to enter the idle state corresponding to @index. |
| 118 | * |
| 119 | * If the local APIC timer is not known to be reliable in the target idle state, |
| 120 | * enable one-shot tick broadcasting for the target CPU before executing MWAIT. |
| 121 | * |
| 122 | * Optionally call leave_mm() for the target CPU upfront to avoid wakeups due to |
| 123 | * flushing user TLBs. |
| 124 | * |
| 125 | * Must be called under local_irq_disable(). |
| 126 | */ |
| 127 | static __cpuidle int intel_idle(struct cpuidle_device *dev, |
| 128 | struct cpuidle_driver *drv, int index) |
| 129 | { |
| 130 | struct cpuidle_state *state = &drv->states[index]; |
| 131 | unsigned long eax = flg2MWAIT(state->flags); |
| 132 | unsigned long ecx = 1; /* break on interrupt flag */ |
| 133 | bool uninitialized_var(tick); |
| 134 | int cpu = smp_processor_id(); |
| 135 | |
| 136 | /* |
| 137 | * leave_mm() to avoid costly and often unnecessary wakeups |
| 138 | * for flushing the user TLB's associated with the active mm. |
| 139 | */ |
| 140 | if (state->flags & CPUIDLE_FLAG_TLB_FLUSHED) |
| 141 | leave_mm(cpu); |
| 142 | |
Rafael J. Wysocki | dab2017 | 2020-06-29 13:58:28 +0200 | [diff] [blame^] | 143 | if (!static_cpu_has(X86_FEATURE_ARAT)) { |
Rafael J. Wysocki | 30a996f | 2020-02-06 18:41:15 +0100 | [diff] [blame] | 144 | /* |
| 145 | * Switch over to one-shot tick broadcast if the target C-state |
| 146 | * is deeper than C1. |
| 147 | */ |
| 148 | if ((eax >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) { |
| 149 | tick = true; |
| 150 | tick_broadcast_enter(); |
| 151 | } else { |
| 152 | tick = false; |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | mwait_idle_with_hints(eax, ecx); |
| 157 | |
| 158 | if (!static_cpu_has(X86_FEATURE_ARAT) && tick) |
| 159 | tick_broadcast_exit(); |
| 160 | |
| 161 | return index; |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * intel_idle_s2idle - Ask the processor to enter the given idle state. |
| 166 | * @dev: cpuidle device of the target CPU. |
| 167 | * @drv: cpuidle driver (assumed to point to intel_idle_driver). |
| 168 | * @index: Target idle state index. |
| 169 | * |
| 170 | * Use the MWAIT instruction to notify the processor that the CPU represented by |
| 171 | * @dev is idle and it can try to enter the idle state corresponding to @index. |
| 172 | * |
| 173 | * Invoked as a suspend-to-idle callback routine with frozen user space, frozen |
| 174 | * scheduler tick and suspended scheduler clock on the target CPU. |
| 175 | */ |
| 176 | static __cpuidle void intel_idle_s2idle(struct cpuidle_device *dev, |
| 177 | struct cpuidle_driver *drv, int index) |
| 178 | { |
| 179 | unsigned long eax = flg2MWAIT(drv->states[index].flags); |
| 180 | unsigned long ecx = 1; /* break on interrupt flag */ |
| 181 | |
| 182 | mwait_idle_with_hints(eax, ecx); |
| 183 | } |
| 184 | |
Len Brown | b1beab4 | 2013-01-31 19:55:37 -0500 | [diff] [blame] | 185 | /* |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 186 | * States are indexed by the cstate number, |
| 187 | * which is also the index into the MWAIT hint array. |
| 188 | * Thus C0 is a dummy. |
| 189 | */ |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 190 | static struct cpuidle_state nehalem_cstates[] __initdata = { |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 191 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 192 | .name = "C1", |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 193 | .desc = "MWAIT 0x00", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 194 | .flags = MWAIT2flg(0x00), |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 195 | .exit_latency = 3, |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 196 | .target_residency = 6, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 197 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 198 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 199 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 200 | .name = "C1E", |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 201 | .desc = "MWAIT 0x01", |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 202 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE, |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 203 | .exit_latency = 10, |
| 204 | .target_residency = 20, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 205 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 206 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 207 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 208 | .name = "C3", |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 209 | .desc = "MWAIT 0x10", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 210 | .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 211 | .exit_latency = 20, |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 212 | .target_residency = 80, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 213 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 214 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 215 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 216 | .name = "C6", |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 217 | .desc = "MWAIT 0x20", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 218 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 219 | .exit_latency = 200, |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 220 | .target_residency = 800, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 221 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 222 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 223 | { |
| 224 | .enter = NULL } |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 225 | }; |
| 226 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 227 | static struct cpuidle_state snb_cstates[] __initdata = { |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 228 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 229 | .name = "C1", |
Len Brown | d13780d | 2010-07-07 00:12:03 -0400 | [diff] [blame] | 230 | .desc = "MWAIT 0x00", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 231 | .flags = MWAIT2flg(0x00), |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 232 | .exit_latency = 2, |
| 233 | .target_residency = 2, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 234 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 235 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 236 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 237 | .name = "C1E", |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 238 | .desc = "MWAIT 0x01", |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 239 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE, |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 240 | .exit_latency = 10, |
| 241 | .target_residency = 20, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 242 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 243 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 244 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 245 | .name = "C3", |
Len Brown | d13780d | 2010-07-07 00:12:03 -0400 | [diff] [blame] | 246 | .desc = "MWAIT 0x10", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 247 | .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | d13780d | 2010-07-07 00:12:03 -0400 | [diff] [blame] | 248 | .exit_latency = 80, |
Len Brown | ddbd550 | 2010-12-13 18:28:22 -0500 | [diff] [blame] | 249 | .target_residency = 211, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 250 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 251 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 252 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 253 | .name = "C6", |
Len Brown | d13780d | 2010-07-07 00:12:03 -0400 | [diff] [blame] | 254 | .desc = "MWAIT 0x20", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 255 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | d13780d | 2010-07-07 00:12:03 -0400 | [diff] [blame] | 256 | .exit_latency = 104, |
Len Brown | ddbd550 | 2010-12-13 18:28:22 -0500 | [diff] [blame] | 257 | .target_residency = 345, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 258 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 259 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 260 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 261 | .name = "C7", |
Len Brown | d13780d | 2010-07-07 00:12:03 -0400 | [diff] [blame] | 262 | .desc = "MWAIT 0x30", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 263 | .flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | d13780d | 2010-07-07 00:12:03 -0400 | [diff] [blame] | 264 | .exit_latency = 109, |
Len Brown | ddbd550 | 2010-12-13 18:28:22 -0500 | [diff] [blame] | 265 | .target_residency = 345, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 266 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 267 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 268 | { |
| 269 | .enter = NULL } |
Len Brown | d13780d | 2010-07-07 00:12:03 -0400 | [diff] [blame] | 270 | }; |
| 271 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 272 | static struct cpuidle_state byt_cstates[] __initdata = { |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 273 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 274 | .name = "C1", |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 275 | .desc = "MWAIT 0x00", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 276 | .flags = MWAIT2flg(0x00), |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 277 | .exit_latency = 1, |
| 278 | .target_residency = 1, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 279 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 280 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 281 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 282 | .name = "C6N", |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 283 | .desc = "MWAIT 0x58", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 284 | .flags = MWAIT2flg(0x58) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | d7ef767 | 2015-03-24 23:23:20 -0400 | [diff] [blame] | 285 | .exit_latency = 300, |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 286 | .target_residency = 275, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 287 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 288 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 289 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 290 | .name = "C6S", |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 291 | .desc = "MWAIT 0x52", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 292 | .flags = MWAIT2flg(0x52) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | d7ef767 | 2015-03-24 23:23:20 -0400 | [diff] [blame] | 293 | .exit_latency = 500, |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 294 | .target_residency = 560, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 295 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 296 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 297 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 298 | .name = "C7", |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 299 | .desc = "MWAIT 0x60", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 300 | .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 301 | .exit_latency = 1200, |
Len Brown | d7ef767 | 2015-03-24 23:23:20 -0400 | [diff] [blame] | 302 | .target_residency = 4000, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 303 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 304 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 305 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 306 | .name = "C7S", |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 307 | .desc = "MWAIT 0x64", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 308 | .flags = MWAIT2flg(0x64) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 309 | .exit_latency = 10000, |
| 310 | .target_residency = 20000, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 311 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 312 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 313 | { |
| 314 | .enter = NULL } |
| 315 | }; |
| 316 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 317 | static struct cpuidle_state cht_cstates[] __initdata = { |
Len Brown | cab07a5 | 2015-03-27 20:54:01 -0400 | [diff] [blame] | 318 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 319 | .name = "C1", |
Len Brown | cab07a5 | 2015-03-27 20:54:01 -0400 | [diff] [blame] | 320 | .desc = "MWAIT 0x00", |
| 321 | .flags = MWAIT2flg(0x00), |
| 322 | .exit_latency = 1, |
| 323 | .target_residency = 1, |
| 324 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 325 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | cab07a5 | 2015-03-27 20:54:01 -0400 | [diff] [blame] | 326 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 327 | .name = "C6N", |
Len Brown | cab07a5 | 2015-03-27 20:54:01 -0400 | [diff] [blame] | 328 | .desc = "MWAIT 0x58", |
| 329 | .flags = MWAIT2flg(0x58) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 330 | .exit_latency = 80, |
| 331 | .target_residency = 275, |
| 332 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 333 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | cab07a5 | 2015-03-27 20:54:01 -0400 | [diff] [blame] | 334 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 335 | .name = "C6S", |
Len Brown | cab07a5 | 2015-03-27 20:54:01 -0400 | [diff] [blame] | 336 | .desc = "MWAIT 0x52", |
| 337 | .flags = MWAIT2flg(0x52) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 338 | .exit_latency = 200, |
| 339 | .target_residency = 560, |
| 340 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 341 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | cab07a5 | 2015-03-27 20:54:01 -0400 | [diff] [blame] | 342 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 343 | .name = "C7", |
Len Brown | cab07a5 | 2015-03-27 20:54:01 -0400 | [diff] [blame] | 344 | .desc = "MWAIT 0x60", |
| 345 | .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 346 | .exit_latency = 1200, |
| 347 | .target_residency = 4000, |
| 348 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 349 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | cab07a5 | 2015-03-27 20:54:01 -0400 | [diff] [blame] | 350 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 351 | .name = "C7S", |
Len Brown | cab07a5 | 2015-03-27 20:54:01 -0400 | [diff] [blame] | 352 | .desc = "MWAIT 0x64", |
| 353 | .flags = MWAIT2flg(0x64) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 354 | .exit_latency = 10000, |
| 355 | .target_residency = 20000, |
| 356 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 357 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | cab07a5 | 2015-03-27 20:54:01 -0400 | [diff] [blame] | 358 | { |
| 359 | .enter = NULL } |
| 360 | }; |
| 361 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 362 | static struct cpuidle_state ivb_cstates[] __initdata = { |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 363 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 364 | .name = "C1", |
Len Brown | 6edab08 | 2012-06-01 19:45:32 -0400 | [diff] [blame] | 365 | .desc = "MWAIT 0x00", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 366 | .flags = MWAIT2flg(0x00), |
Len Brown | 6edab08 | 2012-06-01 19:45:32 -0400 | [diff] [blame] | 367 | .exit_latency = 1, |
| 368 | .target_residency = 1, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 369 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 370 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 371 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 372 | .name = "C1E", |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 373 | .desc = "MWAIT 0x01", |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 374 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE, |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 375 | .exit_latency = 10, |
| 376 | .target_residency = 20, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 377 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 378 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 379 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 380 | .name = "C3", |
Len Brown | 6edab08 | 2012-06-01 19:45:32 -0400 | [diff] [blame] | 381 | .desc = "MWAIT 0x10", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 382 | .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 6edab08 | 2012-06-01 19:45:32 -0400 | [diff] [blame] | 383 | .exit_latency = 59, |
| 384 | .target_residency = 156, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 385 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 386 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 387 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 388 | .name = "C6", |
Len Brown | 6edab08 | 2012-06-01 19:45:32 -0400 | [diff] [blame] | 389 | .desc = "MWAIT 0x20", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 390 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 6edab08 | 2012-06-01 19:45:32 -0400 | [diff] [blame] | 391 | .exit_latency = 80, |
| 392 | .target_residency = 300, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 393 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 394 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 395 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 396 | .name = "C7", |
Len Brown | 6edab08 | 2012-06-01 19:45:32 -0400 | [diff] [blame] | 397 | .desc = "MWAIT 0x30", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 398 | .flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 6edab08 | 2012-06-01 19:45:32 -0400 | [diff] [blame] | 399 | .exit_latency = 87, |
| 400 | .target_residency = 300, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 401 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 402 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 403 | { |
| 404 | .enter = NULL } |
Len Brown | 6edab08 | 2012-06-01 19:45:32 -0400 | [diff] [blame] | 405 | }; |
| 406 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 407 | static struct cpuidle_state ivt_cstates[] __initdata = { |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 408 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 409 | .name = "C1", |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 410 | .desc = "MWAIT 0x00", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 411 | .flags = MWAIT2flg(0x00), |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 412 | .exit_latency = 1, |
| 413 | .target_residency = 1, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 414 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 415 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 416 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 417 | .name = "C1E", |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 418 | .desc = "MWAIT 0x01", |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 419 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 420 | .exit_latency = 10, |
| 421 | .target_residency = 80, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 422 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 423 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 424 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 425 | .name = "C3", |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 426 | .desc = "MWAIT 0x10", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 427 | .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 428 | .exit_latency = 59, |
| 429 | .target_residency = 156, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 430 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 431 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 432 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 433 | .name = "C6", |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 434 | .desc = "MWAIT 0x20", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 435 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 436 | .exit_latency = 82, |
| 437 | .target_residency = 300, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 438 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 439 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 440 | { |
| 441 | .enter = NULL } |
| 442 | }; |
| 443 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 444 | static struct cpuidle_state ivt_cstates_4s[] __initdata = { |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 445 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 446 | .name = "C1", |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 447 | .desc = "MWAIT 0x00", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 448 | .flags = MWAIT2flg(0x00), |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 449 | .exit_latency = 1, |
| 450 | .target_residency = 1, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 451 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 452 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 453 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 454 | .name = "C1E", |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 455 | .desc = "MWAIT 0x01", |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 456 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 457 | .exit_latency = 10, |
| 458 | .target_residency = 250, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 459 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 460 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 461 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 462 | .name = "C3", |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 463 | .desc = "MWAIT 0x10", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 464 | .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 465 | .exit_latency = 59, |
| 466 | .target_residency = 300, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 467 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 468 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 469 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 470 | .name = "C6", |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 471 | .desc = "MWAIT 0x20", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 472 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 473 | .exit_latency = 84, |
| 474 | .target_residency = 400, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 475 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 476 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 477 | { |
| 478 | .enter = NULL } |
| 479 | }; |
| 480 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 481 | static struct cpuidle_state ivt_cstates_8s[] __initdata = { |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 482 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 483 | .name = "C1", |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 484 | .desc = "MWAIT 0x00", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 485 | .flags = MWAIT2flg(0x00), |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 486 | .exit_latency = 1, |
| 487 | .target_residency = 1, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 488 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 489 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 490 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 491 | .name = "C1E", |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 492 | .desc = "MWAIT 0x01", |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 493 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 494 | .exit_latency = 10, |
| 495 | .target_residency = 500, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 496 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 497 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 498 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 499 | .name = "C3", |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 500 | .desc = "MWAIT 0x10", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 501 | .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 502 | .exit_latency = 59, |
| 503 | .target_residency = 600, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 504 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 505 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 506 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 507 | .name = "C6", |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 508 | .desc = "MWAIT 0x20", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 509 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 510 | .exit_latency = 88, |
| 511 | .target_residency = 700, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 512 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 513 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 514 | { |
| 515 | .enter = NULL } |
| 516 | }; |
| 517 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 518 | static struct cpuidle_state hsw_cstates[] __initdata = { |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 519 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 520 | .name = "C1", |
Len Brown | 85a4d2d | 2013-01-31 14:40:49 -0500 | [diff] [blame] | 521 | .desc = "MWAIT 0x00", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 522 | .flags = MWAIT2flg(0x00), |
Len Brown | 85a4d2d | 2013-01-31 14:40:49 -0500 | [diff] [blame] | 523 | .exit_latency = 2, |
| 524 | .target_residency = 2, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 525 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 526 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 527 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 528 | .name = "C1E", |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 529 | .desc = "MWAIT 0x01", |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 530 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE, |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 531 | .exit_latency = 10, |
| 532 | .target_residency = 20, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 533 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 534 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 535 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 536 | .name = "C3", |
Len Brown | 85a4d2d | 2013-01-31 14:40:49 -0500 | [diff] [blame] | 537 | .desc = "MWAIT 0x10", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 538 | .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 85a4d2d | 2013-01-31 14:40:49 -0500 | [diff] [blame] | 539 | .exit_latency = 33, |
| 540 | .target_residency = 100, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 541 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 542 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 543 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 544 | .name = "C6", |
Len Brown | 85a4d2d | 2013-01-31 14:40:49 -0500 | [diff] [blame] | 545 | .desc = "MWAIT 0x20", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 546 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 85a4d2d | 2013-01-31 14:40:49 -0500 | [diff] [blame] | 547 | .exit_latency = 133, |
| 548 | .target_residency = 400, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 549 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 550 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 551 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 552 | .name = "C7s", |
Len Brown | 85a4d2d | 2013-01-31 14:40:49 -0500 | [diff] [blame] | 553 | .desc = "MWAIT 0x32", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 554 | .flags = MWAIT2flg(0x32) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 85a4d2d | 2013-01-31 14:40:49 -0500 | [diff] [blame] | 555 | .exit_latency = 166, |
| 556 | .target_residency = 500, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 557 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 558 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 559 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 560 | .name = "C8", |
Len Brown | 86239ce | 2013-02-27 13:18:50 -0500 | [diff] [blame] | 561 | .desc = "MWAIT 0x40", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 562 | .flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 86239ce | 2013-02-27 13:18:50 -0500 | [diff] [blame] | 563 | .exit_latency = 300, |
| 564 | .target_residency = 900, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 565 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 566 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 86239ce | 2013-02-27 13:18:50 -0500 | [diff] [blame] | 567 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 568 | .name = "C9", |
Len Brown | 86239ce | 2013-02-27 13:18:50 -0500 | [diff] [blame] | 569 | .desc = "MWAIT 0x50", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 570 | .flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 86239ce | 2013-02-27 13:18:50 -0500 | [diff] [blame] | 571 | .exit_latency = 600, |
| 572 | .target_residency = 1800, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 573 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 574 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 86239ce | 2013-02-27 13:18:50 -0500 | [diff] [blame] | 575 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 576 | .name = "C10", |
Len Brown | 86239ce | 2013-02-27 13:18:50 -0500 | [diff] [blame] | 577 | .desc = "MWAIT 0x60", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 578 | .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 86239ce | 2013-02-27 13:18:50 -0500 | [diff] [blame] | 579 | .exit_latency = 2600, |
| 580 | .target_residency = 7700, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 581 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 582 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 86239ce | 2013-02-27 13:18:50 -0500 | [diff] [blame] | 583 | { |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 584 | .enter = NULL } |
Len Brown | 85a4d2d | 2013-01-31 14:40:49 -0500 | [diff] [blame] | 585 | }; |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 586 | static struct cpuidle_state bdw_cstates[] __initdata = { |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 587 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 588 | .name = "C1", |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 589 | .desc = "MWAIT 0x00", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 590 | .flags = MWAIT2flg(0x00), |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 591 | .exit_latency = 2, |
| 592 | .target_residency = 2, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 593 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 594 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 595 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 596 | .name = "C1E", |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 597 | .desc = "MWAIT 0x01", |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 598 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 599 | .exit_latency = 10, |
| 600 | .target_residency = 20, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 601 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 602 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 603 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 604 | .name = "C3", |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 605 | .desc = "MWAIT 0x10", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 606 | .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 607 | .exit_latency = 40, |
| 608 | .target_residency = 100, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 609 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 610 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 611 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 612 | .name = "C6", |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 613 | .desc = "MWAIT 0x20", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 614 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 615 | .exit_latency = 133, |
| 616 | .target_residency = 400, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 617 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 618 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 619 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 620 | .name = "C7s", |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 621 | .desc = "MWAIT 0x32", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 622 | .flags = MWAIT2flg(0x32) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 623 | .exit_latency = 166, |
| 624 | .target_residency = 500, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 625 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 626 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 627 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 628 | .name = "C8", |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 629 | .desc = "MWAIT 0x40", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 630 | .flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 631 | .exit_latency = 300, |
| 632 | .target_residency = 900, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 633 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 634 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 635 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 636 | .name = "C9", |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 637 | .desc = "MWAIT 0x50", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 638 | .flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 639 | .exit_latency = 600, |
| 640 | .target_residency = 1800, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 641 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 642 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 643 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 644 | .name = "C10", |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 645 | .desc = "MWAIT 0x60", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 646 | .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 647 | .exit_latency = 2600, |
| 648 | .target_residency = 7700, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 649 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 650 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 651 | { |
| 652 | .enter = NULL } |
| 653 | }; |
Len Brown | 85a4d2d | 2013-01-31 14:40:49 -0500 | [diff] [blame] | 654 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 655 | static struct cpuidle_state skl_cstates[] __initdata = { |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 656 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 657 | .name = "C1", |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 658 | .desc = "MWAIT 0x00", |
| 659 | .flags = MWAIT2flg(0x00), |
| 660 | .exit_latency = 2, |
| 661 | .target_residency = 2, |
| 662 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 663 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 664 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 665 | .name = "C1E", |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 666 | .desc = "MWAIT 0x01", |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 667 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE, |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 668 | .exit_latency = 10, |
| 669 | .target_residency = 20, |
| 670 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 671 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 672 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 673 | .name = "C3", |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 674 | .desc = "MWAIT 0x10", |
| 675 | .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 676 | .exit_latency = 70, |
| 677 | .target_residency = 100, |
| 678 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 679 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 680 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 681 | .name = "C6", |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 682 | .desc = "MWAIT 0x20", |
| 683 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 135919a | 2015-09-09 13:35:05 -0400 | [diff] [blame] | 684 | .exit_latency = 85, |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 685 | .target_residency = 200, |
| 686 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 687 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 688 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 689 | .name = "C7s", |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 690 | .desc = "MWAIT 0x33", |
| 691 | .flags = MWAIT2flg(0x33) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 692 | .exit_latency = 124, |
| 693 | .target_residency = 800, |
| 694 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 695 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 696 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 697 | .name = "C8", |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 698 | .desc = "MWAIT 0x40", |
| 699 | .flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 135919a | 2015-09-09 13:35:05 -0400 | [diff] [blame] | 700 | .exit_latency = 200, |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 701 | .target_residency = 800, |
| 702 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 703 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 704 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 705 | .name = "C9", |
Len Brown | 135919a | 2015-09-09 13:35:05 -0400 | [diff] [blame] | 706 | .desc = "MWAIT 0x50", |
| 707 | .flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 708 | .exit_latency = 480, |
| 709 | .target_residency = 5000, |
| 710 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 711 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 135919a | 2015-09-09 13:35:05 -0400 | [diff] [blame] | 712 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 713 | .name = "C10", |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 714 | .desc = "MWAIT 0x60", |
| 715 | .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 716 | .exit_latency = 890, |
| 717 | .target_residency = 5000, |
| 718 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 719 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 720 | { |
| 721 | .enter = NULL } |
| 722 | }; |
| 723 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 724 | static struct cpuidle_state skx_cstates[] __initdata = { |
Len Brown | f9e7165 | 2016-04-06 17:00:58 -0400 | [diff] [blame] | 725 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 726 | .name = "C1", |
Len Brown | f9e7165 | 2016-04-06 17:00:58 -0400 | [diff] [blame] | 727 | .desc = "MWAIT 0x00", |
| 728 | .flags = MWAIT2flg(0x00), |
| 729 | .exit_latency = 2, |
| 730 | .target_residency = 2, |
| 731 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 732 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | f9e7165 | 2016-04-06 17:00:58 -0400 | [diff] [blame] | 733 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 734 | .name = "C1E", |
Len Brown | f9e7165 | 2016-04-06 17:00:58 -0400 | [diff] [blame] | 735 | .desc = "MWAIT 0x01", |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 736 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE, |
Len Brown | f9e7165 | 2016-04-06 17:00:58 -0400 | [diff] [blame] | 737 | .exit_latency = 10, |
| 738 | .target_residency = 20, |
| 739 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 740 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | f9e7165 | 2016-04-06 17:00:58 -0400 | [diff] [blame] | 741 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 742 | .name = "C6", |
Len Brown | f9e7165 | 2016-04-06 17:00:58 -0400 | [diff] [blame] | 743 | .desc = "MWAIT 0x20", |
| 744 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 745 | .exit_latency = 133, |
| 746 | .target_residency = 600, |
| 747 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 748 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | f9e7165 | 2016-04-06 17:00:58 -0400 | [diff] [blame] | 749 | { |
| 750 | .enter = NULL } |
| 751 | }; |
| 752 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 753 | static struct cpuidle_state atom_cstates[] __initdata = { |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 754 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 755 | .name = "C1E", |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 756 | .desc = "MWAIT 0x00", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 757 | .flags = MWAIT2flg(0x00), |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 758 | .exit_latency = 10, |
| 759 | .target_residency = 20, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 760 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 761 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 762 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 763 | .name = "C2", |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 764 | .desc = "MWAIT 0x10", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 765 | .flags = MWAIT2flg(0x10), |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 766 | .exit_latency = 20, |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 767 | .target_residency = 80, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 768 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 769 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 770 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 771 | .name = "C4", |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 772 | .desc = "MWAIT 0x30", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 773 | .flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 774 | .exit_latency = 100, |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 775 | .target_residency = 400, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 776 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 777 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 778 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 779 | .name = "C6", |
Len Brown | 7fcca7d | 2010-10-05 13:43:14 -0400 | [diff] [blame] | 780 | .desc = "MWAIT 0x52", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 781 | .flags = MWAIT2flg(0x52) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | 7fcca7d | 2010-10-05 13:43:14 -0400 | [diff] [blame] | 782 | .exit_latency = 140, |
Len Brown | 7fcca7d | 2010-10-05 13:43:14 -0400 | [diff] [blame] | 783 | .target_residency = 560, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 784 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 785 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 786 | { |
| 787 | .enter = NULL } |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 788 | }; |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 789 | static struct cpuidle_state tangier_cstates[] __initdata = { |
Andy Shevchenko | 5e7ec26 | 2016-10-25 17:11:39 +0300 | [diff] [blame] | 790 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 791 | .name = "C1", |
Andy Shevchenko | 5e7ec26 | 2016-10-25 17:11:39 +0300 | [diff] [blame] | 792 | .desc = "MWAIT 0x00", |
| 793 | .flags = MWAIT2flg(0x00), |
| 794 | .exit_latency = 1, |
| 795 | .target_residency = 4, |
| 796 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 797 | .enter_s2idle = intel_idle_s2idle, }, |
Andy Shevchenko | 5e7ec26 | 2016-10-25 17:11:39 +0300 | [diff] [blame] | 798 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 799 | .name = "C4", |
Andy Shevchenko | 5e7ec26 | 2016-10-25 17:11:39 +0300 | [diff] [blame] | 800 | .desc = "MWAIT 0x30", |
| 801 | .flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 802 | .exit_latency = 100, |
| 803 | .target_residency = 400, |
| 804 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 805 | .enter_s2idle = intel_idle_s2idle, }, |
Andy Shevchenko | 5e7ec26 | 2016-10-25 17:11:39 +0300 | [diff] [blame] | 806 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 807 | .name = "C6", |
Andy Shevchenko | 5e7ec26 | 2016-10-25 17:11:39 +0300 | [diff] [blame] | 808 | .desc = "MWAIT 0x52", |
| 809 | .flags = MWAIT2flg(0x52) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 810 | .exit_latency = 140, |
| 811 | .target_residency = 560, |
| 812 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 813 | .enter_s2idle = intel_idle_s2idle, }, |
Andy Shevchenko | 5e7ec26 | 2016-10-25 17:11:39 +0300 | [diff] [blame] | 814 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 815 | .name = "C7", |
Andy Shevchenko | 5e7ec26 | 2016-10-25 17:11:39 +0300 | [diff] [blame] | 816 | .desc = "MWAIT 0x60", |
| 817 | .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 818 | .exit_latency = 1200, |
| 819 | .target_residency = 4000, |
| 820 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 821 | .enter_s2idle = intel_idle_s2idle, }, |
Andy Shevchenko | 5e7ec26 | 2016-10-25 17:11:39 +0300 | [diff] [blame] | 822 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 823 | .name = "C9", |
Andy Shevchenko | 5e7ec26 | 2016-10-25 17:11:39 +0300 | [diff] [blame] | 824 | .desc = "MWAIT 0x64", |
| 825 | .flags = MWAIT2flg(0x64) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 826 | .exit_latency = 10000, |
| 827 | .target_residency = 20000, |
| 828 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 829 | .enter_s2idle = intel_idle_s2idle, }, |
Andy Shevchenko | 5e7ec26 | 2016-10-25 17:11:39 +0300 | [diff] [blame] | 830 | { |
| 831 | .enter = NULL } |
| 832 | }; |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 833 | static struct cpuidle_state avn_cstates[] __initdata = { |
Len Brown | fab04b2 | 2013-11-09 00:30:17 -0500 | [diff] [blame] | 834 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 835 | .name = "C1", |
Len Brown | fab04b2 | 2013-11-09 00:30:17 -0500 | [diff] [blame] | 836 | .desc = "MWAIT 0x00", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 837 | .flags = MWAIT2flg(0x00), |
Len Brown | fab04b2 | 2013-11-09 00:30:17 -0500 | [diff] [blame] | 838 | .exit_latency = 2, |
| 839 | .target_residency = 2, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 840 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 841 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | fab04b2 | 2013-11-09 00:30:17 -0500 | [diff] [blame] | 842 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 843 | .name = "C6", |
Len Brown | fab04b2 | 2013-11-09 00:30:17 -0500 | [diff] [blame] | 844 | .desc = "MWAIT 0x51", |
Daniel Lezcano | b82b6cc | 2014-11-12 16:03:50 +0100 | [diff] [blame] | 845 | .flags = MWAIT2flg(0x51) | CPUIDLE_FLAG_TLB_FLUSHED, |
Len Brown | fab04b2 | 2013-11-09 00:30:17 -0500 | [diff] [blame] | 846 | .exit_latency = 15, |
| 847 | .target_residency = 45, |
Rafael J. Wysocki | 5fe2e52 | 2015-02-11 05:04:17 +0100 | [diff] [blame] | 848 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 849 | .enter_s2idle = intel_idle_s2idle, }, |
Jiang Liu | 8839099 | 2014-01-09 15:30:27 +0800 | [diff] [blame] | 850 | { |
| 851 | .enter = NULL } |
Len Brown | fab04b2 | 2013-11-09 00:30:17 -0500 | [diff] [blame] | 852 | }; |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 853 | static struct cpuidle_state knl_cstates[] __initdata = { |
Dasaratharaman Chandramouli | 281baf7 | 2014-09-04 17:22:54 -0700 | [diff] [blame] | 854 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 855 | .name = "C1", |
Dasaratharaman Chandramouli | 281baf7 | 2014-09-04 17:22:54 -0700 | [diff] [blame] | 856 | .desc = "MWAIT 0x00", |
| 857 | .flags = MWAIT2flg(0x00), |
| 858 | .exit_latency = 1, |
| 859 | .target_residency = 2, |
| 860 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 861 | .enter_s2idle = intel_idle_s2idle }, |
Dasaratharaman Chandramouli | 281baf7 | 2014-09-04 17:22:54 -0700 | [diff] [blame] | 862 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 863 | .name = "C6", |
Dasaratharaman Chandramouli | 281baf7 | 2014-09-04 17:22:54 -0700 | [diff] [blame] | 864 | .desc = "MWAIT 0x10", |
| 865 | .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 866 | .exit_latency = 120, |
| 867 | .target_residency = 500, |
| 868 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 869 | .enter_s2idle = intel_idle_s2idle }, |
Dasaratharaman Chandramouli | 281baf7 | 2014-09-04 17:22:54 -0700 | [diff] [blame] | 870 | { |
| 871 | .enter = NULL } |
| 872 | }; |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 873 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 874 | static struct cpuidle_state bxt_cstates[] __initdata = { |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 875 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 876 | .name = "C1", |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 877 | .desc = "MWAIT 0x00", |
| 878 | .flags = MWAIT2flg(0x00), |
| 879 | .exit_latency = 2, |
| 880 | .target_residency = 2, |
| 881 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 882 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 883 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 884 | .name = "C1E", |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 885 | .desc = "MWAIT 0x01", |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 886 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE, |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 887 | .exit_latency = 10, |
| 888 | .target_residency = 20, |
| 889 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 890 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 891 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 892 | .name = "C6", |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 893 | .desc = "MWAIT 0x20", |
| 894 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 895 | .exit_latency = 133, |
| 896 | .target_residency = 133, |
| 897 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 898 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 899 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 900 | .name = "C7s", |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 901 | .desc = "MWAIT 0x31", |
| 902 | .flags = MWAIT2flg(0x31) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 903 | .exit_latency = 155, |
| 904 | .target_residency = 155, |
| 905 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 906 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 907 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 908 | .name = "C8", |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 909 | .desc = "MWAIT 0x40", |
| 910 | .flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 911 | .exit_latency = 1000, |
| 912 | .target_residency = 1000, |
| 913 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 914 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 915 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 916 | .name = "C9", |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 917 | .desc = "MWAIT 0x50", |
| 918 | .flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 919 | .exit_latency = 2000, |
| 920 | .target_residency = 2000, |
| 921 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 922 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 923 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 924 | .name = "C10", |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 925 | .desc = "MWAIT 0x60", |
| 926 | .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 927 | .exit_latency = 10000, |
| 928 | .target_residency = 10000, |
| 929 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 930 | .enter_s2idle = intel_idle_s2idle, }, |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 931 | { |
| 932 | .enter = NULL } |
| 933 | }; |
| 934 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 935 | static struct cpuidle_state dnv_cstates[] __initdata = { |
Jacob Pan | 0080d65 | 2016-06-17 01:28:34 -0400 | [diff] [blame] | 936 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 937 | .name = "C1", |
Jacob Pan | 0080d65 | 2016-06-17 01:28:34 -0400 | [diff] [blame] | 938 | .desc = "MWAIT 0x00", |
| 939 | .flags = MWAIT2flg(0x00), |
| 940 | .exit_latency = 2, |
| 941 | .target_residency = 2, |
| 942 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 943 | .enter_s2idle = intel_idle_s2idle, }, |
Jacob Pan | 0080d65 | 2016-06-17 01:28:34 -0400 | [diff] [blame] | 944 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 945 | .name = "C1E", |
Jacob Pan | 0080d65 | 2016-06-17 01:28:34 -0400 | [diff] [blame] | 946 | .desc = "MWAIT 0x01", |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 947 | .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE, |
Jacob Pan | 0080d65 | 2016-06-17 01:28:34 -0400 | [diff] [blame] | 948 | .exit_latency = 10, |
| 949 | .target_residency = 20, |
| 950 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 951 | .enter_s2idle = intel_idle_s2idle, }, |
Jacob Pan | 0080d65 | 2016-06-17 01:28:34 -0400 | [diff] [blame] | 952 | { |
Len Brown | de09cdd | 2017-02-28 16:32:44 -0500 | [diff] [blame] | 953 | .name = "C6", |
Jacob Pan | 0080d65 | 2016-06-17 01:28:34 -0400 | [diff] [blame] | 954 | .desc = "MWAIT 0x20", |
| 955 | .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED, |
| 956 | .exit_latency = 50, |
| 957 | .target_residency = 500, |
| 958 | .enter = &intel_idle, |
Rafael J. Wysocki | 28ba086 | 2017-08-10 00:14:45 +0200 | [diff] [blame] | 959 | .enter_s2idle = intel_idle_s2idle, }, |
Jacob Pan | 0080d65 | 2016-06-17 01:28:34 -0400 | [diff] [blame] | 960 | { |
| 961 | .enter = NULL } |
| 962 | }; |
| 963 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 964 | static const struct idle_cpu idle_cpu_nehalem __initconst = { |
Andi Kleen | b66b8b9 | 2012-01-26 00:09:07 +0100 | [diff] [blame] | 965 | .state_table = nehalem_cstates, |
Andi Kleen | b66b8b9 | 2012-01-26 00:09:07 +0100 | [diff] [blame] | 966 | .auto_demotion_disable_flags = NHM_C1_AUTO_DEMOTE | NHM_C3_AUTO_DEMOTE, |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 967 | .disable_promotion_to_c1e = true, |
Andi Kleen | b66b8b9 | 2012-01-26 00:09:07 +0100 | [diff] [blame] | 968 | }; |
| 969 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 970 | static const struct idle_cpu idle_cpu_nhx __initconst = { |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 971 | .state_table = nehalem_cstates, |
| 972 | .auto_demotion_disable_flags = NHM_C1_AUTO_DEMOTE | NHM_C3_AUTO_DEMOTE, |
| 973 | .disable_promotion_to_c1e = true, |
| 974 | .use_acpi = true, |
| 975 | }; |
| 976 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 977 | static const struct idle_cpu idle_cpu_atom __initconst = { |
Andi Kleen | b66b8b9 | 2012-01-26 00:09:07 +0100 | [diff] [blame] | 978 | .state_table = atom_cstates, |
| 979 | }; |
| 980 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 981 | static const struct idle_cpu idle_cpu_tangier __initconst = { |
Andy Shevchenko | 5e7ec26 | 2016-10-25 17:11:39 +0300 | [diff] [blame] | 982 | .state_table = tangier_cstates, |
| 983 | }; |
| 984 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 985 | static const struct idle_cpu idle_cpu_lincroft __initconst = { |
Andi Kleen | b66b8b9 | 2012-01-26 00:09:07 +0100 | [diff] [blame] | 986 | .state_table = atom_cstates, |
| 987 | .auto_demotion_disable_flags = ATM_LNC_C6_AUTO_DEMOTE, |
| 988 | }; |
| 989 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 990 | static const struct idle_cpu idle_cpu_snb __initconst = { |
Andi Kleen | b66b8b9 | 2012-01-26 00:09:07 +0100 | [diff] [blame] | 991 | .state_table = snb_cstates, |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 992 | .disable_promotion_to_c1e = true, |
Andi Kleen | b66b8b9 | 2012-01-26 00:09:07 +0100 | [diff] [blame] | 993 | }; |
| 994 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 995 | static const struct idle_cpu idle_cpu_snx __initconst = { |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 996 | .state_table = snb_cstates, |
| 997 | .disable_promotion_to_c1e = true, |
| 998 | .use_acpi = true, |
| 999 | }; |
| 1000 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1001 | static const struct idle_cpu idle_cpu_byt __initconst = { |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 1002 | .state_table = byt_cstates, |
| 1003 | .disable_promotion_to_c1e = true, |
Len Brown | 8c058d53 | 2014-07-31 15:21:24 -0400 | [diff] [blame] | 1004 | .byt_auto_demotion_disable_flag = true, |
Len Brown | 718987d | 2014-02-14 02:30:00 -0500 | [diff] [blame] | 1005 | }; |
| 1006 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1007 | static const struct idle_cpu idle_cpu_cht __initconst = { |
Len Brown | cab07a5 | 2015-03-27 20:54:01 -0400 | [diff] [blame] | 1008 | .state_table = cht_cstates, |
| 1009 | .disable_promotion_to_c1e = true, |
| 1010 | .byt_auto_demotion_disable_flag = true, |
| 1011 | }; |
| 1012 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1013 | static const struct idle_cpu idle_cpu_ivb __initconst = { |
Len Brown | 6edab08 | 2012-06-01 19:45:32 -0400 | [diff] [blame] | 1014 | .state_table = ivb_cstates, |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 1015 | .disable_promotion_to_c1e = true, |
Len Brown | 6edab08 | 2012-06-01 19:45:32 -0400 | [diff] [blame] | 1016 | }; |
| 1017 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1018 | static const struct idle_cpu idle_cpu_ivt __initconst = { |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 1019 | .state_table = ivt_cstates, |
| 1020 | .disable_promotion_to_c1e = true, |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 1021 | .use_acpi = true, |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 1022 | }; |
| 1023 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1024 | static const struct idle_cpu idle_cpu_hsw __initconst = { |
Len Brown | 85a4d2d | 2013-01-31 14:40:49 -0500 | [diff] [blame] | 1025 | .state_table = hsw_cstates, |
Len Brown | 32e9518 | 2013-02-02 01:31:56 -0500 | [diff] [blame] | 1026 | .disable_promotion_to_c1e = true, |
Len Brown | 85a4d2d | 2013-01-31 14:40:49 -0500 | [diff] [blame] | 1027 | }; |
| 1028 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1029 | static const struct idle_cpu idle_cpu_hsx __initconst = { |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 1030 | .state_table = hsw_cstates, |
| 1031 | .disable_promotion_to_c1e = true, |
| 1032 | .use_acpi = true, |
| 1033 | }; |
| 1034 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1035 | static const struct idle_cpu idle_cpu_bdw __initconst = { |
Len Brown | a138b56 | 2014-02-04 23:56:40 -0500 | [diff] [blame] | 1036 | .state_table = bdw_cstates, |
| 1037 | .disable_promotion_to_c1e = true, |
| 1038 | }; |
| 1039 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1040 | static const struct idle_cpu idle_cpu_bdx __initconst = { |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 1041 | .state_table = bdw_cstates, |
| 1042 | .disable_promotion_to_c1e = true, |
| 1043 | .use_acpi = true, |
| 1044 | }; |
| 1045 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1046 | static const struct idle_cpu idle_cpu_skl __initconst = { |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 1047 | .state_table = skl_cstates, |
| 1048 | .disable_promotion_to_c1e = true, |
| 1049 | }; |
| 1050 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1051 | static const struct idle_cpu idle_cpu_skx __initconst = { |
Len Brown | f9e7165 | 2016-04-06 17:00:58 -0400 | [diff] [blame] | 1052 | .state_table = skx_cstates, |
| 1053 | .disable_promotion_to_c1e = true, |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 1054 | .use_acpi = true, |
Len Brown | f9e7165 | 2016-04-06 17:00:58 -0400 | [diff] [blame] | 1055 | }; |
Len Brown | 493f133 | 2015-03-25 23:20:37 -0400 | [diff] [blame] | 1056 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1057 | static const struct idle_cpu idle_cpu_avn __initconst = { |
Len Brown | fab04b2 | 2013-11-09 00:30:17 -0500 | [diff] [blame] | 1058 | .state_table = avn_cstates, |
| 1059 | .disable_promotion_to_c1e = true, |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 1060 | .use_acpi = true, |
Len Brown | fab04b2 | 2013-11-09 00:30:17 -0500 | [diff] [blame] | 1061 | }; |
| 1062 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1063 | static const struct idle_cpu idle_cpu_knl __initconst = { |
Dasaratharaman Chandramouli | 281baf7 | 2014-09-04 17:22:54 -0700 | [diff] [blame] | 1064 | .state_table = knl_cstates, |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 1065 | .use_acpi = true, |
Dasaratharaman Chandramouli | 281baf7 | 2014-09-04 17:22:54 -0700 | [diff] [blame] | 1066 | }; |
| 1067 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1068 | static const struct idle_cpu idle_cpu_bxt __initconst = { |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1069 | .state_table = bxt_cstates, |
| 1070 | .disable_promotion_to_c1e = true, |
| 1071 | }; |
| 1072 | |
Rafael J. Wysocki | ab1a8522 | 2020-02-06 18:45:06 +0100 | [diff] [blame] | 1073 | static const struct idle_cpu idle_cpu_dnv __initconst = { |
Jacob Pan | 0080d65 | 2016-06-17 01:28:34 -0400 | [diff] [blame] | 1074 | .state_table = dnv_cstates, |
| 1075 | .disable_promotion_to_c1e = true, |
Rafael J. Wysocki | e6d4f08 | 2019-12-13 09:56:38 +0100 | [diff] [blame] | 1076 | .use_acpi = true, |
Jacob Pan | 0080d65 | 2016-06-17 01:28:34 -0400 | [diff] [blame] | 1077 | }; |
| 1078 | |
Mathias Krause | d5cdc3c | 2015-03-25 22:15:14 +0100 | [diff] [blame] | 1079 | static const struct x86_cpu_id intel_idle_ids[] __initconst = { |
Thomas Gleixner | 4a9f45a | 2020-03-20 14:14:00 +0100 | [diff] [blame] | 1080 | X86_MATCH_INTEL_FAM6_MODEL(NEHALEM_EP, &idle_cpu_nhx), |
| 1081 | X86_MATCH_INTEL_FAM6_MODEL(NEHALEM, &idle_cpu_nehalem), |
| 1082 | X86_MATCH_INTEL_FAM6_MODEL(NEHALEM_G, &idle_cpu_nehalem), |
| 1083 | X86_MATCH_INTEL_FAM6_MODEL(WESTMERE, &idle_cpu_nehalem), |
| 1084 | X86_MATCH_INTEL_FAM6_MODEL(WESTMERE_EP, &idle_cpu_nhx), |
| 1085 | X86_MATCH_INTEL_FAM6_MODEL(NEHALEM_EX, &idle_cpu_nhx), |
| 1086 | X86_MATCH_INTEL_FAM6_MODEL(ATOM_BONNELL, &idle_cpu_atom), |
| 1087 | X86_MATCH_INTEL_FAM6_MODEL(ATOM_BONNELL_MID, &idle_cpu_lincroft), |
| 1088 | X86_MATCH_INTEL_FAM6_MODEL(WESTMERE_EX, &idle_cpu_nhx), |
| 1089 | X86_MATCH_INTEL_FAM6_MODEL(SANDYBRIDGE, &idle_cpu_snb), |
| 1090 | X86_MATCH_INTEL_FAM6_MODEL(SANDYBRIDGE_X, &idle_cpu_snx), |
| 1091 | X86_MATCH_INTEL_FAM6_MODEL(ATOM_SALTWELL, &idle_cpu_atom), |
| 1092 | X86_MATCH_INTEL_FAM6_MODEL(ATOM_SILVERMONT, &idle_cpu_byt), |
| 1093 | X86_MATCH_INTEL_FAM6_MODEL(ATOM_SILVERMONT_MID, &idle_cpu_tangier), |
| 1094 | X86_MATCH_INTEL_FAM6_MODEL(ATOM_AIRMONT, &idle_cpu_cht), |
| 1095 | X86_MATCH_INTEL_FAM6_MODEL(IVYBRIDGE, &idle_cpu_ivb), |
| 1096 | X86_MATCH_INTEL_FAM6_MODEL(IVYBRIDGE_X, &idle_cpu_ivt), |
| 1097 | X86_MATCH_INTEL_FAM6_MODEL(HASWELL, &idle_cpu_hsw), |
| 1098 | X86_MATCH_INTEL_FAM6_MODEL(HASWELL_X, &idle_cpu_hsx), |
| 1099 | X86_MATCH_INTEL_FAM6_MODEL(HASWELL_L, &idle_cpu_hsw), |
| 1100 | X86_MATCH_INTEL_FAM6_MODEL(HASWELL_G, &idle_cpu_hsw), |
| 1101 | X86_MATCH_INTEL_FAM6_MODEL(ATOM_SILVERMONT_D, &idle_cpu_avn), |
| 1102 | X86_MATCH_INTEL_FAM6_MODEL(BROADWELL, &idle_cpu_bdw), |
| 1103 | X86_MATCH_INTEL_FAM6_MODEL(BROADWELL_G, &idle_cpu_bdw), |
| 1104 | X86_MATCH_INTEL_FAM6_MODEL(BROADWELL_X, &idle_cpu_bdx), |
| 1105 | X86_MATCH_INTEL_FAM6_MODEL(BROADWELL_D, &idle_cpu_bdx), |
| 1106 | X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_L, &idle_cpu_skl), |
| 1107 | X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE, &idle_cpu_skl), |
| 1108 | X86_MATCH_INTEL_FAM6_MODEL(KABYLAKE_L, &idle_cpu_skl), |
| 1109 | X86_MATCH_INTEL_FAM6_MODEL(KABYLAKE, &idle_cpu_skl), |
| 1110 | X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_X, &idle_cpu_skx), |
| 1111 | X86_MATCH_INTEL_FAM6_MODEL(XEON_PHI_KNL, &idle_cpu_knl), |
| 1112 | X86_MATCH_INTEL_FAM6_MODEL(XEON_PHI_KNM, &idle_cpu_knl), |
| 1113 | X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT, &idle_cpu_bxt), |
| 1114 | X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT_PLUS, &idle_cpu_bxt), |
| 1115 | X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT_D, &idle_cpu_dnv), |
| 1116 | X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_D, &idle_cpu_dnv), |
Andi Kleen | b66b8b9 | 2012-01-26 00:09:07 +0100 | [diff] [blame] | 1117 | {} |
| 1118 | }; |
Andi Kleen | b66b8b9 | 2012-01-26 00:09:07 +0100 | [diff] [blame] | 1119 | |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1120 | static const struct x86_cpu_id intel_mwait_ids[] __initconst = { |
Thomas Gleixner | 4a9f45a | 2020-03-20 14:14:00 +0100 | [diff] [blame] | 1121 | X86_MATCH_VENDOR_FAM_FEATURE(INTEL, 6, X86_FEATURE_MWAIT, NULL), |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1122 | {} |
| 1123 | }; |
| 1124 | |
Rafael J. Wysocki | 095928a | 2020-01-10 11:51:22 +0100 | [diff] [blame] | 1125 | static bool __init intel_idle_max_cstate_reached(int cstate) |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1126 | { |
| 1127 | if (cstate + 1 > max_cstate) { |
| 1128 | pr_info("max_cstate %d reached\n", max_cstate); |
| 1129 | return true; |
| 1130 | } |
| 1131 | return false; |
| 1132 | } |
| 1133 | |
| 1134 | #ifdef CONFIG_ACPI_PROCESSOR_CSTATE |
| 1135 | #include <acpi/processor.h> |
| 1136 | |
Rafael J. Wysocki | 4ec32d9 | 2019-12-13 09:56:29 +0100 | [diff] [blame] | 1137 | static bool no_acpi __read_mostly; |
| 1138 | module_param(no_acpi, bool, 0444); |
| 1139 | MODULE_PARM_DESC(no_acpi, "Do not use ACPI _CST for building the idle states list"); |
| 1140 | |
Rafael J. Wysocki | 3a5be9b | 2020-02-03 11:57:08 +0100 | [diff] [blame] | 1141 | static bool force_use_acpi __read_mostly; /* No effect if no_acpi is set. */ |
| 1142 | module_param_named(use_acpi, force_use_acpi, bool, 0444); |
| 1143 | MODULE_PARM_DESC(use_acpi, "Use ACPI _CST for building the idle states list"); |
| 1144 | |
Rafael J. Wysocki | 095928a | 2020-01-10 11:51:22 +0100 | [diff] [blame] | 1145 | static struct acpi_processor_power acpi_state_table __initdata; |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1146 | |
| 1147 | /** |
| 1148 | * intel_idle_cst_usable - Check if the _CST information can be used. |
| 1149 | * |
| 1150 | * Check if all of the C-states listed by _CST in the max_cstate range are |
| 1151 | * ACPI_CSTATE_FFH, which means that they should be entered via MWAIT. |
| 1152 | */ |
Rafael J. Wysocki | 095928a | 2020-01-10 11:51:22 +0100 | [diff] [blame] | 1153 | static bool __init intel_idle_cst_usable(void) |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1154 | { |
| 1155 | int cstate, limit; |
| 1156 | |
| 1157 | limit = min_t(int, min_t(int, CPUIDLE_STATE_MAX, max_cstate + 1), |
| 1158 | acpi_state_table.count); |
| 1159 | |
| 1160 | for (cstate = 1; cstate < limit; cstate++) { |
| 1161 | struct acpi_processor_cx *cx = &acpi_state_table.states[cstate]; |
| 1162 | |
| 1163 | if (cx->entry_method != ACPI_CSTATE_FFH) |
| 1164 | return false; |
| 1165 | } |
| 1166 | |
| 1167 | return true; |
| 1168 | } |
| 1169 | |
Rafael J. Wysocki | 095928a | 2020-01-10 11:51:22 +0100 | [diff] [blame] | 1170 | static bool __init intel_idle_acpi_cst_extract(void) |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1171 | { |
| 1172 | unsigned int cpu; |
| 1173 | |
Rafael J. Wysocki | 4ec32d9 | 2019-12-13 09:56:29 +0100 | [diff] [blame] | 1174 | if (no_acpi) { |
| 1175 | pr_debug("Not allowed to use ACPI _CST\n"); |
| 1176 | return false; |
| 1177 | } |
| 1178 | |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1179 | for_each_possible_cpu(cpu) { |
| 1180 | struct acpi_processor *pr = per_cpu(processors, cpu); |
| 1181 | |
| 1182 | if (!pr) |
| 1183 | continue; |
| 1184 | |
| 1185 | if (acpi_processor_evaluate_cst(pr->handle, cpu, &acpi_state_table)) |
| 1186 | continue; |
| 1187 | |
| 1188 | acpi_state_table.count++; |
| 1189 | |
| 1190 | if (!intel_idle_cst_usable()) |
| 1191 | continue; |
| 1192 | |
| 1193 | if (!acpi_processor_claim_cst_control()) { |
| 1194 | acpi_state_table.count = 0; |
| 1195 | return false; |
| 1196 | } |
| 1197 | |
| 1198 | return true; |
| 1199 | } |
| 1200 | |
| 1201 | pr_debug("ACPI _CST not found or not usable\n"); |
| 1202 | return false; |
| 1203 | } |
| 1204 | |
Rafael J. Wysocki | 095928a | 2020-01-10 11:51:22 +0100 | [diff] [blame] | 1205 | static void __init intel_idle_init_cstates_acpi(struct cpuidle_driver *drv) |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1206 | { |
| 1207 | int cstate, limit = min_t(int, CPUIDLE_STATE_MAX, acpi_state_table.count); |
| 1208 | |
| 1209 | /* |
| 1210 | * If limit > 0, intel_idle_cst_usable() has returned 'true', so all of |
| 1211 | * the interesting states are ACPI_CSTATE_FFH. |
| 1212 | */ |
| 1213 | for (cstate = 1; cstate < limit; cstate++) { |
| 1214 | struct acpi_processor_cx *cx; |
| 1215 | struct cpuidle_state *state; |
| 1216 | |
| 1217 | if (intel_idle_max_cstate_reached(cstate)) |
| 1218 | break; |
| 1219 | |
| 1220 | cx = &acpi_state_table.states[cstate]; |
| 1221 | |
| 1222 | state = &drv->states[drv->state_count++]; |
| 1223 | |
| 1224 | snprintf(state->name, CPUIDLE_NAME_LEN, "C%d_ACPI", cstate); |
| 1225 | strlcpy(state->desc, cx->desc, CPUIDLE_DESC_LEN); |
| 1226 | state->exit_latency = cx->latency; |
| 1227 | /* |
| 1228 | * For C1-type C-states use the same number for both the exit |
| 1229 | * latency and target residency, because that is the case for |
| 1230 | * C1 in the majority of the static C-states tables above. |
| 1231 | * For the other types of C-states, however, set the target |
| 1232 | * residency to 3 times the exit latency which should lead to |
| 1233 | * a reasonable balance between energy-efficiency and |
| 1234 | * performance in the majority of interesting cases. |
| 1235 | */ |
| 1236 | state->target_residency = cx->latency; |
| 1237 | if (cx->type > ACPI_STATE_C1) |
| 1238 | state->target_residency *= 3; |
| 1239 | |
| 1240 | state->flags = MWAIT2flg(cx->address); |
| 1241 | if (cx->type > ACPI_STATE_C2) |
| 1242 | state->flags |= CPUIDLE_FLAG_TLB_FLUSHED; |
| 1243 | |
Rafael J. Wysocki | 4dcb78e | 2020-02-03 11:57:18 +0100 | [diff] [blame] | 1244 | if (disabled_states_mask & BIT(cstate)) |
| 1245 | state->flags |= CPUIDLE_FLAG_OFF; |
| 1246 | |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1247 | state->enter = intel_idle; |
| 1248 | state->enter_s2idle = intel_idle_s2idle; |
| 1249 | } |
| 1250 | } |
Rafael J. Wysocki | bff8e60 | 2019-12-13 09:56:21 +0100 | [diff] [blame] | 1251 | |
Rafael J. Wysocki | 095928a | 2020-01-10 11:51:22 +0100 | [diff] [blame] | 1252 | static bool __init intel_idle_off_by_default(u32 mwait_hint) |
Rafael J. Wysocki | bff8e60 | 2019-12-13 09:56:21 +0100 | [diff] [blame] | 1253 | { |
| 1254 | int cstate, limit; |
| 1255 | |
| 1256 | /* |
| 1257 | * If there are no _CST C-states, do not disable any C-states by |
| 1258 | * default. |
| 1259 | */ |
| 1260 | if (!acpi_state_table.count) |
| 1261 | return false; |
| 1262 | |
| 1263 | limit = min_t(int, CPUIDLE_STATE_MAX, acpi_state_table.count); |
| 1264 | /* |
| 1265 | * If limit > 0, intel_idle_cst_usable() has returned 'true', so all of |
| 1266 | * the interesting states are ACPI_CSTATE_FFH. |
| 1267 | */ |
| 1268 | for (cstate = 1; cstate < limit; cstate++) { |
| 1269 | if (acpi_state_table.states[cstate].address == mwait_hint) |
| 1270 | return false; |
| 1271 | } |
| 1272 | return true; |
| 1273 | } |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1274 | #else /* !CONFIG_ACPI_PROCESSOR_CSTATE */ |
Rafael J. Wysocki | 3a5be9b | 2020-02-03 11:57:08 +0100 | [diff] [blame] | 1275 | #define force_use_acpi (false) |
| 1276 | |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1277 | static inline bool intel_idle_acpi_cst_extract(void) { return false; } |
| 1278 | static inline void intel_idle_init_cstates_acpi(struct cpuidle_driver *drv) { } |
Rafael J. Wysocki | bff8e60 | 2019-12-13 09:56:21 +0100 | [diff] [blame] | 1279 | static inline bool intel_idle_off_by_default(u32 mwait_hint) { return false; } |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1280 | #endif /* !CONFIG_ACPI_PROCESSOR_CSTATE */ |
| 1281 | |
Rafael J. Wysocki | 6eacb15 | 2020-02-06 18:45:29 +0100 | [diff] [blame] | 1282 | /** |
| 1283 | * ivt_idle_state_table_update - Tune the idle states table for Ivy Town. |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1284 | * |
Rafael J. Wysocki | 6eacb15 | 2020-02-06 18:45:29 +0100 | [diff] [blame] | 1285 | * Tune IVT multi-socket targets. |
| 1286 | * Assumption: num_sockets == (max_package_num + 1). |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1287 | */ |
Rafael J. Wysocki | 095928a | 2020-01-10 11:51:22 +0100 | [diff] [blame] | 1288 | static void __init ivt_idle_state_table_update(void) |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1289 | { |
| 1290 | /* IVT uses a different table for 1-2, 3-4, and > 4 sockets */ |
| 1291 | int cpu, package_num, num_sockets = 1; |
| 1292 | |
| 1293 | for_each_online_cpu(cpu) { |
| 1294 | package_num = topology_physical_package_id(cpu); |
| 1295 | if (package_num + 1 > num_sockets) { |
| 1296 | num_sockets = package_num + 1; |
| 1297 | |
| 1298 | if (num_sockets > 4) { |
| 1299 | cpuidle_state_table = ivt_cstates_8s; |
| 1300 | return; |
| 1301 | } |
| 1302 | } |
| 1303 | } |
| 1304 | |
| 1305 | if (num_sockets > 2) |
| 1306 | cpuidle_state_table = ivt_cstates_4s; |
| 1307 | |
| 1308 | /* else, 1 and 2 socket systems use default ivt_cstates */ |
| 1309 | } |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1310 | |
Rafael J. Wysocki | 86e9466 | 2020-01-17 11:46:24 +0100 | [diff] [blame] | 1311 | /** |
| 1312 | * irtl_2_usec - IRTL to microseconds conversion. |
| 1313 | * @irtl: IRTL MSR value. |
| 1314 | * |
| 1315 | * Translate the IRTL (Interrupt Response Time Limit) MSR value to microseconds. |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1316 | */ |
Rafael J. Wysocki | 095928a | 2020-01-10 11:51:22 +0100 | [diff] [blame] | 1317 | static unsigned long long __init irtl_2_usec(unsigned long long irtl) |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1318 | { |
Rafael J. Wysocki | 86e9466 | 2020-01-17 11:46:24 +0100 | [diff] [blame] | 1319 | static const unsigned int irtl_ns_units[] __initconst = { |
| 1320 | 1, 32, 1024, 32768, 1048576, 33554432, 0, 0 |
| 1321 | }; |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1322 | unsigned long long ns; |
| 1323 | |
Jan Beulich | 3451ab3 | 2016-06-27 00:35:12 -0600 | [diff] [blame] | 1324 | if (!irtl) |
| 1325 | return 0; |
| 1326 | |
Jan Beulich | bef4509 | 2016-06-27 00:35:48 -0600 | [diff] [blame] | 1327 | ns = irtl_ns_units[(irtl >> 10) & 0x7]; |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1328 | |
Rafael J. Wysocki | 86e9466 | 2020-01-17 11:46:24 +0100 | [diff] [blame] | 1329 | return div_u64((irtl & 0x3FF) * ns, NSEC_PER_USEC); |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1330 | } |
Rafael J. Wysocki | 86e9466 | 2020-01-17 11:46:24 +0100 | [diff] [blame] | 1331 | |
Rafael J. Wysocki | 6eacb15 | 2020-02-06 18:45:29 +0100 | [diff] [blame] | 1332 | /** |
| 1333 | * bxt_idle_state_table_update - Fix up the Broxton idle states table. |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1334 | * |
Rafael J. Wysocki | 6eacb15 | 2020-02-06 18:45:29 +0100 | [diff] [blame] | 1335 | * On BXT, trust the IRTL (Interrupt Response Time Limit) MSR to show the |
| 1336 | * definitive maximum latency and use the same value for target_residency. |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1337 | */ |
Rafael J. Wysocki | 095928a | 2020-01-10 11:51:22 +0100 | [diff] [blame] | 1338 | static void __init bxt_idle_state_table_update(void) |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1339 | { |
| 1340 | unsigned long long msr; |
Jan Beulich | 3451ab3 | 2016-06-27 00:35:12 -0600 | [diff] [blame] | 1341 | unsigned int usec; |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1342 | |
| 1343 | rdmsrl(MSR_PKGC6_IRTL, msr); |
Jan Beulich | 3451ab3 | 2016-06-27 00:35:12 -0600 | [diff] [blame] | 1344 | usec = irtl_2_usec(msr); |
| 1345 | if (usec) { |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1346 | bxt_cstates[2].exit_latency = usec; |
| 1347 | bxt_cstates[2].target_residency = usec; |
| 1348 | } |
| 1349 | |
| 1350 | rdmsrl(MSR_PKGC7_IRTL, msr); |
Jan Beulich | 3451ab3 | 2016-06-27 00:35:12 -0600 | [diff] [blame] | 1351 | usec = irtl_2_usec(msr); |
| 1352 | if (usec) { |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1353 | bxt_cstates[3].exit_latency = usec; |
| 1354 | bxt_cstates[3].target_residency = usec; |
| 1355 | } |
| 1356 | |
| 1357 | rdmsrl(MSR_PKGC8_IRTL, msr); |
Jan Beulich | 3451ab3 | 2016-06-27 00:35:12 -0600 | [diff] [blame] | 1358 | usec = irtl_2_usec(msr); |
| 1359 | if (usec) { |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1360 | bxt_cstates[4].exit_latency = usec; |
| 1361 | bxt_cstates[4].target_residency = usec; |
| 1362 | } |
| 1363 | |
| 1364 | rdmsrl(MSR_PKGC9_IRTL, msr); |
Jan Beulich | 3451ab3 | 2016-06-27 00:35:12 -0600 | [diff] [blame] | 1365 | usec = irtl_2_usec(msr); |
| 1366 | if (usec) { |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1367 | bxt_cstates[5].exit_latency = usec; |
| 1368 | bxt_cstates[5].target_residency = usec; |
| 1369 | } |
| 1370 | |
| 1371 | rdmsrl(MSR_PKGC10_IRTL, msr); |
Jan Beulich | 3451ab3 | 2016-06-27 00:35:12 -0600 | [diff] [blame] | 1372 | usec = irtl_2_usec(msr); |
| 1373 | if (usec) { |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1374 | bxt_cstates[6].exit_latency = usec; |
| 1375 | bxt_cstates[6].target_residency = usec; |
| 1376 | } |
| 1377 | |
| 1378 | } |
Rafael J. Wysocki | 6eacb15 | 2020-02-06 18:45:29 +0100 | [diff] [blame] | 1379 | |
| 1380 | /** |
| 1381 | * sklh_idle_state_table_update - Fix up the Sky Lake idle states table. |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1382 | * |
Rafael J. Wysocki | 6eacb15 | 2020-02-06 18:45:29 +0100 | [diff] [blame] | 1383 | * On SKL-H (model 0x5e) skip C8 and C9 if C10 is enabled and SGX disabled. |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1384 | */ |
Rafael J. Wysocki | 095928a | 2020-01-10 11:51:22 +0100 | [diff] [blame] | 1385 | static void __init sklh_idle_state_table_update(void) |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1386 | { |
| 1387 | unsigned long long msr; |
| 1388 | unsigned int eax, ebx, ecx, edx; |
| 1389 | |
| 1390 | |
| 1391 | /* if PC10 disabled via cmdline intel_idle.max_cstate=7 or shallower */ |
| 1392 | if (max_cstate <= 7) |
| 1393 | return; |
| 1394 | |
| 1395 | /* if PC10 not present in CPUID.MWAIT.EDX */ |
| 1396 | if ((mwait_substates & (0xF << 28)) == 0) |
| 1397 | return; |
| 1398 | |
Len Brown | 6cfb237 | 2017-01-07 23:23:25 -0500 | [diff] [blame] | 1399 | rdmsrl(MSR_PKG_CST_CONFIG_CONTROL, msr); |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1400 | |
| 1401 | /* PC10 is not enabled in PKG C-state limit */ |
| 1402 | if ((msr & 0xF) != 8) |
| 1403 | return; |
| 1404 | |
| 1405 | ecx = 0; |
| 1406 | cpuid(7, &eax, &ebx, &ecx, &edx); |
| 1407 | |
| 1408 | /* if SGX is present */ |
| 1409 | if (ebx & (1 << 2)) { |
| 1410 | |
Sean Christopherson | 32ad73d | 2019-12-20 20:44:55 -0800 | [diff] [blame] | 1411 | rdmsrl(MSR_IA32_FEAT_CTL, msr); |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1412 | |
| 1413 | /* if SGX is enabled */ |
| 1414 | if (msr & (1 << 18)) |
| 1415 | return; |
| 1416 | } |
| 1417 | |
Rafael J. Wysocki | ba1e78a | 2019-11-21 19:41:51 +0100 | [diff] [blame] | 1418 | skl_cstates[5].flags |= CPUIDLE_FLAG_UNUSABLE; /* C8-SKL */ |
| 1419 | skl_cstates[6].flags |= CPUIDLE_FLAG_UNUSABLE; /* C9-SKL */ |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1420 | } |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1421 | |
Rafael J. Wysocki | 1aefbd7 | 2020-01-10 11:52:32 +0100 | [diff] [blame] | 1422 | static bool __init intel_idle_verify_cstate(unsigned int mwait_hint) |
| 1423 | { |
| 1424 | unsigned int mwait_cstate = MWAIT_HINT2CSTATE(mwait_hint) + 1; |
| 1425 | unsigned int num_substates = (mwait_substates >> mwait_cstate * 4) & |
| 1426 | MWAIT_SUBSTATE_MASK; |
| 1427 | |
| 1428 | /* Ignore the C-state if there are NO sub-states in CPUID for it. */ |
| 1429 | if (num_substates == 0) |
| 1430 | return false; |
| 1431 | |
| 1432 | if (mwait_cstate > 2 && !boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) |
| 1433 | mark_tsc_unstable("TSC halts in idle states deeper than C2"); |
| 1434 | |
| 1435 | return true; |
| 1436 | } |
| 1437 | |
Rafael J. Wysocki | 095928a | 2020-01-10 11:51:22 +0100 | [diff] [blame] | 1438 | static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv) |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 1439 | { |
Rafael J. Wysocki | 3d3a1ae | 2020-01-10 11:48:25 +0100 | [diff] [blame] | 1440 | int cstate; |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 1441 | |
Rafael J. Wysocki | 3d3a1ae | 2020-01-10 11:48:25 +0100 | [diff] [blame] | 1442 | switch (boot_cpu_data.x86_model) { |
Dave Hansen | db73c5a | 2016-06-02 17:19:32 -0700 | [diff] [blame] | 1443 | case INTEL_FAM6_IVYBRIDGE_X: |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1444 | ivt_idle_state_table_update(); |
| 1445 | break; |
Dave Hansen | db73c5a | 2016-06-02 17:19:32 -0700 | [diff] [blame] | 1446 | case INTEL_FAM6_ATOM_GOLDMONT: |
Peter Zijlstra | f2c4db1 | 2018-08-07 10:17:27 -0700 | [diff] [blame] | 1447 | case INTEL_FAM6_ATOM_GOLDMONT_PLUS: |
Len Brown | 5dcef69 | 2016-04-06 17:00:47 -0400 | [diff] [blame] | 1448 | bxt_idle_state_table_update(); |
| 1449 | break; |
Peter Zijlstra | c66f78a | 2019-08-27 21:48:21 +0200 | [diff] [blame] | 1450 | case INTEL_FAM6_SKYLAKE: |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1451 | sklh_idle_state_table_update(); |
| 1452 | break; |
Len Brown | 0138d8f | 2014-04-04 01:21:07 -0400 | [diff] [blame] | 1453 | } |
Deepthi Dharwar | 46bcfad | 2011-10-28 16:20:42 +0530 | [diff] [blame] | 1454 | |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 1455 | for (cstate = 0; cstate < CPUIDLE_STATE_MAX; ++cstate) { |
Rafael J. Wysocki | 9f3d6da | 2019-12-13 09:55:52 +0100 | [diff] [blame] | 1456 | unsigned int mwait_hint; |
Deepthi Dharwar | 46bcfad | 2011-10-28 16:20:42 +0530 | [diff] [blame] | 1457 | |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1458 | if (intel_idle_max_cstate_reached(cstate)) |
| 1459 | break; |
| 1460 | |
Rafael J. Wysocki | 9f3d6da | 2019-12-13 09:55:52 +0100 | [diff] [blame] | 1461 | if (!cpuidle_state_table[cstate].enter && |
| 1462 | !cpuidle_state_table[cstate].enter_s2idle) |
Len Brown | e022e7e | 2013-02-01 23:37:30 -0500 | [diff] [blame] | 1463 | break; |
| 1464 | |
Rafael J. Wysocki | 9f3d6da | 2019-12-13 09:55:52 +0100 | [diff] [blame] | 1465 | /* If marked as unusable, skip this state. */ |
Rafael J. Wysocki | ba1e78a | 2019-11-21 19:41:51 +0100 | [diff] [blame] | 1466 | if (cpuidle_state_table[cstate].flags & CPUIDLE_FLAG_UNUSABLE) { |
Joe Perches | 654d08a | 2017-06-09 12:29:20 -0700 | [diff] [blame] | 1467 | pr_debug("state %s is disabled\n", |
| 1468 | cpuidle_state_table[cstate].name); |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1469 | continue; |
| 1470 | } |
| 1471 | |
Rafael J. Wysocki | 9f3d6da | 2019-12-13 09:55:52 +0100 | [diff] [blame] | 1472 | mwait_hint = flg2MWAIT(cpuidle_state_table[cstate].flags); |
| 1473 | if (!intel_idle_verify_cstate(mwait_hint)) |
| 1474 | continue; |
Len Brown | d70e28f | 2016-03-13 00:33:48 -0500 | [diff] [blame] | 1475 | |
Rafael J. Wysocki | 9f3d6da | 2019-12-13 09:55:52 +0100 | [diff] [blame] | 1476 | /* Structure copy. */ |
Rafael J. Wysocki | bff8e60 | 2019-12-13 09:56:21 +0100 | [diff] [blame] | 1477 | drv->states[drv->state_count] = cpuidle_state_table[cstate]; |
| 1478 | |
Rafael J. Wysocki | 4dcb78e | 2020-02-03 11:57:18 +0100 | [diff] [blame] | 1479 | if ((disabled_states_mask & BIT(drv->state_count)) || |
| 1480 | ((icpu->use_acpi || force_use_acpi) && |
| 1481 | intel_idle_off_by_default(mwait_hint) && |
| 1482 | !(cpuidle_state_table[cstate].flags & CPUIDLE_FLAG_ALWAYS_ENABLE))) |
Rafael J. Wysocki | bff8e60 | 2019-12-13 09:56:21 +0100 | [diff] [blame] | 1483 | drv->states[drv->state_count].flags |= CPUIDLE_FLAG_OFF; |
| 1484 | |
| 1485 | drv->state_count++; |
Deepthi Dharwar | 46bcfad | 2011-10-28 16:20:42 +0530 | [diff] [blame] | 1486 | } |
| 1487 | |
Len Brown | 8c058d53 | 2014-07-31 15:21:24 -0400 | [diff] [blame] | 1488 | if (icpu->byt_auto_demotion_disable_flag) { |
| 1489 | wrmsrl(MSR_CC6_DEMOTION_POLICY_CONFIG, 0); |
| 1490 | wrmsrl(MSR_MC6_DEMOTION_POLICY_CONFIG, 0); |
| 1491 | } |
Deepthi Dharwar | 46bcfad | 2011-10-28 16:20:42 +0530 | [diff] [blame] | 1492 | } |
| 1493 | |
Rafael J. Wysocki | 6eacb15 | 2020-02-06 18:45:29 +0100 | [diff] [blame] | 1494 | /** |
| 1495 | * intel_idle_cpuidle_driver_init - Create the list of available idle states. |
| 1496 | * @drv: cpuidle driver structure to initialize. |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1497 | */ |
Rafael J. Wysocki | 3d3a1ae | 2020-01-10 11:48:25 +0100 | [diff] [blame] | 1498 | static void __init intel_idle_cpuidle_driver_init(struct cpuidle_driver *drv) |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1499 | { |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1500 | cpuidle_poll_state_init(drv); |
Rafael J. Wysocki | 4dcb78e | 2020-02-03 11:57:18 +0100 | [diff] [blame] | 1501 | |
| 1502 | if (disabled_states_mask & BIT(0)) |
| 1503 | drv->states[0].flags |= CPUIDLE_FLAG_OFF; |
| 1504 | |
Rafael J. Wysocki | 1873495 | 2019-12-13 09:56:01 +0100 | [diff] [blame] | 1505 | drv->state_count = 1; |
| 1506 | |
| 1507 | if (icpu) |
| 1508 | intel_idle_init_cstates_icpu(drv); |
| 1509 | else |
| 1510 | intel_idle_init_cstates_acpi(drv); |
| 1511 | } |
Deepthi Dharwar | 46bcfad | 2011-10-28 16:20:42 +0530 | [diff] [blame] | 1512 | |
Rafael J. Wysocki | 1aefbd7 | 2020-01-10 11:52:32 +0100 | [diff] [blame] | 1513 | static void auto_demotion_disable(void) |
| 1514 | { |
| 1515 | unsigned long long msr_bits; |
| 1516 | |
| 1517 | rdmsrl(MSR_PKG_CST_CONFIG_CONTROL, msr_bits); |
Rafael J. Wysocki | 7f843dd | 2020-02-06 18:41:24 +0100 | [diff] [blame] | 1518 | msr_bits &= ~auto_demotion_disable_flags; |
Rafael J. Wysocki | 1aefbd7 | 2020-01-10 11:52:32 +0100 | [diff] [blame] | 1519 | wrmsrl(MSR_PKG_CST_CONFIG_CONTROL, msr_bits); |
| 1520 | } |
| 1521 | |
| 1522 | static void c1e_promotion_disable(void) |
| 1523 | { |
| 1524 | unsigned long long msr_bits; |
| 1525 | |
| 1526 | rdmsrl(MSR_IA32_POWER_CTL, msr_bits); |
| 1527 | msr_bits &= ~0x2; |
| 1528 | wrmsrl(MSR_IA32_POWER_CTL, msr_bits); |
| 1529 | } |
| 1530 | |
Rafael J. Wysocki | 6eacb15 | 2020-02-06 18:45:29 +0100 | [diff] [blame] | 1531 | /** |
| 1532 | * intel_idle_cpu_init - Register the target CPU with the cpuidle core. |
| 1533 | * @cpu: CPU to initialize. |
| 1534 | * |
| 1535 | * Register a cpuidle device object for @cpu and update its MSRs in accordance |
| 1536 | * with the processor model flags. |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1537 | */ |
Sebastian Andrzej Siewior | fb1013a | 2016-11-29 10:51:43 +0100 | [diff] [blame] | 1538 | static int intel_idle_cpu_init(unsigned int cpu) |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1539 | { |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1540 | struct cpuidle_device *dev; |
| 1541 | |
Thomas Renninger | 65b7f83 | 2012-01-17 22:40:08 +0100 | [diff] [blame] | 1542 | dev = per_cpu_ptr(intel_idle_cpuidle_devices, cpu); |
Thomas Renninger | 65b7f83 | 2012-01-17 22:40:08 +0100 | [diff] [blame] | 1543 | dev->cpu = cpu; |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1544 | |
Thomas Renninger | 65b7f83 | 2012-01-17 22:40:08 +0100 | [diff] [blame] | 1545 | if (cpuidle_register_device(dev)) { |
Joe Perches | 654d08a | 2017-06-09 12:29:20 -0700 | [diff] [blame] | 1546 | pr_debug("cpuidle_register_device %d failed!\n", cpu); |
Thomas Renninger | 65b7f83 | 2012-01-17 22:40:08 +0100 | [diff] [blame] | 1547 | return -EIO; |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1548 | } |
| 1549 | |
Rafael J. Wysocki | 7f843dd | 2020-02-06 18:41:24 +0100 | [diff] [blame] | 1550 | if (auto_demotion_disable_flags) |
Sebastian Andrzej Siewior | fb1013a | 2016-11-29 10:51:43 +0100 | [diff] [blame] | 1551 | auto_demotion_disable(); |
Thomas Renninger | 65b7f83 | 2012-01-17 22:40:08 +0100 | [diff] [blame] | 1552 | |
Rafael J. Wysocki | 7f843dd | 2020-02-06 18:41:24 +0100 | [diff] [blame] | 1553 | if (disable_promotion_to_c1e) |
Sebastian Andrzej Siewior | fb1013a | 2016-11-29 10:51:43 +0100 | [diff] [blame] | 1554 | c1e_promotion_disable(); |
| 1555 | |
| 1556 | return 0; |
| 1557 | } |
| 1558 | |
| 1559 | static int intel_idle_cpu_online(unsigned int cpu) |
| 1560 | { |
| 1561 | struct cpuidle_device *dev; |
| 1562 | |
Rafael J. Wysocki | dab2017 | 2020-06-29 13:58:28 +0200 | [diff] [blame^] | 1563 | if (!boot_cpu_has(X86_FEATURE_ARAT)) |
Rafael J. Wysocki | cbd2c4c | 2020-01-10 11:43:23 +0100 | [diff] [blame] | 1564 | tick_broadcast_enable(); |
Sebastian Andrzej Siewior | fb1013a | 2016-11-29 10:51:43 +0100 | [diff] [blame] | 1565 | |
| 1566 | /* |
| 1567 | * Some systems can hotplug a cpu at runtime after |
| 1568 | * the kernel has booted, we have to initialize the |
| 1569 | * driver in this case |
| 1570 | */ |
| 1571 | dev = per_cpu_ptr(intel_idle_cpuidle_devices, cpu); |
| 1572 | if (!dev->registered) |
| 1573 | return intel_idle_cpu_init(cpu); |
Bartlomiej Zolnierkiewicz | dbf87ab | 2013-12-20 19:47:28 +0100 | [diff] [blame] | 1574 | |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1575 | return 0; |
| 1576 | } |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1577 | |
Rafael J. Wysocki | 0755a9b | 2020-01-10 11:49:58 +0100 | [diff] [blame] | 1578 | /** |
| 1579 | * intel_idle_cpuidle_devices_uninit - Unregister all cpuidle devices. |
| 1580 | */ |
| 1581 | static void __init intel_idle_cpuidle_devices_uninit(void) |
| 1582 | { |
| 1583 | int i; |
| 1584 | |
| 1585 | for_each_online_cpu(i) |
| 1586 | cpuidle_unregister_device(per_cpu_ptr(intel_idle_cpuidle_devices, i)); |
| 1587 | } |
| 1588 | |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1589 | static int __init intel_idle_init(void) |
| 1590 | { |
Rafael J. Wysocki | a6c86e3 | 2020-01-10 11:44:58 +0100 | [diff] [blame] | 1591 | const struct x86_cpu_id *id; |
| 1592 | unsigned int eax, ebx, ecx; |
Sebastian Andrzej Siewior | fb1013a | 2016-11-29 10:51:43 +0100 | [diff] [blame] | 1593 | int retval; |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1594 | |
Thomas Renninger | d189604 | 2010-11-03 17:06:14 +0100 | [diff] [blame] | 1595 | /* Do not load intel_idle at all for now if idle= is passed */ |
| 1596 | if (boot_option_idle_override != IDLE_NO_OVERRIDE) |
| 1597 | return -ENODEV; |
| 1598 | |
Rafael J. Wysocki | a6c86e3 | 2020-01-10 11:44:58 +0100 | [diff] [blame] | 1599 | if (max_cstate == 0) { |
| 1600 | pr_debug("disabled\n"); |
| 1601 | return -EPERM; |
| 1602 | } |
| 1603 | |
| 1604 | id = x86_match_cpu(intel_idle_ids); |
| 1605 | if (id) { |
| 1606 | if (!boot_cpu_has(X86_FEATURE_MWAIT)) { |
| 1607 | pr_debug("Please enable MWAIT in BIOS SETUP\n"); |
| 1608 | return -ENODEV; |
| 1609 | } |
| 1610 | } else { |
| 1611 | id = x86_match_cpu(intel_mwait_ids); |
| 1612 | if (!id) |
| 1613 | return -ENODEV; |
| 1614 | } |
| 1615 | |
| 1616 | if (boot_cpu_data.cpuid_level < CPUID_MWAIT_LEAF) |
| 1617 | return -ENODEV; |
| 1618 | |
| 1619 | cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &mwait_substates); |
| 1620 | |
| 1621 | if (!(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED) || |
| 1622 | !(ecx & CPUID5_ECX_INTERRUPT_BREAK) || |
| 1623 | !mwait_substates) |
| 1624 | return -ENODEV; |
| 1625 | |
| 1626 | pr_debug("MWAIT substates: 0x%x\n", mwait_substates); |
| 1627 | |
| 1628 | icpu = (const struct idle_cpu *)id->driver_data; |
| 1629 | if (icpu) { |
| 1630 | cpuidle_state_table = icpu->state_table; |
Rafael J. Wysocki | 7f843dd | 2020-02-06 18:41:24 +0100 | [diff] [blame] | 1631 | auto_demotion_disable_flags = icpu->auto_demotion_disable_flags; |
| 1632 | disable_promotion_to_c1e = icpu->disable_promotion_to_c1e; |
Rafael J. Wysocki | 3a5be9b | 2020-02-03 11:57:08 +0100 | [diff] [blame] | 1633 | if (icpu->use_acpi || force_use_acpi) |
Rafael J. Wysocki | a6c86e3 | 2020-01-10 11:44:58 +0100 | [diff] [blame] | 1634 | intel_idle_acpi_cst_extract(); |
| 1635 | } else if (!intel_idle_acpi_cst_extract()) { |
| 1636 | return -ENODEV; |
| 1637 | } |
| 1638 | |
| 1639 | pr_debug("v" INTEL_IDLE_VERSION " model 0x%X\n", |
| 1640 | boot_cpu_data.x86_model); |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1641 | |
Richard Cochran | e9df69c | 2016-04-06 17:00:52 -0400 | [diff] [blame] | 1642 | intel_idle_cpuidle_devices = alloc_percpu(struct cpuidle_device); |
Rafael J. Wysocki | 533da74 | 2020-01-10 11:45:49 +0100 | [diff] [blame] | 1643 | if (!intel_idle_cpuidle_devices) |
Richard Cochran | e9df69c | 2016-04-06 17:00:52 -0400 | [diff] [blame] | 1644 | return -ENOMEM; |
| 1645 | |
Rafael J. Wysocki | 3d3a1ae | 2020-01-10 11:48:25 +0100 | [diff] [blame] | 1646 | intel_idle_cpuidle_driver_init(&intel_idle_driver); |
| 1647 | |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1648 | retval = cpuidle_register_driver(&intel_idle_driver); |
| 1649 | if (retval) { |
Konrad Rzeszutek Wilk | 3735d52 | 2012-08-16 22:06:55 +0200 | [diff] [blame] | 1650 | struct cpuidle_driver *drv = cpuidle_get_driver(); |
Joe Perches | 654d08a | 2017-06-09 12:29:20 -0700 | [diff] [blame] | 1651 | printk(KERN_DEBUG pr_fmt("intel_idle yielding to %s\n"), |
| 1652 | drv ? drv->name : "none"); |
Sebastian Andrzej Siewior | fb1013a | 2016-11-29 10:51:43 +0100 | [diff] [blame] | 1653 | goto init_driver_fail; |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1654 | } |
| 1655 | |
Sebastian Andrzej Siewior | fb1013a | 2016-11-29 10:51:43 +0100 | [diff] [blame] | 1656 | retval = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "idle/intel:online", |
| 1657 | intel_idle_cpu_online, NULL); |
| 1658 | if (retval < 0) |
| 1659 | goto hp_setup_fail; |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1660 | |
Rafael J. Wysocki | 40ab82e | 2020-02-06 18:40:54 +0100 | [diff] [blame] | 1661 | pr_debug("Local APIC timer is reliable in %s\n", |
Rafael J. Wysocki | dab2017 | 2020-06-29 13:58:28 +0200 | [diff] [blame^] | 1662 | boot_cpu_has(X86_FEATURE_ARAT) ? "all C-states" : "C1"); |
Richard Cochran | 2259a81 | 2016-04-06 17:00:54 -0400 | [diff] [blame] | 1663 | |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1664 | return 0; |
Sebastian Andrzej Siewior | fb1013a | 2016-11-29 10:51:43 +0100 | [diff] [blame] | 1665 | |
| 1666 | hp_setup_fail: |
| 1667 | intel_idle_cpuidle_devices_uninit(); |
| 1668 | cpuidle_unregister_driver(&intel_idle_driver); |
| 1669 | init_driver_fail: |
| 1670 | free_percpu(intel_idle_cpuidle_devices); |
| 1671 | return retval; |
| 1672 | |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1673 | } |
Paul Gortmaker | 02c4fae | 2016-06-17 01:28:33 -0400 | [diff] [blame] | 1674 | device_initcall(intel_idle_init); |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1675 | |
Paul Gortmaker | 02c4fae | 2016-06-17 01:28:33 -0400 | [diff] [blame] | 1676 | /* |
| 1677 | * We are not really modular, but we used to support that. Meaning we also |
| 1678 | * support "intel_idle.max_cstate=..." at boot and also a read-only export of |
| 1679 | * it at /sys/module/intel_idle/parameters/max_cstate -- so using module_param |
| 1680 | * is the easiest way (currently) to continue doing that. |
| 1681 | */ |
Len Brown | 2671717 | 2010-03-08 14:07:30 -0500 | [diff] [blame] | 1682 | module_param(max_cstate, int, 0444); |
Rafael J. Wysocki | 4dcb78e | 2020-02-03 11:57:18 +0100 | [diff] [blame] | 1683 | /* |
| 1684 | * The positions of the bits that are set in this number are the indices of the |
| 1685 | * idle states to be disabled by default (as reflected by the names of the |
| 1686 | * corresponding idle state directories in sysfs, "state0", "state1" ... |
| 1687 | * "state<i>" ..., where <i> is the index of the given state). |
| 1688 | */ |
| 1689 | module_param_named(states_off, disabled_states_mask, uint, 0444); |
| 1690 | MODULE_PARM_DESC(states_off, "Mask of disabled idle states"); |