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

From: Peter Zijlstra
Date: Wed Aug 24 2022 - 02:49:08 EST



Dear FirstName LastName, pleae fix your MUA.

On Tue, Aug 23, 2022 at 04:43:53PM -0700, FirstName LastName wrote:
> From: Peter Shier <pshier@xxxxxxxxxx>
>
> With commit bf5835bcdb963 ("intel_idle: Disable IBRS during long idle"),
> enabling wrmsr trace with CONFIG_LOCKDEP causes "suspicious
> rcu_dereference_check() usage" warning because do_trace_write_msr does not
> use trace_write_msr_rcuidle.
>

No, the right thing here is to not do tracing at all.

*sigh* I should go finish this series:

https://lore.kernel.org/lkml/20220608142723.103523089@xxxxxxxxxxxxx/

---
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;
}