Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752265AbcD3V6V (ORCPT ); Sat, 30 Apr 2016 17:58:21 -0400 Received: from mail-oi0-f47.google.com ([209.85.218.47]:35722 "EHLO mail-oi0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751257AbcD3V6U convert rfc822-to-8bit (ORCPT ); Sat, 30 Apr 2016 17:58:20 -0400 MIME-Version: 1.0 In-Reply-To: <20160430191734.GB4084@pd.tnic> References: <1461567194-2007-1-git-send-email-mnghuan@gmail.com> <20160430132420.GA4084@pd.tnic> <20160430191734.GB4084@pd.tnic> From: Andy Lutomirski Date: Sat, 30 Apr 2016 14:57:59 -0700 Message-ID: Subject: Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables To: Borislav Petkov Cc: Paolo Bonzini , Thomas Gleixner , Ingo Molnar , X86 ML , Minfei Huang , Marcelo Tosatti , "linux-kernel@vger.kernel.org" , "H. Peter Anvin" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 917 Lines: 27 On Apr 30, 2016 12:17 PM, "Borislav Petkov" wrote: > > On Sat, Apr 30, 2016 at 10:47:49AM -0700, Andy Lutomirski wrote: > > Take a look at vread_pvclock. I decided that __pvclock_read_cycles > > was too ugly to use and was very slow and I just gave up and rewrote > > it. > > Should we kill __pvclock_read_cycles in favor of vread_pvclock? It looks > doable at a quick scan... > The in-kernel version might have to be a bit different because it needs to handle the !stable case. If !stable, it should just use the current CPU's copy which means that, realistically, it should just get_cpu and use the local copy unconditionally. Other than that, it could look a lot like the vread_pvclock variant. But I agree, the current thing is incomprehensible. --Andy > -- > Regards/Gruss, > Boris. > > SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) > --