From patchwork Thu Aug 9 14:43:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 10561481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B14E11390 for ; Thu, 9 Aug 2018 14:44:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9822E2B35C for ; Thu, 9 Aug 2018 14:44:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BC122B49E; Thu, 9 Aug 2018 14:44:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32E542B35C for ; Thu, 9 Aug 2018 14:44:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732111AbeHIRJY (ORCPT ); Thu, 9 Aug 2018 13:09:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37366 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730419AbeHIRJY (ORCPT ); Thu, 9 Aug 2018 13:09:24 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B0AC982D5 for ; Thu, 9 Aug 2018 14:44:11 +0000 (UTC) Received: from amt.cnet (ovpn-112-4.gru2.redhat.com [10.97.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5751A675FD; Thu, 9 Aug 2018 14:44:11 +0000 (UTC) Received: from amt.cnet (localhost [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 4557810514E; Thu, 9 Aug 2018 11:43:44 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.7/8.14.7/Submit) id w79EheE8032699; Thu, 9 Aug 2018 11:43:40 -0300 Message-Id: <20180809144322.323704269@amt.cnet> User-Agent: quilt/0.60-1 Date: Thu, 09 Aug 2018 11:43:04 -0300 From: Marcelo Tosatti To: kvm@vger.kernel.org Cc: Paolo Bonzini , Radim Krcmar , Marcelo Tosatti Subject: [patch 2/2] KVM: x86: revert "update master clock before computing kvmclock_offset" References: <20180809144302.933793954@amt.cnet> Content-Disposition: inline; filename=kvmclock-revert-genupdate-order X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 09 Aug 2018 14:44:11 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Revert 0bc48bea36d178aea9d7f83f66a1b397cec9db5c, now that using CLOCK_MONOTONIC_RAW as the clock base does not require the guest to be stopped. This is good for testing CLOCK_MONOTONIC_RAW updates for the other cases. Signed-off-by: Marcelo Tosatti --- arch/x86/kvm/x86.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) Index: linux-2.6.git/arch/x86/kvm/x86.c =================================================================== --- linux-2.6.git.orig/arch/x86/kvm/x86.c 2018-08-09 10:33:27.323993052 -0300 +++ linux-2.6.git/arch/x86/kvm/x86.c 2018-08-09 11:34:59.030627158 -0300 @@ -4538,15 +4538,9 @@ goto out; r = 0; - /* - * TODO: userspace has to take care of races with VCPU_RUN, so - * kvm_gen_update_masterclock() can be cut down to locked - * pvclock_update_vm_gtod_copy(). - */ - kvm_gen_update_masterclock(kvm); now_ns = get_kvmclock_ns(kvm); kvm->arch.kvmclock_offset += user_ns.clock - now_ns; - kvm_make_all_cpus_request(kvm, KVM_REQ_CLOCK_UPDATE); + kvm_gen_update_masterclock(kvm); break; } case KVM_GET_CLOCK: {