From: Marcelo Tosatti <mtosatti@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
"Luiz Capitulino" <lcapitulino@redhat.com>
Subject: Re: [PATCH 2/2] Revert "KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system MSR"
Date: Tue, 22 Sep 2015 17:23:47 -0300 [thread overview]
Message-ID: <20150922202345.GA29417@amt.cnet> (raw)
In-Reply-To: <5601B191.4040809@redhat.com>
On Tue, Sep 22, 2015 at 09:52:49PM +0200, Paolo Bonzini wrote:
>
>
> 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ář <rkrcmar@redhat.com>
> >> ---
> >> 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
The patch is correct. Overflow (issue raised) is only an issue
without PVCLOCK_TSC_STABLE_BIT.
next prev parent reply other threads:[~2015-09-24 0:01 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-18 15:54 [RFC PATCH 0/2] kvmclock: fix ABI breakage from PVCLOCK_COUNTS_FROM_ZERO Radim Krčmář
2015-09-18 15:54 ` [PATCH 1/2] x86: kvmclock: abolish PVCLOCK_COUNTS_FROM_ZERO Radim Krčmář
2015-09-22 19:01 ` Marcelo Tosatti
2015-09-28 14:10 ` Paolo Bonzini
2015-09-18 15:54 ` [PATCH 2/2] Revert "KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system MSR" Radim Krčmář
2015-09-22 19:01 ` Marcelo Tosatti
2015-09-22 19:52 ` Paolo Bonzini
2015-09-22 20:23 ` Marcelo Tosatti [this message]
2015-09-20 22:57 ` [RFC PATCH 0/2] kvmclock: fix ABI breakage from PVCLOCK_COUNTS_FROM_ZERO Marcelo Tosatti
2015-09-21 15:12 ` Radim Krčmář
2015-09-21 15:43 ` Radim Krčmář
2015-09-21 15:52 ` Marcelo Tosatti
2015-09-21 20:00 ` Radim Krčmář
2015-09-21 20:53 ` Marcelo Tosatti
2015-09-21 22:00 ` Radim Krčmář
2015-09-21 22:37 ` Marcelo Tosatti
2015-09-22 0:40 ` Marcelo Tosatti
2015-09-22 14:33 ` Radim Krčmář
2015-09-22 14:46 ` Radim Krčmář
2015-09-28 11:05 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150922202345.GA29417@amt.cnet \
--to=mtosatti@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lcapitulino@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).