Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp9149imm; Tue, 17 Jul 2018 19:26:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfucIKjcnNGSwlAieMsD5dPBDaHlhb9Eefhw/SAzC4BLgdIR9LcWXOfy6emEfVedG05zbmU X-Received: by 2002:a63:f557:: with SMTP id e23-v6mr3846996pgk.170.1531880798964; Tue, 17 Jul 2018 19:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531880798; cv=none; d=google.com; s=arc-20160816; b=U83C2OG6a+oRhGDhfMXtjVuIdbCcodGQUdbEepgAqaP11zLsAAvrycdbgSiyIhmV6Y ffdgH6ipnvLZas7RoshEmVxc6vRU1LrBhRskyzLZYdsJENXpyI2zSpsXijqdbffGlqOA tdDxntICp1hV30OpUpmq41YdT55xVyfHOifWsVGlXKC1pWtw+o+c3BSkIyZEiWDSg35z drNkTXKXjRyycjpMOz1Wn7MOSD7hxB8jNjn9Mo+d188VZF63Ag0Am5QxbyjSwe6fd+oX Ji1bvVJpkDaSheEG66YnAd3aU4GTKtDBkgUobyMnAy5oZaN7PZy5M5TP2Rurn7i2YQ2b 4nzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=Bm1hL3z8KtKQZK7Ksi8zPH4LHPDtf/936zlUb2rvrFk=; b=uSoaiK8WaXxLQa4C+30HgOJCI0xZrLyEy7oVtmG5Uyc6rvuJ8pScpAIFJQsgyZui6c Vy2KDzIqzIA+xfgWQlfArlD7QzkT21nq+n2yht8rpdpZLeHFgKJGE2J4rRy+ZjWKalwv rIen2h29UG3j+5t2/gaRblJIBQ2WmgFqSb/eqsxlKg48eZ7HtLgRQ8vc+9kJN/y9+oA+ 6cX1o7WyXsN+lhSjYS9+bQkINq21NrMiXQoMCGF7OdXo4KBD38JnxjaraJ+RowTbW5VX 2MJabnpUB+IVj6SC9Pg1EEk2WUwtY0MM34vmIgYIov3Lz5tbwrhEtRV+yjaMAzKqmOBs bd4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=SfjXTS66; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 144-v6si2333246pge.406.2018.07.17.19.26.24; Tue, 17 Jul 2018 19:26:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=SfjXTS66; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731831AbeGRC7k (ORCPT + 99 others); Tue, 17 Jul 2018 22:59:40 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:45034 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731759AbeGRC7i (ORCPT ); Tue, 17 Jul 2018 22:59:38 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6I2KC0F001408; Wed, 18 Jul 2018 02:23:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=Bm1hL3z8KtKQZK7Ksi8zPH4LHPDtf/936zlUb2rvrFk=; b=SfjXTS66am7xCl/QbAWU2aH03j9EzBY8TcAsa8RySLwlL9JVxh67jp+xtOD8NkU7fsHp wAkfn3BCY8QSJwoi1MwIbyMggboQpesB4MHeyrRVR4Atl9HPC/5QTNpJA2PRtFMeqmMt 7KBPOJJt8tuxL99HX0//NBdnXuRM/o6+oyfLy8B8ye71J4HGLOivans5ggqsHL/TVyV4 Pnon/gHNGzTO1zKiukNdZRMXvjKu2fgYr62g+UQ+Ahz5q0XjnEyN4LDF/VNV1lfw04kN 2ttqqhJ49sRedFZrC7tQOQvsd9Dxzc4FIthuehtFBarngbmRpk+3SOgiH9HGRhKAlDdi ww== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2k7a3t34dt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Jul 2018 02:23:16 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6I2NFGd024566 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Jul 2018 02:23:15 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w6I2NEvG020853; Wed, 18 Jul 2018 02:23:14 GMT Received: from localhost.localdomain (/73.69.118.222) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 Jul 2018 19:23:14 -0700 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux@armlinux.org.uk, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, john.stultz@linaro.org, sboyd@codeaurora.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, douly.fnst@cn.fujitsu.com, peterz@infradead.org, prarit@redhat.com, feng.tang@intel.com, pmladek@suse.com, gnomes@lxorguk.ukuu.org.uk, linux-s390@vger.kernel.org, pasha.tatashin@oracle.com, boris.ostrovsky@oracle.com, jgross@suse.com, pbonzini@redhat.com Subject: [PATCH v14 22/25] x86/tsc: use tsc early Date: Tue, 17 Jul 2018 22:22:08 -0400 Message-Id: <20180718022211.6259-23-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180718022211.6259-1-pasha.tatashin@oracle.com> References: <20180718022211.6259-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8957 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=946 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807180026 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org get timestamps and high resultion clock available to us as early as possible. native_sched_clock() outputs time based either on tsc after tsc_init() is called later in boot, or using jiffies when clock interrupts are enabled, which is also happens later in boot. On the other hand, tsc frequency is known from as early as when tsc_early_init() is called. Use the early tsc calibration to output timestamps early. Signed-off-by: Pavel Tatashin --- arch/x86/kernel/tsc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 0b1abe7fdd8e..39ff2881f622 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -1408,6 +1408,7 @@ void __init tsc_early_init(void) /* Sanitize TSC ADJUST before cyc2ns gets initialized */ tsc_store_and_check_tsc_adjust(true); cyc2ns_init_boot_cpu(); + static_branch_enable(&__use_tsc); } void __init tsc_init(void) -- 2.18.0