From: Sohil Mehta <sohil.mehta@intel.com>
To: "H. Peter Anvin" <hpa@zytor.com>, <x86@kernel.org>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
"Shuah Khan" <shuah@kernel.org>,
Binbin Wu <binbin.wu@linux.intel.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Chang S . Bae" <chang.seok.bae@intel.com>,
Kishen Maloor <kishen.maloor@intel.com>,
Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
<linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>,
<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH v2] selftests/x86: Add a test for LASS enforcement
Date: Tue, 13 Oct 2026 12:51:12 -0700 [thread overview]
Message-ID: <c5c1fec0-8cd7-47dc-9a22-d90c80b2429a@intel.com> (raw)
In-Reply-To: <b6cee0b8-c5cf-4136-928f-96cb0a58eaa3@zytor.com>
On 10/13/2026 11:54 AM, H. Peter Anvin wrote:
> On 2026-10-08 19:00, Sohil Mehta wrote:
>>
>> Note, the CPUID bit does not reflect whether the kernel enabled LASS;
>> only the cpuinfo flag does. But parsing cpuinfo is cumbersome, and the
>> kernel enables LASS whenever the CPU supports it unless the command line
>> opts out (vsyscall=emulate or clearcpuid=lass). To keep it simple, rely
>> on the CPUID bit and accept a failure in these unusual cases.
>>
> Cumbersome, really?
>
I had it in v1 of this patch. It seemed excessive to do specifically for
LASS:
https://lore.kernel.org/lkml/20260806011536.4172258-8-sohil.mehta@intel.com/
As LASS is always enabled by the kernel except for the really odd cases
the trade-off seems practical to me.
> Here is a set of parsing functions -- tested, even! -- that you can make
> available as library routines. Integrating them into the selftests build
> framework has been left as an exercise for the reader ;-)
>
I agree, adding them as generic selftest helpers may be useful. But,
/proc/cpuinfo has been unreliable in general. It is currently buggy for
some features with Kconfig options. See:
https://lore.kernel.org/lkml/f6f113b46199d996c4f81fc89858c2f484256418.1774623092.git.m.wieczorretman@pm.me/
Also, (I think) we have been generally discouraging folks to add more
bits there. So, I don't know if creating these library routines is
useful right now. IIUC, Boris said that the CPUID rework would make some
of cpuinfo stuff moot.
https://lore.kernel.org/lkml/20260331140216.GDacvT6IPW1gf003z-@fat_crate.local/
Thoughts?
next prev parent reply other threads:[~2026-10-13 19:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 2:00 Sohil Mehta
2026-10-13 18:54 ` H. Peter Anvin
2026-10-13 19:51 ` Sohil Mehta [this message]
2026-10-13 23:06 ` H. Peter Anvin
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=c5c1fec0-8cd7-47dc-9a22-d90c80b2429a@intel.com \
--to=sohil.mehta@intel.com \
--cc=binbin.wu@linux.intel.com \
--cc=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kishen.maloor@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=seanjc@google.com \
--cc=shuah@kernel.org \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®