Re: [PATCH v3 2/3] intel_idle: Sync up the SPEC_CTRL MSR value to x86_spec_ctrl_current

From: Waiman Long
Date: Thu Jun 22 2023 - 08:35:56 EST



On 6/22/23 05:40, Peter Zijlstra wrote:
On Wed, Jun 21, 2023 at 10:46:33PM -0700, Josh Poimboeuf wrote:
On Wed, Jun 21, 2023 at 08:36:02PM -0400, Waiman Long wrote:
When intel_idle_ibrs() is called, it modifies the SPEC_CTRL MSR to
0 in order disable IBRS. However, the new MSR value isn't reflected
in x86_spec_ctrl_current which is at odd with the other code that
keep track of its state in that percpu variable. Fix that by updating
x86_spec_ctrl_current percpu value to always match the content of the
SPEC_CTRL MSR.
Is this fixing an actual bug or is there some other reason for doing
this?
No actual bug, he did this for his debugfs file -- which is no longer
part of the series. With that on, you can observe the
x86_spec_ctrl_current value while idle.

Right. That is the main reason as I want the SPEC_CTRL MSRs value to be observable by some external mean:-)

Regards,
Longman