Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2139131imm; Thu, 19 Jul 2018 14:00:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcsbV++xtYHPiuTQu/r0ZCxmoQRtdot8Ge4Jq3dqJCOf4tdlfFy2wW8TCHypEDx+Mp0Eqe6 X-Received: by 2002:a62:1b07:: with SMTP id b7-v6mr11113749pfb.70.1532034006055; Thu, 19 Jul 2018 14:00:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532034006; cv=none; d=google.com; s=arc-20160816; b=x0pPDS7saUYbVaDCWRQyFo3z3ZIpTtiLj07uzkZGNZaa+iKQcfKC12VGVbGNHu2pDL 38TnySgFZa+TPfV1ayR+8phxpLppQtM7mLEW/lMy88hM9VdbvmDV9MCuTB00sC7/OQZw vbg8l/9VZpj5aI8ofI3Ka7W6/D8Dd6IuYxZfzdBRN7/HkD3heYh2oBe3G4Wp96wJZGuy mU3pMHBobSyCx2ay8leQzbkDNSgl5gzifwFOcwTx7J7D/idowAHtGE6keJg9wO4ETojP ALyMz119ip5L4MLZKG58CsHkAyEpbYNj5Wst5KE4JuPclh5Ka59E8oBQiYiDuCx2BlQA jnZw== 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=Ll/YJfhEp8kkigECxmh0rN/scwVAYPDz9KNxD8BsL3o=; b=FiBKkvsFOqKnV4tuWvkVqyCJLikvdEy8DwqDVyfw46bkWkbpIYEZAEV4PMRD9vaot5 S4v7982Oi0OV4fthMPVYLf7Z61i9Y+gYbyBKUWjW0GFHl5mwFyrztQutyFv2xWCGVM2r hOYYJdLo47/NeyfTUynRe9qcSCY5bAaSV8vP25B0GUiBF78bvyjTZAvc7vzaW4pPhv7m C7O9OGJQPWXAIkFcbmxTDz8sQs/zR3sk2WHgNzlTlkQnW/A4BSvRwm8Iv1VgMrUBUV1f oSH4F6s7vXkM+TizGTfzXd55pd86GJ4GdKA05ucKxpDclj2idfHKtHFoRAuf7i2KU6r7 l04w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=lb9Pauuk; 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 p1-v6si136247plb.204.2018.07.19.13.59.51; Thu, 19 Jul 2018 14:00:06 -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=lb9Pauuk; 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 S1731697AbeGSVmw (ORCPT + 99 others); Thu, 19 Jul 2018 17:42:52 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:45826 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730315AbeGSVmv (ORCPT ); Thu, 19 Jul 2018 17:42:51 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6JKsSHZ191938; Thu, 19 Jul 2018 20:56:53 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=Ll/YJfhEp8kkigECxmh0rN/scwVAYPDz9KNxD8BsL3o=; b=lb9PauukOkB31hMwsKQBtXHPa+wbdWqD7YBpRgRjrWLRfavu40xHz81cW5WNewWFvJoc mwrNapoCRVCsX5gL7jt8iqeZORqIL2q31IAxAf++1NMFDqKT3kQiM25sSfcJZFQJRSNl sTyEszU4fdCoR45bOZdKno+enz13uUOglq0TQI5F0ADptz95tKJJC9yEmnA7o3qIkxAz q/BEurbd3SUifFLjsOniKQJj3vpQ551pvkeeRc8ramKHIkRaU1/CqhxhLtH+UOMCd2pj p4bsL2YTJBUSdH3iEFudMSnx7pmxbkbHOgfdNqmpkyCHoerhUPDeva/BDtXdMwOSW2OF qA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2k9yjgrugy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jul 2018 20:56:53 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6JKuq6a014472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jul 2018 20:56:52 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6JKupZN026990; Thu, 19 Jul 2018 20:56:51 GMT Received: from localhost.localdomain (/73.69.118.222) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 19 Jul 2018 20:56:51 +0000 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 v15 21/26] x86/tsc: use tsc early Date: Thu, 19 Jul 2018 16:55:40 -0400 Message-Id: <20180719205545.16512-22-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180719205545.16512-1-pasha.tatashin@oracle.com> References: <20180719205545.16512-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8959 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=997 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807190218 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 7ea0718a4c75..9277ae9b68b3 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