From: Borislav Petkov <bp@alien8.de>
To: David Woodhouse <dwmw@amazon.co.uk>
Cc: tglx@linutronix.de, torvalds@linux-foundation.org,
x86@kernel.org, linux-kernel@vger.kernel.org,
peterz@infradead.org, tim.c.chen@linux.intel.com,
dave.hansen@intel.com, arjan.van.de.ven@intel.com
Subject: Re: [RFC PATCH 3/4] x86/speculation: Use IBRS if available before calling into firmware
Date: Wed, 7 Feb 2018 12:17:39 +0100 [thread overview]
Message-ID: <20180207111739.GA8698@pd.tnic> (raw)
In-Reply-To: <1517961794-14972-4-git-send-email-dwmw@amazon.co.uk>
Just some random thoughts:
On Wed, Feb 07, 2018 at 12:03:13AM +0000, David Woodhouse wrote:
> +#define alternative_msr_write(_msr, _val, _feature) \
> + asm volatile(ALTERNATIVE("", \
> + "movl %[msr], %%ecx\n\t" \
> + "movl %[val], %%eax\n\t" \
> + "movl $0, %%edx\n\t" \
We'll never write anything except 0 in %edx?
> + "wrmsr", \
> + _feature) \
> + : : [msr] "i" (_msr), [val] "i" (_val) \
> + : "eax", "ecx", "edx", "memory")
So I'm not crazy about making it a separate macro because TBH it doesn't
look too generic to do that but then again what do I know, considering
recent history. :-)
[ Maybe I need to not look at the spectral meltdown for a
couple of weeks and simply take a break. ]
I guess it is fine if it is in nospec-branch.h and not prefix it with
alternative_ so that it doesn't give people ideas.
Oh and firmware_restrict_branch_speculation_start/end() is just too long
a name.
All IMHO, of course.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
next prev parent reply other threads:[~2018-02-07 11:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-07 0:03 [RFC PATCH 0/4] Retpoline / IBRS_ALL David Woodhouse
2018-02-07 0:03 ` [RFC PATCH 1/4] Revert "x86/speculation: Simplify indirect_branch_prediction_barrier()" David Woodhouse
2018-02-07 0:03 ` [RFC PATCH 2/4] KVM: x86: Reduce retpoline performance impact in slot_handle_level_range() David Woodhouse
[not found] ` <1518092274.3677.177.camel@infradead.org>
2018-02-08 12:28 ` [Fwd: [RFC PATCH 2/4] KVM: x86: Reduce retpoline performance impact in slot_handle_level_range()] Sironi, Filippo
2018-02-07 0:03 ` [RFC PATCH 3/4] x86/speculation: Use IBRS if available before calling into firmware David Woodhouse
2018-02-07 11:17 ` Borislav Petkov [this message]
2018-02-07 11:29 ` David Woodhouse
2018-02-07 0:03 ` [RFC PATCH 4/4] x86/speculation: Support "Enhanced IBRS" on future CPUs David Woodhouse
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=20180207111739.GA8698@pd.tnic \
--to=bp@alien8.de \
--cc=arjan.van.de.ven@intel.com \
--cc=dave.hansen@intel.com \
--cc=dwmw@amazon.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@linux.intel.com \
--cc=torvalds@linux-foundation.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®