[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231114050201.GAZVL/Sd/yLIdON9la@fat_crate.local>
Date: Tue, 14 Nov 2023 06:02:01 +0100
From: Borislav Petkov <bp@...en8.de>
To: "Li, Xin3" <xin3.li@...el.com>
Cc: "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"xen-devel@...ts.xenproject.org" <xen-devel@...ts.xenproject.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"x86@...nel.org" <x86@...nel.org>, "hpa@...or.com" <hpa@...or.com>,
"Lutomirski, Andy" <luto@...nel.org>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"Christopherson,, Sean" <seanjc@...gle.com>,
"peterz@...radead.org" <peterz@...radead.org>,
"Gross, Jurgen" <jgross@...e.com>,
"Shankar, Ravi V" <ravi.v.shankar@...el.com>,
"mhiramat@...nel.org" <mhiramat@...nel.org>,
"andrew.cooper3@...rix.com" <andrew.cooper3@...rix.com>,
"jiangshanlai@...il.com" <jiangshanlai@...il.com>,
"nik.borisov@...e.com" <nik.borisov@...e.com>
Subject: Re: [PATCH v12 01/37] x86/cpufeatures: Add the cpu feature bit for
WRMSRNS
On Tue, Nov 14, 2023 at 12:43:38AM +0000, Li, Xin3 wrote:
> No. tglx asked for it:
> https://lkml.kernel.org/kvm/87y1h81ht4.ffs@tglx/
Aha
"According to the CPU folks FRED systems are guaranteed to have WRMSRNS -
I asked for that :). It's just not yet documented."
so I'm going to expect that to appear in the next FRED spec revision...
> Because we are doing
> wrmsrns(MSR_IA32_FRED_RSP0, ...)
> here, and X86_FEATURE_WRMSRNS doesn't guarantee MSR_IA32_FRED_RSP0 exists.
>
> Or I missed something?
Well, according to what I'm hearing and reading so far:
FRED means WRMSRNS
FRED means MSR_IA32_FRED_RSP0
and if you had to be precise, the code should do:
if (cpu_feature_enabled(X86_FEATURE_FRED)) {
if (cpu_feature_enabled(X86_FEATURE_WRMSRNS))
wrmsrns(MSR_IA32_FRED_RSP0, (unsigned long)task_stack_page(task) + THREAD_SIZE);
else
wrmsr(MSR_IA32_FRED_RSP0, (unsigned long)task_stack_page(task) + THREAD_SIZE);
}
but apparently FRED implies WRMSRNS - not documented anywhere currently
- so you can save yourself one check.
But your version checks FRED if it can do WRMSRNS while there's
a separate WRMSRNS flag and that made me wonder...
> Another patch set should replace WRMSR with WRMSRNS, with SERIALIZE added
> when needed.
I sense someone wants to optimize MSR writes ... :-)
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists