kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm: x86: some tsc debug cleanup
@ 2019-07-05 17:10 Yi Wang
  2019-07-15  4:50 ` Yi Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Yi Wang @ 2019-07-05 17:10 UTC (permalink / raw)
  To: pbonzini
  Cc: rkrcmar, tglx, mingo, bp, hpa, x86, kvm, linux-kernel,
	xue.zhihong, wang.yi59, up2wing, wang.liang82

There are some pr_debug in TSC code, which may have
been no use, so remove them as Paolo suggested.

Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
 arch/x86/kvm/x86.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index fafd81d..86f9861 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1518,9 +1518,6 @@ static void kvm_get_time_scale(uint64_t scaled_hz, uint64_t base_hz,
 
 	*pshift = shift;
 	*pmultiplier = div_frac(scaled64, tps32);
-
-	pr_debug("%s: base_hz %llu => %llu, shift %d, mul %u\n",
-		 __func__, base_hz, scaled_hz, shift, *pmultiplier);
 }
 
 #ifdef CONFIG_X86_64
@@ -1763,12 +1760,10 @@ void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr)
 	    vcpu->arch.virtual_tsc_khz == kvm->arch.last_tsc_khz) {
 		if (!kvm_check_tsc_unstable()) {
 			offset = kvm->arch.cur_tsc_offset;
-			pr_debug("kvm: matched tsc offset for %llu\n", data);
 		} else {
 			u64 delta = nsec_to_cycles(vcpu, elapsed);
 			data += delta;
 			offset = kvm_compute_tsc_offset(vcpu, data);
-			pr_debug("kvm: adjusted tsc offset by %llu\n", delta);
 		}
 		matched = true;
 		already_matched = (vcpu->arch.this_tsc_generation == kvm->arch.cur_tsc_generation);
@@ -1787,8 +1782,6 @@ void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr)
 		kvm->arch.cur_tsc_write = data;
 		kvm->arch.cur_tsc_offset = offset;
 		matched = false;
-		pr_debug("kvm: new tsc generation %llu, clock %llu\n",
-			 kvm->arch.cur_tsc_generation, data);
 	}
 
 	/*
@@ -6857,7 +6850,6 @@ static void kvm_timer_init(void)
 		cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block,
 					  CPUFREQ_TRANSITION_NOTIFIER);
 	}
-	pr_debug("kvm: max_tsc_khz = %ld\n", max_tsc_khz);
 
 	cpuhp_setup_state(CPUHP_AP_X86_KVM_CLK_ONLINE, "x86/kvm/clk:online",
 			  kvmclock_cpu_online, kvmclock_cpu_down_prep);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kvm: x86: some tsc debug cleanup
  2019-07-05 17:10 [PATCH] kvm: x86: some tsc debug cleanup Yi Wang
@ 2019-07-15  4:50 ` Yi Wang
  2019-07-15 11:56   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Yi Wang @ 2019-07-15  4:50 UTC (permalink / raw)
  To: Yi Wang, Paolo Bonzini
  Cc: pbonzini, rkrcmar, tglx, mingo, bp, hpa, x86, kvm, linux-kernel,
	xue.zhihong, wang.liang82

Hi Paolo,
Would you help to review this patch, plz?
Many thanks.

---
Best wishes
Yi Wang

