public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: luto@kernel.org
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, bp@suse.de,
	thomas.lendacky@amd.com, hpa@zytor.com, john.stultz@linaro.org,
	x86@kernel.org
Subject: Re: [RFC PATCH 4/4] x86/TSC: Use RDTSCP
Date: Wed, 12 Dec 2018 02:37:53 +0300	[thread overview]
Message-ID: <20181211233753.GA26593@avx2> (raw)

> And I had a bit of a WTF moment, as in "WTF does
> RDTSC have to do with a speculation protection barrier".
> Does it actually make sense?

It doesn't. There was too much s/lfence/barrier_nospec/ apparently.

> +	asm volatile(ALTERNATIVE_3("rdtsc",
> +				   "mfence; rdtsc", X86_FEATURE_MFENCE_RDTSC,
> +				   "lfence; rdtsc", X86_FEATURE_LFENCE_RDTSC,
> +				   "rdtscp", X86_FEATURE_RDTSCP)
> +			: EAX_EDX_RET(val, low, high)
> +			/* RDTSCP clobbers ECX with MSR_TSC_AUX. */
> +			:: "ecx");

I have a question: does alternatives ordering matter? CPU can have
both features.

And other code in this file uses "c" for clobber.

             reply	other threads:[~2018-12-11 23:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 23:37 Alexey Dobriyan [this message]
2018-12-11 23:43 ` [RFC PATCH 4/4] x86/TSC: Use RDTSCP Borislav Petkov
2018-12-12  0:06   ` Borislav Petkov
  -- strict thread matches above, loose matches on Subject: below --
2018-12-11 22:23 [RFC PATCH 0/4] x86/alternative: Add ALTERNATIVE_3 Borislav Petkov
2018-12-11 22:23 ` [RFC PATCH 4/4] x86/TSC: Use RDTSCP Borislav Petkov
2018-12-11 22:59   ` Andy Lutomirski
2018-12-11 23:12     ` Lendacky, Thomas
2018-12-11 23:39       ` Borislav Petkov
2018-12-12  2:24         ` Andy Lutomirski
2018-12-12  9:59           ` Peter Zijlstra
2018-12-12 12:02             ` Andrea Parri
2018-12-12 10:08           ` Borislav Petkov
2018-12-12 18:07             ` Andy Lutomirski
2018-12-12 18:44               ` Borislav Petkov
2018-12-12 18:50                 ` Andy Lutomirski
2018-12-12 20:00                   ` Borislav Petkov
2018-12-12 20:09                     ` Andy Lutomirski
2018-12-12 20:29                       ` Borislav Petkov
2018-12-14 13:39                 ` David Laight
2018-12-15 18:53                   ` Andy Lutomirski
2018-12-12 14:15           ` Lendacky, Thomas
2018-12-12 14:18             ` Lendacky, Thomas

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=20181211233753.GA26593@avx2 \
    --to=adobriyan@gmail.com \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --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