Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752143AbdLARwy (ORCPT ); Fri, 1 Dec 2017 12:52:54 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:34963 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751308AbdLARww (ORCPT ); Fri, 1 Dec 2017 12:52:52 -0500 X-Google-Smtp-Source: AGs4zMa+l9KRI4bv4PUudsc0hpDomIyOA/rJoofemtsHyzvBZ250WE09IWrwl5CfB+w1lf4o8hce3A== Subject: Re: [PATCH RFC 2/6] x86/hyper-v: add a function to read both TSC and TSC page value simulateneously To: Stephen Hemminger , Vitaly Kuznetsov Cc: Stephen Hemminger , kvm@vger.kernel.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Haiyang Zhang , x86@kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , Andy Lutomirski , "H. Peter Anvin" , devel@linuxdriverproject.org, Thomas Gleixner References: <20171201131321.918-1-vkuznets@redhat.com> <20171201131321.918-3-vkuznets@redhat.com> <20171201092904.30d9831f@xeon-e3> From: Paolo Bonzini Message-ID: <77674d0f-f4c6-ad47-1984-ea040e256501@redhat.com> Date: Fri, 1 Dec 2017 18:52:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171201092904.30d9831f@xeon-e3> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 447 Lines: 16 On 01/12/2017 18:29, Stephen Hemminger wrote: >> +static inline u64 hv_read_tsc_page_tsc(const struct ms_hyperv_tsc_page *tsc_pg, >> + u64 *cur_tsc) >> +{ >> + *cur_tsc = rdtsc(); >> + >> + return cur_tsc; > Why do return and setting by reference. Looks like an ugly API. This is the fallback implementation for !CONFIG_HYPERV_TSCPAGE, which explains why it's ugly, but why is it needed at all (or it could just BUG())? Thanks, Paolo