From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2717C43381 for ; Thu, 21 Mar 2019 10:12:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 84560218D4 for ; Thu, 21 Mar 2019 10:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553163145; bh=DNeDp5NMPTnO2YjqCCIP6djD+HIGlX7fq0gLo+gazRc=; h=Subject:To:Cc:From:Date:List-ID:From; b=Z52miYTKLzFQz+Ccp1Fh2NfVrEL3x0jqSrnMn1Ntw4OOPCVrBMUfoAbREzNzUs4yb sR78JojI3R0iL/hSLYulRkx5tc1TK9tmDUXFNNpPbido32bwHcPOH3cHEHCxnEthKJ RAhkiUHJGfi6xLUMujvK4hzgRQNrHFUPOrozdMGc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728095AbfCUKMZ (ORCPT ); Thu, 21 Mar 2019 06:12:25 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:54887 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727989AbfCUKMY (ORCPT ); Thu, 21 Mar 2019 06:12:24 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0CAE921949; Thu, 21 Mar 2019 06:12:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 21 Mar 2019 06:12:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=kg/S4c F1Fu1vJ3DtR4CmYOGYk56m/VnkTTXXUVo1pz8=; b=MWHWzalKC3wFMp95rXAJY7 Pn/+p80sg2lTetPEmVimeez/7PUmudQtNw+cd/zcMxoZkhqU7hw/AfgqnlHt2G5p bcQngVl5797Xsbj2NPo29FTAKKr25Y1rBbAID8O6e+j62VpAuCU/Z40ktVC66vqn NImht5U6vlRVbiZQ8TLIdO00a+B8RAg2S/O9hDSvRx4H/LpfGYLVzRvsaKrFWijY GJ8qRlIZLo1voZ3jteHDXAQZHefmOi0bzD7F8j/M8OcSB4c5qZKAILkKbcVXYLLG PZr9t5xjpy1JH4jwSeswtHcm+1Kg5BNprSi847nL996KjVDurymWeQVBz+Lq92rQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrieelucetufdoteggodetrfdotffvucfrrh hofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttddtlfenuc fhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhrgheqnecu kfhppeelhedrleekrddvjedrudekjeenucfrrghrrghmpehmrghilhhfrhhomhepghhrvg hgsehkrhhorghhrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (unknown [95.98.27.187]) by mail.messagingengine.com (Postfix) with ESMTPA id B920E10310; Thu, 21 Mar 2019 06:12:22 -0400 (EDT) Subject: FAILED: patch "[PATCH] x86/kvmclock: set offset for kvm unstable clock" failed to apply to 4.19-stable tree To: pasha.tatashin@soleen.com, asmadeus@codewreck.org, pbonzini@redhat.com Cc: From: Date: Thu, 21 Mar 2019 11:12:21 +0100 Message-ID: <155316314169253@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From b5179ec4187251a751832193693d6e474d3445ac Mon Sep 17 00:00:00 2001 From: Pavel Tatashin Date: Sat, 26 Jan 2019 12:49:56 -0500 Subject: [PATCH] x86/kvmclock: set offset for kvm unstable clock VMs may show incorrect uptime and dmesg printk offsets on hypervisors with unstable clock. The problem is produced when VM is rebooted without exiting from qemu. The fix is to calculate clock offset not only for stable clock but for unstable clock as well, and use kvm_sched_clock_read() which substracts the offset for both clocks. This is safe, because pvclock_clocksource_read() does the right thing and makes sure that clock always goes forward, so once offset is calculated with unstable clock, we won't get new reads that are smaller than offset, and thus won't get negative results. Thank you Jon DeVree for helping to reproduce this issue. Fixes: 857baa87b642 ("sched/clock: Enable sched clock early") Cc: stable@vger.kernel.org Reported-by: Dominique Martinet Signed-off-by: Pavel Tatashin Signed-off-by: Paolo Bonzini diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index e811d4d1c824..d908a37bf3f3 100644 --- a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c @@ -104,12 +104,8 @@ static u64 kvm_sched_clock_read(void) static inline void kvm_sched_clock_init(bool stable) { - if (!stable) { - pv_ops.time.sched_clock = kvm_clock_read; + if (!stable) clear_sched_clock_stable(); - return; - } - kvm_sched_clock_offset = kvm_clock_read(); pv_ops.time.sched_clock = kvm_sched_clock_read;