[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181211233753.GA26593@avx2>
Date: Wed, 12 Dec 2018 02:37:53 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: luto@...nel.org
Cc: linux-kernel@...r.kernel.org, tglx@...utronix.de, bp@...e.de,
thomas.lendacky@....com, hpa@...or.com, john.stultz@...aro.org,
x86@...nel.org
Subject: Re: [RFC PATCH 4/4] x86/TSC: Use RDTSCP
> 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.
Powered by blists - more mailing lists