Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1230813 > unrolled thread
| Started by | Marcelo Tosatti <mtosatti@redhat.com> |
|---|---|
| First post | 2015-09-22 21:10 +0200 |
| Last post | 2015-09-24 02:10 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 2/2] Revert "KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system MSR" Marcelo Tosatti <mtosatti@redhat.com> - 2015-09-22 21:10 +0200
Re: [PATCH 2/2] Revert "KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system MSR" Paolo Bonzini <pbonzini@redhat.com> - 2015-09-22 22:00 +0200
Re: [PATCH 2/2] Revert "KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system MSR" Marcelo Tosatti <mtosatti@redhat.com> - 2015-09-24 02:10 +0200
| From | Marcelo Tosatti <mtosatti@redhat.com> |
|---|---|
| Date | 2015-09-22 21:10 +0200 |
| Subject | Re: [PATCH 2/2] Revert "KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system MSR" |
| Message-ID | <qbB6X-5Uu-59@gated-at.bofh.it> |
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Paolo Bonzini <pbonzini@redhat.com> |
|---|---|
| Date | 2015-09-22 22:00 +0200 |
| Message-ID | <qbBTk-6Qf-19@gated-at.bofh.it> |
| In reply to | #1230813 |
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Marcelo Tosatti <mtosatti@redhat.com> |
|---|---|
| Date | 2015-09-24 02:10 +0200 |
| Message-ID | <qc2gO-3eb-1@gated-at.bofh.it> |
| In reply to | #1230896 |
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web