From patchwork Fri Mar 25 08:20:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zachary Amsden X-Patchwork-Id: 661111 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2P8Knpv013641 for ; Fri, 25 Mar 2011 08:20:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755492Ab1CYIUa (ORCPT ); Fri, 25 Mar 2011 04:20:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41310 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754197Ab1CYIU2 (ORCPT ); Fri, 25 Mar 2011 04:20:28 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2P8KHpo010727 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 25 Mar 2011 04:20:18 -0400 Received: from [10.11.8.230] (vpn-8-230.rdu.redhat.com [10.11.8.230]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p2P8KEuF015097; Fri, 25 Mar 2011 04:20:14 -0400 Message-ID: <4D8C503D.6000607@redhat.com> Date: Fri, 25 Mar 2011 04:20:13 -0400 From: Zachary Amsden User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Thunderbird/3.0.5 MIME-Version: 1.0 To: Nikola Ciprich CC: KVM list , Linux kernel list , nikola.ciprich@linuxbox.cz, Avi Kivity , Glauber Costa Subject: Re: [PATCHv2] fix regression caused by e48672fa25e879f7ae21785c7efd187738139593 References: <20110307101827.GA1762@pcnci.linuxbox.cz> <4D768A62.3050903@redhat.com> <20110309193003.GB1762@pcnci.linuxbox.cz> <4D77F149.8020906@redhat.com> <20110309223651.GC1762@pcnci.linuxbox.cz> In-Reply-To: <20110309223651.GC1762@pcnci.linuxbox.cz> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 25 Mar 2011 08:20:49 +0000 (UTC) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 58f517b..42618fb 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2127,8 +2127,10 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) if (check_tsc_unstable()) { kvm_x86_ops->adjust_tsc_offset(vcpu, -tsc_delta); vcpu->arch.tsc_catchup = 1; + kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); } - kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); + if (vcpu->cpu == -1) + kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); if (vcpu->cpu != cpu) kvm_migrate_timers(vcpu); vcpu->cpu = cpu; @@ -3534,6 +3536,8 @@ long kvm_arch_vm_ioctl(struct file *filp, struct kvm_clock_data user_ns; u64 now_ns; s64 delta; + struct kvm_vcpu *vcpu; + int i; r = -EFAULT; if (copy_from_user(&user_ns, argp, sizeof(user_ns))) @@ -3549,6 +3553,8 @@ long kvm_arch_vm_ioctl(struct file *filp, delta = user_ns.clock - now_ns; local_irq_enable(); kvm->arch.kvmclock_offset = delta; + kvm_for_each_vcpu(i, vcpu, kvm) + kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); break; } case KVM_GET_CLOCK: {