From patchwork Fri Sep 18 15:54:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= X-Patchwork-Id: 7218601 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E68D59F372 for ; Fri, 18 Sep 2015 15:58:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29F0F2090E for ; Fri, 18 Sep 2015 15:58:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 40C832082E for ; Fri, 18 Sep 2015 15:58:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755193AbbIRP5z (ORCPT ); Fri, 18 Sep 2015 11:57:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48522 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754188AbbIRP5y (ORCPT ); Fri, 18 Sep 2015 11:57:54 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 302388E6EC; Fri, 18 Sep 2015 15:57:54 +0000 (UTC) Received: from potion (dhcp-1-105.brq.redhat.com [10.34.1.105]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t8IFvpkp016898; Fri, 18 Sep 2015 11:57:52 -0400 Received: by potion (sSMTP sendmail emulation); Fri, 18 Sep 2015 17:57:51 +0200 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= To: linux-kernel@vger.kernel.org Cc: kvm@vger.kernel.org, Paolo Bonzini , Marcelo Tosatti , Luiz Capitulino Subject: [RFC PATCH 0/2] kvmclock: fix ABI breakage from PVCLOCK_COUNTS_FROM_ZERO. Date: Fri, 18 Sep 2015 17:54:28 +0200 Message-Id: <1442591670-5216-1-git-send-email-rkrcmar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,HK_RANDOM_FROM, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch series will be disabling PVCLOCK_COUNTS_FROM_ZERO flag and is RFC because I haven't explored many potential problems or tested it. [1/2] uses a different algorithm in the guest to start counting from 0. [2/2] stops exposing PVCLOCK_COUNTS_FROM_ZERO in the hypervisor. A viable alternative would be to implement opt-in features in kvm clock. And because we probably only broke one old user (the infamous SLES 10), a workaround like this is also possible: (but I'd rather not do that) Radim Kr?má? (2): x86: kvmclock: abolish PVCLOCK_COUNTS_FROM_ZERO Revert "KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system MSR" arch/x86/include/asm/pvclock-abi.h | 1 + arch/x86/kernel/kvmclock.c | 46 +++++++++++++++++++++++++++++--------- arch/x86/kvm/x86.c | 4 ---- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index a60bdbccff51..ae9049248aaf 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2007,7 +2007,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) ka->boot_vcpu_runs_old_kvmclock = tmp; - ka->kvmclock_offset = -get_kernel_ns(); + if (!ka->boot_vcpu_runs_old_kvmclock) + ka->kvmclock_offset = -get_kernel_ns(); } vcpu->arch.time = data;