From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH v3 00/18] x86/tsc: Clean up rdtsc helpers Date: Wed, 17 Jun 2015 13:11:41 +0200 Message-ID: <20150617111141.GF26661@pd.tnic> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: x86@kernel.org, Peter Zijlstra , John Stultz , linux-kernel@vger.kernel.org, Len Brown , Huang Rui , Denys Vlasenko , kvm@vger.kernel.org, Ralf Baechle To: Andy Lutomirski Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 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. --