Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4046902pxb; Mon, 1 Feb 2021 10:58:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/zYxJ4ZgBdgSybmFpJXwHpmfrpk3Rn5LmrhqlmGgkbooBIoJkYlSnuf2M7w3B4gTQAdMl X-Received: by 2002:a17:906:3fc4:: with SMTP id k4mr18794309ejj.137.1612205890340; Mon, 01 Feb 2021 10:58:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612205890; cv=none; d=google.com; s=arc-20160816; b=jhoUn/K7gSTmv/skXbh75A+m3LjXo8t7YycTxpXfrmloBw2qwl5IoHB9B2vcffUFqQ zHU2ysHQW6FUl8ZFMoOxfc9vY36cXRDB50RPEe3bvXqIg7LxvNCFF1aGzDKqoDCd7T4k NjXihNbFgPoOQuSdmNV5EhZ4InlwqusSccAoqDJCE4Yo4znYr7xHD3lCYOHJBTPeQ+6e pL+KoWe3xjMCzk4/9mCEWe0f+sgJkPTLByArNto+dUYBxJdhYbcRUkTqm+rtu4sV2/BY 6NZ5hpGpn7xTMEFHTy3yaeqjnSxQd0iNjCN/QQ5BClkr1aZ6AZN+XdHPRP0mKikuAU6a /5CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=kLmSIentwLuFLVXnsJMLh0cc8SI2PvhOVhp/gMM3mlA=; b=ET4PIBnyWg03WxhD5yzD7dxwFc0hQIwWbdbFjCiHcfPKO8IwSjL3/kArzpWCbAwRAb JcSlFEHxzSRyFt3AACqInVf+8SN16pA6lvwl3GpMSb4UQa4PpGOGyZ2RJKGAfWXpA/dP syVo/XIoNcxCVLaqr7ONCcHHRceiW3kIQ+CloO3miZzk28rRm8QaXS0AogKmcRghrKjy /J4LyRVEE8UtEaGZcOYZyLaJwIqJAQiPmMeEuEhdfb+TOyPAm49yQ0mJJI/FDso5d8h5 DMoCOgaxR/YDjvZ2Z6//ny7zRvsw1EMFH0q0qh9DF8OvdQ3bOxWawdOz/g+RP0aL5Crl OD2A== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si11482991edu.256.2021.02.01.10.57.44; Mon, 01 Feb 2021 10:58:10 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231984AbhBASz7 (ORCPT + 99 others); Mon, 1 Feb 2021 13:55:59 -0500 Received: from mail-wm1-f54.google.com ([209.85.128.54]:54017 "EHLO mail-wm1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbhBASz5 (ORCPT ); Mon, 1 Feb 2021 13:55:57 -0500 Received: by mail-wm1-f54.google.com with SMTP id j18so234287wmi.3; Mon, 01 Feb 2021 10:55:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kLmSIentwLuFLVXnsJMLh0cc8SI2PvhOVhp/gMM3mlA=; b=QPcFhK98jL5M+sPlh2sZPlx6eJq6UG4LwgvdFC5FoVqM0LPzVszYQwSCQBUQopmNBU +rc35aZCLrUElo6ARraXHNbmKsPv7nFYH8Fwi+8sX5pGA6zLVxRwM5KLWk0ld+9Rtt1+ dq28U3c5+KnvkexkCdvSL6MsejLxSocR+G3zoreGDTmUVFewXEkrSdB0JKrq72GdenbH V5b8Bg10TTgd8mQed+WqDmaCWr2zbboiIamswAuaO26M5t3gPG6zAQ76WS1F5AEGOC2d IfY7StZN8hXcz8pMJ4fF5LyiHzt1aEKKfjq9ZpjkBBirtjkw8q6jOWn0Ul1IPrt1IB57 WzEA== X-Gm-Message-State: AOAM532r2Nv1q4DremUKdUJe6neIKaeQy9zQbjhcXHNthCylJIn9uZYr +u4GpDRlz8hjhSKg+Y2g/bE= X-Received: by 2002:a1c:2905:: with SMTP id p5mr254457wmp.156.1612205715150; Mon, 01 Feb 2021 10:55:15 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id v25sm224468wmh.4.2021.02.01.10.55.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Feb 2021 10:55:14 -0800 (PST) Date: Mon, 1 Feb 2021 18:55:13 +0000 From: Wei Liu To: Michael Kelley Cc: sthemmin@microsoft.com, kys@microsoft.com, wei.liu@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, daniel.lezcano@linaro.org, arnd@arndb.de, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH 08/10] clocksource/drivers/hyper-v: Handle sched_clock differences inline Message-ID: <20210201185513.or4eilecqhmxqjme@liuwe-devbox-debian-v2> References: <1611779025-21503-1-git-send-email-mikelley@microsoft.com> <1611779025-21503-9-git-send-email-mikelley@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1611779025-21503-9-git-send-email-mikelley@microsoft.com> User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 27, 2021 at 12:23:43PM -0800, Michael Kelley wrote: [...] > +/* > + * Reference to pv_ops must be inline so objtool > + * detection of noinstr violations can work correctly. > + */ > +static __always_inline void hv_setup_sched_clock(void *sched_clock) sched_clock_register is not trivial. Having __always_inline here is going to make the compiled object bloated. Given this is a static function, I don't think we need to specify any inline keyword. The compiler should be able to determine whether this function should be inlined all by itself. Wei. > +{ > +#ifdef CONFIG_GENERIC_SCHED_CLOCK > + /* > + * We're on an architecture with generic sched clock (not x86/x64). > + * The Hyper-V sched clock read function returns nanoseconds, not > + * the normal 100ns units of the Hyper-V synthetic clock. > + */ > + sched_clock_register(sched_clock, 64, NSEC_PER_SEC); > +#else > +#ifdef CONFIG_PARAVIRT > + /* We're on x86/x64 *and* using PV ops */ > + pv_ops.time.sched_clock = sched_clock; > +#endif > +#endif > +} > + > static bool __init hv_init_tsc_clocksource(void) > { > u64 tsc_msr; > -- > 1.8.3.1 >