[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4996d41d-3199-c4f4-ffb0-25f09709fd6c@redhat.com>
Date: Wed, 21 Jun 2023 09:47:37 -0400
From: Waiman Long <longman@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>,
Len Brown <lenb@...nel.org>, linux-kernel@...r.kernel.org,
x86@...nel.org, linux-pm@...r.kernel.org,
Robin Jarry <rjarry@...hat.com>, Joe Mario <jmario@...hat.com>
Subject: Re: [PATCH v2 1/5] x86/speculation: Provide a debugfs file to dump
SPEC_CTRL MSRs
On 6/21/23 03:41, Peter Zijlstra wrote:
> On Tue, Jun 20, 2023 at 10:06:21AM -0400, Waiman Long wrote:
>> Sometimes it is useful to know the states the SPEC_CTRL MSRs to see what
>> mitigations are enabled at run time. Provide a new x86/spec_ctrl_msrs
>> debugfs file to dump the cached versions of the current SPEC_CTRL MSRs.
>>
> Pff, clearly I can't even read email anymore..
>
> We don't do this for any of the other MSRs, so why start now?
That is true since most of the MSRs are static. IOW, they don't change
once they are set. The current way to read the content of the MSRs is
via the /dev/cpu/<n>/msr files. There are user space tools to do that.
SPEC_CTRL, however, can be subjected to frequent changes especially when
X86_FEATURE_KERNEL_IBRS is set. As a result, the current way of reading
MSRs from /dev/cpu/<n>/msr doesn't quite work for SPEC_CTRL as the IBRS
bit is always set due to the fact that the reading is done internally
via an IPI in kernel space. That is the main reason that I add this
debugfs file to get a good snapshot of the current set of cached
SPEC_CTRL MSR values without the need to disturb what the CPUs are
currently doing at that point in time.
This patch is not central to the main purpose of this patch series, but
it does enable me to quickly verify the other patches are working
correctly. I can take it out if people don't think it is a good idea.
Cheers,
Longman
Powered by blists - more mailing lists