From: Thomas Gleixner <tglx@linutronix.de>
To: "Prakhya, Sai Praneeth" <sai.praneeth.prakhya@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>,
"Chen, Tim C" <tim.c.chen@intel.com>,
"Hansen, Dave" <dave.hansen@intel.com>,
"Shankar, Ravi V" <ravi.v.shankar@intel.com>,
Ingo Molnar <mingo@kernel.org>
Subject: RE: [PATCH V2] x86/speculation: Support Enhanced IBRS on future CPUs
Date: Tue, 31 Jul 2018 10:24:03 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.21.1807311018040.1725@nanos.tec.linutronix.de> (raw)
In-Reply-To: <FFF73D592F13FD46B8700F0A279B802F4757790C@ORSMSX114.amr.corp.intel.com>
On Tue, 31 Jul 2018, Prakhya, Sai Praneeth wrote:
> > > +#define X86_FEATURE_IBRS_ENHANCED ( 7*32+29) /*
> > "ibrs_enhanced" Use Enhanced IBRS in kernel */
> >
> > That "ibrs_enhanced" part is not needed.
>
> Just wanted to confirm with you before removing it,
> Presently, on platforms that support features like arch_capabilities, stibp, ibrs and ibpb
> /proc/cpuinfo does show them. Do you think we should really skip showing
> Enhanced IBRS capability?
The feature strings are automatically generated from the define. The
comment can be used to supress them by an empty "" string or to modify them
by a "override" string at the beginning of the comment.
> > > + /*
> > > + * As we don't use IBRS in kernel, nobody should have set
> > > + * SPEC_CTRL_IBRS until now. Shout loud if somebody did enable
> > > + * SPEC_CTRL_IBRS before us.
> > > + */
> >
> > This comment does not make sense. What prevents the BIOS/bootloader or the
> > hypervisor from setting it?
> >
>
> Makes sense. Removed it from V3.
>
> > > + WARN_ON_ONCE(x86_spec_ctrl_base & SPEC_CTRL_IBRS);
Please remove the warnon as well.
> > > + /* Ensure SPEC_CTRL_IBRS is set after VMEXIT from a guest */
> > > + x86_spec_ctrl_base |= SPEC_CTRL_IBRS;
> >
> > And what exactly writes the MSR?
> >
>
> While booting, x86_spec_ctrl_setup_ap() does that and after VMEXIT
> x86_spec_ctrl_restore_host().
>
> As x86_spec_ctrl_setup_ap() does wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base),
> I thought writing here would be redundant.
x86_spec_ctrl_setup_ap() is only called on the AP but not on the BP. So the
boot processor will not have it set, unless something else writes the
MSR. So you really want to have an explicit write there.
Thanks,
tglx
next prev parent reply other threads:[~2018-07-31 8:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-30 19:19 Sai Praneeth Prakhya
2018-07-30 21:00 ` Thomas Gleixner
2018-07-31 4:03 ` Prakhya, Sai Praneeth
2018-07-31 8:24 ` Thomas Gleixner [this message]
2018-07-31 17:42 ` Prakhya, Sai Praneeth
2018-07-31 19:44 ` Thomas Gleixner
2018-08-01 8:01 ` Prakhya, Sai Praneeth
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=alpine.DEB.2.21.1807311018040.1725@nanos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=dave.hansen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=ravi.v.shankar@intel.com \
--cc=sai.praneeth.prakhya@intel.com \
--cc=tim.c.chen@intel.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
all inboxes | Powered by JetHome®