Skip to content

Commit

Permalink
cpuidle, intel_idle: Fix CPUIDLE_FLAG_IBRS
Browse files Browse the repository at this point in the history
objtool to the rescue:

  vmlinux.o: warning: objtool: intel_idle_ibrs+0x17: call to spec_ctrl_current() leaves .noinstr.text section
  vmlinux.o: warning: objtool: intel_idle_ibrs+0x27: call to wrmsrl.constprop.0() leaves .noinstr.text section

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Tested-by: Tony Lindgren <[email protected]>
Tested-by: Ulf Hansson <[email protected]>
Acked-by: Rafael J. Wysocki <[email protected]>
Acked-by: Frederic Weisbecker <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Jan 13, 2023
1 parent 821ad23 commit 9b461a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arch/x86/kernel/cpu/bugs.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void update_spec_ctrl_cond(u64 val)
wrmsrl(MSR_IA32_SPEC_CTRL, val);
}

u64 spec_ctrl_current(void)
noinstr u64 spec_ctrl_current(void)
{
return this_cpu_read(x86_spec_ctrl_current);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/idle/intel_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@ static __cpuidle int intel_idle_ibrs(struct cpuidle_device *dev,
int ret;

if (smt_active)
wrmsrl(MSR_IA32_SPEC_CTRL, 0);
native_wrmsrl(MSR_IA32_SPEC_CTRL, 0);

ret = __intel_idle(dev, drv, index);

if (smt_active)
wrmsrl(MSR_IA32_SPEC_CTRL, spec_ctrl);
native_wrmsrl(MSR_IA32_SPEC_CTRL, spec_ctrl);

return ret;
}
Expand Down

0 comments on commit 9b461a6

Please sign in to comment.