From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759685AbbIVTw4 (ORCPT ); Tue, 22 Sep 2015 15:52:56 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:34610 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758716AbbIVTwy (ORCPT ); Tue, 22 Sep 2015 15:52:54 -0400 Subject: Re: [PATCH 2/2] Revert "KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system MSR" To: Marcelo Tosatti , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= References: <1442591670-5216-1-git-send-email-rkrcmar@redhat.com> <1442591670-5216-3-git-send-email-rkrcmar@redhat.com> <20150922190133.GB23748@amt.cnet> Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Luiz Capitulino From: Paolo Bonzini Message-ID: <5601B191.4040809@redhat.com> Date: Tue, 22 Sep 2015 21:52:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150922190133.GB23748@amt.cnet> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/09/2015 21:01, Marcelo Tosatti wrote: > On Fri, Sep 18, 2015 at 05:54:30PM +0200, Radim Krčmář wrote: >> Shifting pvclock_vcpu_time_info.system_time on write to KVM system time >> MSR is a change of ABI. Probably only 2.6.16 based SLES 10 breaks due >> to its custom enhancements to kvmclock, but KVM never declared the MSR >> only for one-shot initialization. (Doc says that only one write is >> needed.) >> >> This reverts commit b7e60c5aedd2b63f16ef06fde4f81ca032211bc5. >> And adds a note to the definition of PVCLOCK_COUNTS_FROM_ZERO. >> >> Signed-off-by: Radim Krčmář >> --- >> arch/x86/include/asm/pvclock-abi.h | 1 + >> arch/x86/kvm/x86.c | 4 ---- >> 2 files changed, 1 insertion(+), 4 deletions(-) >> >> diff --git a/arch/x86/include/asm/pvclock-abi.h b/arch/x86/include/asm/pvclock-abi.h >> index 655e07a48f6c..67f08230103a 100644 >> --- a/arch/x86/include/asm/pvclock-abi.h >> +++ b/arch/x86/include/asm/pvclock-abi.h >> @@ -41,6 +41,7 @@ struct pvclock_wall_clock { >> >> #define PVCLOCK_TSC_STABLE_BIT (1 << 0) >> #define PVCLOCK_GUEST_STOPPED (1 << 1) >> +/* PVCLOCK_COUNTS_FROM_ZERO broke ABI and can't be used anymore. */ >> #define PVCLOCK_COUNTS_FROM_ZERO (1 << 2) >> #endif /* __ASSEMBLY__ */ >> #endif /* _ASM_X86_PVCLOCK_ABI_H */ >> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c >> index 18d59b584dee..34d33f4757d2 100644 >> --- a/arch/x86/kvm/x86.c >> +++ b/arch/x86/kvm/x86.c >> @@ -1707,8 +1707,6 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) >> vcpu->pvclock_set_guest_stopped_request = false; >> } >> >> - pvclock_flags |= PVCLOCK_COUNTS_FROM_ZERO; >> - >> /* If the host uses TSC clocksource, then it is stable */ >> if (use_master_clock) >> pvclock_flags |= PVCLOCK_TSC_STABLE_BIT; >> @@ -2006,8 +2004,6 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) >> &vcpu->requests); >> >> ka->boot_vcpu_runs_old_kvmclock = tmp; >> - >> - ka->kvmclock_offset = -get_kernel_ns(); >> } >> >> vcpu->arch.time = data; >> -- >> 2.5.2 > > ACK So I suppose you changed your mind :) but can you explain the reasoning? Paolo