Linux Power Management development
 help / color / mirror / Atom feed
From: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
To: Li RongQing <lirongqing@baidu.com>
Cc: linux-pm@vger.kernel.org
Subject: Re: [PATCH] intel_idle: update spec_ctrl register only when necessary
Date: Tue, 6 Feb 2024 09:40:11 -0800	[thread overview]
Message-ID: <20240206174011.tvwl753clni2bxio@desk> (raw)
In-Reply-To: <20240206071452.42673-1-lirongqing@baidu.com>

On Tue, Feb 06, 2024 at 03:14:52PM +0800, Li RongQing wrote:
> spec_ctrl maybe 0 when mitigations is off, and writing spec_ctrl MSR
> is expensive operation, so update spec_ctrl only when necessary

Have you observed SPEC_CTRL MSR being written on idle when mitigations
are off?

IIUC, intel_idle_ibrs() will only be called when X86_FEATURE_KERNEL_IBRS
is set:

state_update_enter_method()
{
...
          if (cpu_feature_enabled(X86_FEATURE_KERNEL_IBRS) &&
                          ((state->flags & CPUIDLE_FLAG_IBRS) || ibrs_off)) {
		  ...
                  state->enter = intel_idle_ibrs;
                  return;
          }

And X86_FEATURE_KERNEL_IBRS wont be set when mitigations are off.

      reply	other threads:[~2024-02-06 17:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06  7:14 [PATCH] intel_idle: update spec_ctrl register only when necessary Li RongQing
2024-02-06 17:40 ` Pawan Gupta [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240206174011.tvwl753clni2bxio@desk \
    --to=pawan.kumar.gupta@linux.intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=lirongqing@baidu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox