Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp3534250ybg; Sun, 7 Jun 2020 02:38:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgEWdFd1hxiuTkVoM7piQC/O2mdyZdczzZa7GNJ8pHAJM1PTosk8cG/dzhwjMZtXg0hACX X-Received: by 2002:a05:6402:549:: with SMTP id i9mr17301614edx.159.1591522696840; Sun, 07 Jun 2020 02:38:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591522696; cv=none; d=google.com; s=arc-20160816; b=qDxtk59+VYdxNb+sPP8l2RQClC7r+QypgWXvwJecyNQzGAa1GzT0QT7ebm8jSqTbDU JXeKYKCq+JW9N0rCHwV9SXEMODtnqYFlXCJuo/hAIhFDOpEdDo2R/piFTyzGJsMKYz4i RUevvyvqVQ2omuQno7Ua62q0quDz6D08wrL3aboN3V+Y9LFdDIzEqQTrsnVpqyKyb0Pu tmLnDS9T4JiOARhhFOMRnonCWF/drz3v2Z2ZrVU2TZlEUaucH8T1n97iYtgHG2HJqQPp KORqSPqgc+rx1b3inq8uqTVS7GVIlEyPxa6VA4ofkUE1Qz7zHPs4HQy+c4jNls05URd2 OQdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:subject:cc:to :from:date:user-agent:message-id; bh=Yh5CKN5LRK7HL2bv/KJmluG2/WSWRrn6PcUXJYAhu4c=; b=A3b1btsPiKVIEF97Uf4Vxi6fxXqNO5vE4bxMuu4hsIXJrTZYt3ZAmjexTy6KeEfO6l TikElEs67o36cGw8+O0OA0zPY7y5eVgNiTnkMqaMdn4WK/6tvbuaZAcA8PHNHmVVnMM5 +IiYnoQG2wR4ZMAWS7nFrSvGvnsQv4vmNjFC/GmHI7Pp6WRTBG/Ft60MRnQUJqVGHw0o mbEFAFm0Az+QHS1or1fRqEU+p3Sh/1eGfM2+A+w+qOg7Ev7z05ZCGWucCKYH2nvpih/S IiWhlTuVDaYXip53MQWraMgdqmkKgbNB1icXX/ZzwtaQKp+uLw7k4b4/hHxHLV/faaVN ZbwQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb22si6714461ejb.99.2020.06.07.02.37.53; Sun, 07 Jun 2020 02:38:16 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726535AbgFGJgJ (ORCPT + 99 others); Sun, 7 Jun 2020 05:36:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726502AbgFGJgH (ORCPT ); Sun, 7 Jun 2020 05:36:07 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B06D5C08C5C3 for ; Sun, 7 Jun 2020 02:36:06 -0700 (PDT) Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jhrie-0000K4-Ui; Sun, 07 Jun 2020 11:35:57 +0200 Received: from nanos.tec.linutronix.de (localhost [IPv6:::1]) by nanos.tec.linutronix.de (Postfix) with ESMTP id F02F5FF805; Sun, 7 Jun 2020 11:35:55 +0200 (CEST) Message-Id: <20200606215114.380723277@linutronix.de> User-Agent: quilt/0.65 Date: Sat, 06 Jun 2020 23:51:14 +0200 From: Thomas Gleixner To: LKML Cc: Miklos Szeredi , x86@kernel.org, Vincenzo Frascino , Andy Lutomirski , Paolo Bonzini , Juergen Gross , Christophe Leroy Subject: [patch 0/3] vdso: Unbreak VDSO with PV and HyperV clocksources Content-transfer-encoding: 8-bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Miklos reported [1] that the recent VDSO changes broke paravirt clocksource based VDSO in the case that the clocksource is invalidated by the hypervisor which happens after a suspend/resume cycle of the host. The result is a stale clocksource which is about 2200 seconds ahead of the actual time and jumps forward by 2200 seconds once 2200 seconds have elapsed. The reason for this is the core code change which optimized the VDSO clocksource validation by checking for the clocksource mode instead of using the rather subtle check for the clocksource read return value whether it has bit 63 set. For some reason my brain blanked when doing that change, even if I should have known better. The following series restores the previous behaviour but preserves the initially intended optimization for architectures which don't need that PV handling. Thanks, tglx [1] https://lore.kernel.org/r/CAJfpegstNYeseo_C4KOF9Y74qRxr78x2tK-9rTgmYM4CK30nRQ@mail.gmail.com 8<----------------- arch/x86/include/asm/vdso/gettimeofday.h | 18 ++++++++++++++++++ kernel/time/clocksource.c | 2 -- lib/vdso/gettimeofday.c | 19 +++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-)