Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1798642pxb; Mon, 8 Mar 2021 06:43:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyV+e5Mb4lX2NQIyl4RsGF7K3xBmgEj71ReDMEYIAV+Awq6Qg5QxPDGGW028ECrbs0DbvmB X-Received: by 2002:a05:6402:b70:: with SMTP id cb16mr22366316edb.11.1615214604508; Mon, 08 Mar 2021 06:43:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615214604; cv=none; d=google.com; s=arc-20160816; b=XTC7Mj7FMQP68DNouv5dG86ZFjjw2uzii020vSZwjONTAAhbsK8438/e1KZw2wYrDb 18SAsmqP4jus9wSX6jhc8pCOjaWd2Ar02vWA/lesY0vFx35KhZp7F7/wOcqezDeEfgw3 vb4szT5LVLECZ/xRr4Ag+s9EOOVmHPh9yT8/C9cIkGyFB11p0ZKXtIGANIfB4NoCAQml qFjmZeu4NWehXLPtCFak53WrV/8r4wKSXt5HrLokvOUBrG1dW6JxJ7C+jEvjQWG0TjrX jWVOjjhvIHZlEfZTxBF6C2wF9lJNVkrQNLX49goByYyrHF5aWsCiCVhbLM6zTJb01y5X 2Yqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=7B7r2PIQsNLPhUBaGZox3quraAswSP5TnQzchYGCOUM=; b=Nhzj7zFNCripHOkDyG4rRQK4Kq25O12qkJmWutMbeTpr8TLZvn65xbWsvqMccX80R8 KfvWUH1bg9zKMZH8sZRxnXqG/sgmK9JXxw1qD1e7NKX5xxWPwSMFvTwcFG2gmE0kVKHS Du5ZNf0cTGy+xbgja7vj3aEra35uSry7YfatZfMidVjJulaw5b4ewALwVPOAVB5qyPQt Y+Ygu1iYCbdOM5z1ptz5cWW5oxUBGTvFrwerHBqU7hhd+CDM9WntXFbmefzcjcRQsNZE pFsTCCvlcHICpxWazFH8txNMv/xDPr8bc8H+sP83uKugU30H8jKjZW8TgwrZOQjwAtY6 5epg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qu5jtfWT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s20si6893054eji.387.2021.03.08.06.42.57; Mon, 08 Mar 2021 06:43:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qu5jtfWT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229650AbhCHOl4 (ORCPT + 99 others); Mon, 8 Mar 2021 09:41:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230385AbhCHOlu (ORCPT ); Mon, 8 Mar 2021 09:41:50 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A479C061760 for ; Mon, 8 Mar 2021 06:41:50 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id 7so11751535wrz.0 for ; Mon, 08 Mar 2021 06:41:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=7B7r2PIQsNLPhUBaGZox3quraAswSP5TnQzchYGCOUM=; b=qu5jtfWTr1ZQolUgTQLm1z8dITdB6EwY2PQSWLoQN4+pJEBx26DobIKS9tYvv5WB3n AZensSnEF9B7B8+AwA9WSqUUKOItJPYu4j0qEHpf2RB7yXQl2TrwqxtjJlvd0kJ0P/s+ dbIJS2iQsQEo87nnl/XepAs81x9KczjunahnOfBv38d3s0rIgp0d7JIK9IcEYPKIHjkW Jk+eB9LgmIG2Wgc9aBk8F2jT1aBgJstvQajp9FU7iwhBszglAT452RVzY1WQpANw8B66 UdsXpesD7n6zN8obaK8I3bTQMTEfc4i/yivS0eIrSr4ryIXFw7Jbz6bFK3pXoRvjGfd3 wg+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7B7r2PIQsNLPhUBaGZox3quraAswSP5TnQzchYGCOUM=; b=Bvjb51pBgmmY48eTbzNjNjy1tre/aYH2cNWJz1UwtYfW3KMUevMAS5mIIaEdSdLbl1 ZGmfrj4/yUFMLL5E950pDMj3VKaTrhCdkMSP7WgafmbrVPTGSMKaGTqxOjdlgKAZkJf8 xmMV2wygr90KhEJeN5ZcY5lR6G7WpzsHb+CkRgwn4xwYdRP74mi0LGmuEkwU53/jP2DA GJJ5dz+eZDaOdmAhk1bCHii/htulOx5stWSpi6YJ0yKlbRmO91YZIpGk0H25sVLNR1NF Gk4pcCfrEYljVwiIaxQHRxS8w1CMYn+Z+ruzm6PSOTj9AlVJrxssrTZIiFgYII7WixOO t+kA== X-Gm-Message-State: AOAM533nJfpaMOPILODHDP6eeBFon0e13CiaOPMHnSLsUvnsVmJ723VO ugHNaXijA95CH4gwoJkF05OOmQ== X-Received: by 2002:a05:6000:1546:: with SMTP id 6mr22940925wry.398.1615214508819; Mon, 08 Mar 2021 06:41:48 -0800 (PST) Received: from ?IPv6:2a01:e34:ed2f:f020:60f3:8fc:7d4b:c2d9? ([2a01:e34:ed2f:f020:60f3:8fc:7d4b:c2d9]) by smtp.googlemail.com with ESMTPSA id r10sm19761272wmh.45.2021.03.08.06.41.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Mar 2021 06:41:48 -0800 (PST) Subject: Re: [PATCH v3 07/10] clocksource/drivers/hyper-v: Handle vDSO differences inline To: Michael Kelley Cc: "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "linux-arch@vger.kernel.org" , Stephen Hemminger , KY Srinivasan , "wei.liu@kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "hpa@zytor.com" , "arnd@arndb.de" , "linux-hyperv@vger.kernel.org" References: <1614721102-2241-1-git-send-email-mikelley@microsoft.com> <1614721102-2241-8-git-send-email-mikelley@microsoft.com> <25234414-d905-0f9c-af92-9a9e4cde30c4@linaro.org> From: Daniel Lezcano Message-ID: <6dc5ed39-ab08-67fb-b528-26c3145bde0b@linaro.org> Date: Mon, 8 Mar 2021 15:41:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/03/2021 14:49, Michael Kelley wrote: > From: Michael Kelley Sent: Tuesday, March 2, 2021 3:07 PM >> >> From: Daniel Lezcano Sent: Tuesday, March 2, 2021 2:14 PM >>> >>> On 02/03/2021 22:38, Michael Kelley wrote: >>>> While the driver for the Hyper-V Reference TSC and STIMERs is architecture >>>> neutral, vDSO is implemented for x86/x64, but not for ARM64. Current code >>>> calls into utility functions under arch/x86 (and coming, under arch/arm64) >>>> to handle the difference. >>>> >>>> Change this approach to handle the difference inline based on whether >>>> VDSO_CLOCK_MODE_HVCLOCK is present. The new approach removes code under >>>> arch/* since the difference is tied more to the specifics of the Linux >>>> implementation than to the architecture. >>>> >>>> No functional change. >>>> >>>> Signed-off-by: Michael Kelley >>>> Reviewed-by: Boqun Feng >>>> --- >>>> arch/x86/include/asm/mshyperv.h | 4 ---- >>>> drivers/clocksource/hyperv_timer.c | 10 ++++++++-- >>>> 2 files changed, 8 insertions(+), 6 deletions(-) >>>> >>>> diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h >>>> index c10dd1c..4f566db 100644 >>>> --- a/arch/x86/include/asm/mshyperv.h >>>> +++ b/arch/x86/include/asm/mshyperv.h >>>> @@ -27,10 +27,6 @@ static inline u64 hv_get_register(unsigned int reg) >>>> return value; >>>> } >>>> >>>> -#define hv_set_clocksource_vdso(val) \ >>>> - ((val).vdso_clock_mode = VDSO_CLOCKMODE_HVCLOCK) >>>> -#define hv_enable_vdso_clocksource() \ >>>> - vclocks_set_used(VDSO_CLOCKMODE_HVCLOCK); >>>> #define hv_get_raw_timer() rdtsc_ordered() >>>> >>>> /* >>>> diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c >>>> index c73c127..06984fa 100644 >>>> --- a/drivers/clocksource/hyperv_timer.c >>>> +++ b/drivers/clocksource/hyperv_timer.c >>>> @@ -370,11 +370,13 @@ static void resume_hv_clock_tsc(struct clocksource *arg) >>>> hv_set_register(HV_REGISTER_REFERENCE_TSC, tsc_msr); >>>> } >>>> >>>> +#ifdef VDSO_CLOCKMODE_HVCLOCK >>>> static int hv_cs_enable(struct clocksource *cs) >>>> { >>>> - hv_enable_vdso_clocksource(); >>>> + vclocks_set_used(VDSO_CLOCKMODE_HVCLOCK); >>>> return 0; >>>> } >>>> +#endif >>> >>> We had a confusion here. The suggestion was to remove the #ifdef here >>> and add the __maybe_unused annotation to the function. >> >> I wondered if maybe that's what you were getting at with your >> most recent comments. But the code doesn't compile on ARM64 >> with __maybe_unused instead of the #ifdef because >> VDSO_CLOCKMODE_HVCLOCK is undefined. >> >> Michael >> > > Daniel -- any additional comments/feedback? Getting your Ack on > this patch should be the last step to wrap up the patch series. It would have been nice to simplify those #ifdef but I don't see a straightforward change for that... :( Acked-by: Daniel Lezcano -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog