Re: [PATCH v3 00/18] x86/tsc: Clean up rdtsc helpers
From: Borislav Petkov
Date: Wed Jun 17 2015 - 07:12:00 EST
On Tue, Jun 16, 2015 at 05:35:48PM -0700, Andy Lutomirski wrote:
> My sincere apologies for the spam. I send an unholy mixture of the
> real patch set and an old poorly split-up patch set, and the result
> is incomprehensible. Here's what I meant to send.
>
> After the some recent threads about rdtsc barriers, I remembered
> that our RDTSC wrappers are a big mess. Let's clean it up.
>
> Currently we have rdtscl, rdtscll, native_read_tsc,
> paravirt_read_tsc, and rdtsc_barrier. For people who haven't
> noticed rdtsc_barrier and who haven't carefully read the docs,
> there's no indication that all of the other accessors have a giant
> ordering gotcha. The macro forms are ugly, and the paravirt
> implementation is completely pointless.
>
> rdtscl is particularly awful. It reads the low bits. There are no
> performance critical users of just the low bits anywhere in the
> kernel.
>
> Clean it up. After this patch set, there are exactly three
> functions. rdtsc_unordered() is a function that does a raw RDTSC
> and returns a 64-bit number. rdtsc_ordered() is a function that
> does a properly ordered RDTSC for general-purpose use.
> barrier_before_rdtsc() is exactly what it sounds like.
>
> Changes from v2:
> - Rename rdtsc_unordered to just rdtsc
> - Get rid of rdtsc_barrier entirely instead of renaming it
> - The KVM patch is new (see above)
> - Added some acks
peterz reminded me that I'm lazy actually and don't reply to each patch :)
So, I like it, looks good, nice cleanup. It boots on my guest here - I
haven't done any baremetal testing though. Let's give people some more
time to look at it...
Thanks.
--
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/