Re: [PATCH] x86/msr: add idle version of wrmsr trace

From: Peter Zijlstra
Date: Wed Aug 24 2022 - 03:22:31 EST


On Wed, Aug 24, 2022 at 08:48:33AM +0200, Peter Zijlstra wrote:
> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> index 3e101719689a..6e82b2df29cb 100644
> --- a/drivers/idle/intel_idle.c
> +++ b/drivers/idle/intel_idle.c
> @@ -187,12 +187,12 @@ static __cpuidle int intel_idle_ibrs(struct cpuidle_device *dev,
> int ret;
>
> if (smt_active)
> - wrmsrl(MSR_IA32_SPEC_CTRL, 0);
> + __native_wrmsr(MSR_IA32_SPEC_CTRL, 0);
>
> ret = __intel_idle(dev, drv, index);
>
> if (smt_active)
> - wrmsrl(MSR_IA32_SPEC_CTRL, spec_ctrl);
> + __native_wrmsr(MSR_IA32_SPEC_CTRL, spec_ctrl);
>
> return ret;
> }

Clearly I should not be sending email before having wake-up-juice.. that
should of course be native_wrmsr(SPEC_CTRL, val, 0) etc..