Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1206484imm; Wed, 11 Jul 2018 20:08:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd1JG9ESPKqJLfaWpZC9/QkuvhFDZfmzjQkINseFrQ4ykB3RxCxWA+5c7PUVywRPXM7Mtv3 X-Received: by 2002:a63:2c0d:: with SMTP id s13-v6mr459458pgs.37.1531364895099; Wed, 11 Jul 2018 20:08:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531364895; cv=none; d=google.com; s=arc-20160816; b=gR5zmMchkhCP50GzfCdl25IRywLoY2F9NfUOYdGw5U/T2EZk4sI4FOjE2qw/i4Bvxp OxJLycE4SnYDFhrckv+H7yRvZSmSvJy/2cFeRqKcDtjvl0BWieD9LkdIyfJ8QmAGoj0a B1P50D0WHRgFjJyHMp6qrk/01DBNMBY5uZzxIl2HByshggHqeWxRPk2ZVlW/2MCpJ+3b qy1OVOk8ncXDGYJs99AXYpZmVXR/9SGoAYyyoQ/8tTxST+pVdPdx5Pydiko36g4vtaFS GEr4pZzdexJSX/YXuLfvZYpcitufEW5+IdwZcokqghSo2vDOAtyZVDMsWBNzxHcfqYF2 of+w== 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=eDnL1nyEHraaO3z6RQyjioTiHfBQEtHgKcX1rPNGLIvTMKAPaBxMoLivcUmTb3Ujon fKxCqkdlDl66YUSkI1DLmv5xXdQCbKX9L5CkJO+TNOTt+owIuWEK8rH4q4LfT9cc7uie WjXBbAueBE5yjtM0DjEZDh0OusTzUlYjvBVZu6SU3XH2ae285FWE6Yix0Mo0G5Fm7m6u oBL/9Cbjm+ILlv4voxP5xggoTl7AclVLIIscMOcE6OtHTDX3VvTcnkOS/yBPblh5wiYw GwMLXiIxcZKqbX/izsHWvjls+jG/2TeDicqX3+x0FmyDwD80BigtWSqAQabERoquMKYU uf2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=Dkkf07km; 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 n70-v6si17239188pfa.320.2018.07.11.20.08.00; Wed, 11 Jul 2018 20:08:15 -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=Dkkf07km; 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 S1732959AbeGLAOw (ORCPT + 99 others); Wed, 11 Jul 2018 20:14:52 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:44540 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390903AbeGLANI (ORCPT ); Wed, 11 Jul 2018 20:13:08 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6C04tGL148215; Thu, 12 Jul 2018 00:04:55 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=Dkkf07kmjeaefdG3PVbojyMNbGEiVvLRUZ+RelLiBan3k1C4P7oSt6waxVUt4VcaQF0t lB80COj5GWldGde/EsGeCdtkQbu+1pfJPlyCUk7/eeX+qtmohupWycPCvkv+oOfnLC0b LMdbTjVZMXPetzdK6vnKoBZUtjZxs0jOz+UxCEqfL5u6Kf9cWNHZ1G2uXUsII4bT6Exu Y5K8C7LCEBiNFymv8myvduECu/7n2PhsEIYaYU6LQYo6xUDI1WuxotAwsafNRqNz15dJ XltVp334D8E7/ClCIBfCIqSCigsmDlAx/cdJgCKL595R3Ih2XFFQQnGDBPcqVjR3Kq/r rQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2k2p768ae8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jul 2018 00:04:55 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6C04sAl000754 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jul 2018 00:04:54 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w6C04r1G004663; Thu, 12 Jul 2018 00:04:53 GMT Received: from localhost.localdomain (/73.69.118.222) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 11 Jul 2018 17:04:53 -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 Subject: [PATCH v13 15/18] x86/tsc: use tsc early Date: Wed, 11 Jul 2018 20:04:16 -0400 Message-Id: <20180712000419.5165-16-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180712000419.5165-1-pasha.tatashin@oracle.com> References: <20180712000419.5165-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8951 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=949 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807110252 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