Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1164597
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Borislav Petkov <bp@suse.de> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 13/17] x86/tsc: Rename native_read_tsc() to rdtsc_unordered() |
| Date | Sat, 13 Jun 2015 11:00:02 +0200 |
| Message-ID | <pAPse-7Wx-7@gated-at.bofh.it> (permalink) |
| References | <pAGRX-44S-5@gated-at.bofh.it> <pAGRZ-44S-55@gated-at.bofh.it> |
| X-Original-To | Andy Lutomirski <luto@kernel.org> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.23 (2014-03-12) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 46 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | x86@kernel.org, Peter Zijlstra <peterz@infradead.org>, John Stultz <john.stultz@linaro.org>, linux-kernel@vger.kernel.org, Len Brown <lenb@kernel.org>, Huang Rui <ray.huang@amd.com>, Denys Vlasenko <dvlasenk@redhat.com> |
| X-Original-Date | Sat, 13 Jun 2015 10:57:59 +0200 |
| X-Original-Message-ID | <20150613085758.GB3796@pd.tnic> |
| X-Original-References | <cover.1434152603.git.luto@kernel.org> <c6cb6f1ea95bfcd543c3e633ccdf0ec616a217a7.1434152603.git.luto@kernel.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | aioe.org linux.kernel:1164597 |
Show key headers only | View raw
On Fri, Jun 12, 2015 at 04:44:53PM -0700, Andy Lutomirski wrote:
> Now that there is no paravirt TSC, the "native" is inappropriate.
> The fact that rdtsc is not ordered can catch people by surprise, so
> call it rdtsc_unordered().
>
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
...
> @@ -109,7 +109,16 @@ notrace static inline int native_write_msr_safe(unsigned int msr,
> extern int rdmsr_safe_regs(u32 regs[8]);
> extern int wrmsr_safe_regs(u32 regs[8]);
>
> -static __always_inline unsigned long long native_read_tsc(void)
> +/**
> + * rdtsc_unordered() - returns the current TSC without ordering constraints
> + *
> + * rdtsc_unordered() returns the result of RDTSC as a 64-bit integer. The
> + * only ordering constraint it supplies is the ordering implied by
> + * "asm volatile": it will put the RDTSC in the place you expect. The
> + * CPU can and will speculatively execute that RDTSC, though, so the
> + * results can be non-monotonic if compared on different CPUs.
> + */
> +static __always_inline unsigned long long rdtsc_unordered(void)
I like the rdtsc_ordered() thing because it wraps the barrier and people
cannot just forget it. But let's call this not rdtsc_unordered() but
simply
rdtsc()
The "_unordered" suffix is unnecessary IMO since this function is a
simple wrapper around the hw insn and we do that naming scheme with all
such wrappers.
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2 13/17] x86/tsc: Rename native_read_tsc() to rdtsc_unordered() Andy Lutomirski <luto@kernel.org> - 2015-06-13 01:50 +0200 Re: [PATCH v2 13/17] x86/tsc: Rename native_read_tsc() to rdtsc_unordered() Borislav Petkov <bp@suse.de> - 2015-06-13 11:00 +0200
csiph-web