Skip to content

Commit 6468021

Browse files
committed
Merge: Update intel_idle to match upstream 6.3
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2341 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2185872 Tested: https://bugzilla.redhat.com/show_bug.cgi?id=2185872#c8 Signed-off-by: David Arcari <darcari@redhat.com> Approved-by: Prarit Bhargava <prarit@redhat.com> Approved-by: Dean Nelson <dnelson@redhat.com> Approved-by: Steve Best <sbest@redhat.com> Signed-off-by: Jan Stancek <jstancek@redhat.com>
2 parents cb9ffbc + 8c6f0e2 commit 6468021

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void update_spec_ctrl_cond(u64 val)
8686
wrmsrl(MSR_IA32_SPEC_CTRL, val);
8787
}
8888

89-
u64 spec_ctrl_current(void)
89+
noinstr u64 spec_ctrl_current(void)
9090
{
9191
return this_cpu_read(x86_spec_ctrl_current);
9292
}

drivers/idle/intel_idle.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,7 @@ static __cpuidle int intel_idle_irq(struct cpuidle_device *dev,
168168

169169
raw_local_irq_enable();
170170
ret = __intel_idle(dev, drv, index);
171-
172-
/*
173-
* The lockdep hardirqs state may be changed to 'on' with timer
174-
* tick interrupt followed by __do_softirq(). Use local_irq_disable()
175-
* to keep the hardirqs state correct.
176-
*/
177-
local_irq_disable();
171+
raw_local_irq_disable();
178172

179173
return ret;
180174
}
@@ -187,12 +181,12 @@ static __cpuidle int intel_idle_ibrs(struct cpuidle_device *dev,
187181
int ret;
188182

189183
if (smt_active)
190-
wrmsrl(MSR_IA32_SPEC_CTRL, 0);
184+
native_wrmsrl(MSR_IA32_SPEC_CTRL, 0);
191185

192186
ret = __intel_idle(dev, drv, index);
193187

194188
if (smt_active)
195-
wrmsrl(MSR_IA32_SPEC_CTRL, spec_ctrl);
189+
native_wrmsrl(MSR_IA32_SPEC_CTRL, spec_ctrl);
196190

197191
return ret;
198192
}
@@ -1558,7 +1552,7 @@ static void __init intel_idle_init_cstates_acpi(struct cpuidle_driver *drv)
15581552
state = &drv->states[drv->state_count++];
15591553

15601554
snprintf(state->name, CPUIDLE_NAME_LEN, "C%d_ACPI", cstate);
1561-
strlcpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);
1555+
strscpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);
15621556
state->exit_latency = cx->latency;
15631557
/*
15641558
* For C1-type C-states use the same number for both the exit
@@ -1844,6 +1838,9 @@ static bool __init intel_idle_verify_cstate(unsigned int mwait_hint)
18441838
return true;
18451839
}
18461840

1841+
static bool force_irq_on __read_mostly;
1842+
module_param(force_irq_on, bool, 0444);
1843+
18471844
static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
18481845
{
18491846
int cstate;
@@ -1897,8 +1894,10 @@ static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
18971894
/* Structure copy. */
18981895
drv->states[drv->state_count] = cpuidle_state_table[cstate];
18991896

1900-
if (cpuidle_state_table[cstate].flags & CPUIDLE_FLAG_IRQ_ENABLE)
1897+
if ((cpuidle_state_table[cstate].flags & CPUIDLE_FLAG_IRQ_ENABLE) || force_irq_on) {
1898+
printk("intel_idle: forced intel_idle_irq for state %d\n", cstate);
19011899
drv->states[drv->state_count].enter = intel_idle_irq;
1900+
}
19021901

19031902
if (cpu_feature_enabled(X86_FEATURE_KERNEL_IBRS) &&
19041903
cpuidle_state_table[cstate].flags & CPUIDLE_FLAG_IBRS) {

0 commit comments

Comments
 (0)