> 在 2019年7月6日,01:10,Yi Wang <wang.yi59@zte.com.cn> 写道:
> 
> There are some pr_debug in TSC code, which may have
> been no use, so remove them as Paolo suggested.
> 
> Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
> ---
> arch/x86/kvm/x86.c | 8 --------
> 1 file changed, 8 deletions(-)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index fafd81d..86f9861 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -1518,9 +1518,6 @@ static void kvm_get_time_scale(uint64_t scaled_hz, uint64_t base_hz,
> 
>    *pshift = shift;
>    *pmultiplier = div_frac(scaled64, tps32);
> -
> -    pr_debug("%s: base_hz %llu => %llu, shift %d, mul %u\n",
> -         __func__, base_hz, scaled_hz, shift, *pmultiplier);
> }
> 
> #ifdef CONFIG_X86_64
> @@ -1763,12 +1760,10 @@ void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr)
>        vcpu->arch.virtual_tsc_khz == kvm->arch.last_tsc_khz) {
>        if (!kvm_check_tsc_unstable()) {
>            offset = kvm->arch.cur_tsc_offset;
> -            pr_debug("kvm: matched tsc offset for %llu\n", data);
>        } else {
>            u64 delta = nsec_to_cycles(vcpu, elapsed);
>            data += delta;
>            offset = kvm_compute_tsc_offset(vcpu, data);
> -            pr_debug("kvm: adjusted tsc offset by %llu\n", delta);
>        }
>        matched = true;
>        already_matched = (vcpu->arch.this_tsc_generation == kvm->arch.cur_tsc_generation);
> @@ -1787,8 +1782,6 @@ void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr)
>        kvm->arch.cur_tsc_write = data;
>        kvm->arch.cur_tsc_offset = offset;
>        matched = false;
> -        pr_debug("kvm: new tsc generation %llu, clock %llu\n",
> -             kvm->arch.cur_tsc_generation, data);
>    }
> 
>    /*
> @@ -6857,7 +6850,6 @@ static void kvm_timer_init(void)
>        cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block,
>                      CPUFREQ_TRANSITION_NOTIFIER);
>    }
> -    pr_debug("kvm: max_tsc_khz = %ld\n", max_tsc_khz);
> 
>    cpuhp_setup_state(CPUHP_AP_X86_KVM_CLK_ONLINE, "x86/kvm/clk:online",
>              kvmclock_cpu_online, kvmclock_cpu_down_prep);
> -- 
> 1.8.3.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kvm: x86: some tsc debug cleanup
  2019-07-15  4:50 ` Yi Wang
@ 2019-07-15 11:56   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2019-07-15 11:56 UTC (permalink / raw)
  To: Yi Wang, Yi Wang
  Cc: rkrcmar, tglx, mingo, bp, hpa, x86, kvm, linux-kernel,
	xue.zhihong, wang.liang82

On 15/07/19 06:50, Yi Wang wrote:
> Hi Paolo,
> Would you help to review this patch, plz?
> Many thanks.

I have queued it now.

Paolo

> ---
> Best wishes
> Yi Wang
> 
>> 在 2019年7月6日,01:10,Yi Wang <wang.yi59@zte.com.cn> 写道:
>>
>> There are some pr_debug in TSC code, which may have
>> been no use, so remove them as Paolo suggested.
>>
>> Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
>> ---
>> arch/x86/kvm/x86.c | 8 --------
>> 1 file changed, 8 deletions(-)
>>
>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>> index fafd81d..86f9861 100644
>> --- a/arch/x86/kvm/x86.c
>> +++ b/arch/x86/kvm/x86.c
>> @@ -1518,9 +1518,6 @@ static void kvm_get_time_scale(uint64_t scaled_hz, uint64_t base_hz,
>>
>>    *pshift = shift;
>>    *pmultiplier = div_frac(scaled64, tps32);
>> -
>> -    pr_debug("%s: base_hz %llu => %llu, shift %d, mul %u\n",
>> -         __func__, base_hz, scaled_hz, shift, *pmultiplier);
>> }
>>
>> #ifdef CONFIG_X86_64
>> @@ -1763,12 +1760,10 @@ void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr)
>>        vcpu->arch.virtual_tsc_khz == kvm->arch.last_tsc_khz) {
>>        if (!kvm_check_tsc_unstable()) {
>>            offset = kvm->arch.cur_tsc_offset;
>> -            pr_debug("kvm: matched tsc offset for %llu\n", data);
>>        } else {
>>            u64 delta = nsec_to_cycles(vcpu, elapsed);
>>            data += delta;
>>            offset = kvm_compute_tsc_offset(vcpu, data);
>> -            pr_debug("kvm: adjusted tsc offset by %llu\n", delta);
>>        }
>>        matched = true;
>>        already_matched = (vcpu->arch.this_tsc_generation == kvm->arch.cur_tsc_generation);
>> @@ -1787,8 +1782,6 @@ void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr)
>>        kvm->arch.cur_tsc_write = data;
>>        kvm->arch.cur_tsc_offset = offset;
>>        matched = false;
>> -        pr_debug("kvm: new tsc generation %llu, clock %llu\n",
>> -             kvm->arch.cur_tsc_generation, data);
>>    }
>>
>>    /*
>> @@ -6857,7 +6850,6 @@ static void kvm_timer_init(void)
>>        cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block,
>>                      CPUFREQ_TRANSITION_NOTIFIER);
>>    }
>> -    pr_debug("kvm: max_tsc_khz = %ld\n", max_tsc_khz);
>>
>>    cpuhp_setup_state(CPUHP_AP_X86_KVM_CLK_ONLINE, "x86/kvm/clk:online",
>>              kvmclock_cpu_online, kvmclock_cpu_down_prep);
>> -- 
>> 1.8.3.1
>>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-15 11:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-05 17:10 [PATCH] kvm: x86: some tsc debug cleanup Yi Wang
2019-07-15  4:50 ` Yi Wang
2019-07-15 11:56   ` Paolo Bonzini

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).