From: Borislav Petkov <bp@alien8.de>
To: "Saripalli, RK" <rsaripal@amd.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>,
Reiji Watanabe <reijiw@google.com>,
linux-kernel@vger.kernel.org, x86@kernel.org, tglx@linutronix.de,
mingo@redhat.com, hpa@zytor.com, Jonathan Corbet <corbet@lwn.net>,
bsd@redhat.com
Subject: Re: [v3 1/1] x86/cpufeatures: Implement Predictive Store Forwarding control.
Date: Thu, 29 Apr 2021 17:02:42 +0200 [thread overview]
Message-ID: <YIrKkqmXlK36E2lN@zn.tnic> (raw)
In-Reply-To: <75258a4d-131d-766a-b20c-b3cc5ee65817@amd.com>
On Thu, Apr 29, 2021 at 09:32:35AM -0500, Saripalli, RK wrote:
> Yes, I agree with his analysis and fixing it.
So you can do this and correct the comment above it to explain why
you're doing the "tmp" thing.
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index d41b70fe4918..536136e0daa3 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -78,6 +78,8 @@ EXPORT_SYMBOL_GPL(mds_idle_clear);
void __init check_bugs(void)
{
+ u64 tmp = 0;
+
identify_boot_cpu();
/*
@@ -97,7 +99,9 @@ void __init check_bugs(void)
* init code as it is not enumerated and depends on the family.
*/
if (boot_cpu_has(X86_FEATURE_MSR_SPEC_CTRL))
- rdmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base);
+ rdmsrl(MSR_IA32_SPEC_CTRL, tmp);
+
+ x86_spec_ctrl_base |= tmp;
/* Allow STIBP in MSR_SPEC_CTRL if supported */
if (boot_cpu_has(X86_FEATURE_STIBP))
---
and as Tom correctly suggests, set X86_FEATURE_MSR_SPEC_CTRL in
psf_cmdline() so that the above loading of the base value works.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
prev parent reply other threads:[~2021-04-29 15:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-28 16:03 [v3 0/1] Introduce support for PSF control Ramakrishna Saripalli
2021-04-28 16:03 ` [v3 1/1] x86/cpufeatures: Implement Predictive Store Forwarding control Ramakrishna Saripalli
2021-04-29 5:13 ` Tom Lendacky
2021-04-29 14:03 ` Saripalli, RK
2021-04-29 5:38 ` Reiji Watanabe
2021-04-29 14:01 ` Saripalli, RK
2021-04-29 14:25 ` Tom Lendacky
2021-04-29 14:32 ` Saripalli, RK
2021-04-29 15:02 ` Borislav Petkov [this message]
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=YIrKkqmXlK36E2lN@zn.tnic \
--to=bp@alien8.de \
--cc=bsd@redhat.com \
--cc=corbet@lwn.net \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=reijiw@google.com \
--cc=rsaripal@amd.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--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