All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Stamatis, Ilias" <ilstam@amazon.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Cc: "jmattson@google.com" <jmattson@google.com>,
	"Woodhouse, David" <dwmw@amazon.co.uk>,
	"vkuznets@redhat.com" <vkuznets@redhat.com>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"mtosatti@redhat.com" <mtosatti@redhat.com>,
	"zamsden@gmail.com" <zamsden@gmail.com>,
	"seanjc@google.com" <seanjc@google.com>,
	"mlevitsk@redhat.com" <mlevitsk@redhat.com>,
	"wanpengli@tencent.com" <wanpengli@tencent.com>
Subject: Re: [PATCH v4 09/11] KVM: X86: Add vendor callbacks for writing the TSC multiplier
Date: Thu, 27 May 2021 15:08:13 +0200	[thread overview]
Message-ID: <9e971115-5634-e64e-72b6-5e41c024c796@redhat.com> (raw)
In-Reply-To: <faa225b3b7518feea7df0ee69d6bf386a04824dc.camel@amazon.com>

On 27/05/21 10:33, Stamatis, Ilias wrote:
>>   #ifdef CONFIG_X86_64
>> @@ -10444,6 +10461,7 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
>>   		return;
>>   	vcpu_load(vcpu);
>>   	kvm_synchronize_tsc(vcpu, 0);
>> +	kvm_vcpu_write_tsc_multiplier(vcpu, kvm_default_tsc_scaling_ratio);
> Hmm, I'm actually thinking now that this might not be correct. For example in
> case we hotplug a new vCPU but the other vCPUs don't use the default ratio.

It is correct, the TSC frequency can be set per CPU (which is useless 
except possibly for debugging OS timekeeping, but still).  So, the 
default kHz after hotplug is the host frequency.

It doesn't really matter because it only affects the fixed delta between 
the hotplugged CPU and the others as soon as userspace sets the 
frequency to the correct value.

Paolo


  reply	other threads:[~2021-05-27 13:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 18:44 [PATCH v4 00/11] KVM: Implement nested TSC scaling Ilias Stamatis
2021-05-26 18:44 ` [PATCH v4 01/11] math64.h: Add mul_s64_u64_shr() Ilias Stamatis
2021-05-26 18:44 ` [PATCH v4 02/11] KVM: X86: Store L1's TSC scaling ratio in 'struct kvm_vcpu_arch' Ilias Stamatis
2021-05-26 18:44 ` [PATCH v4 03/11] KVM: X86: Rename kvm_compute_tsc_offset() to kvm_compute_l1_tsc_offset() Ilias Stamatis
2021-05-26 18:44 ` [PATCH v4 04/11] KVM: X86: Add a ratio parameter to kvm_scale_tsc() Ilias Stamatis
2021-05-26 18:44 ` [PATCH v4 05/11] KVM: nVMX: Add a TSC multiplier field in VMCS12 Ilias Stamatis
2021-05-26 18:44 ` [PATCH v4 06/11] KVM: X86: Add functions for retrieving L2 TSC fields from common code Ilias Stamatis
2021-05-26 18:44 ` [PATCH v4 07/11] KVM: X86: Add functions that calculate the nested TSC fields Ilias Stamatis
2021-05-26 18:44 ` [PATCH v4 08/11] KVM: X86: Move write_l1_tsc_offset() logic to common code and rename it Ilias Stamatis
2021-05-26 18:44 ` [PATCH v4 09/11] KVM: X86: Add vendor callbacks for writing the TSC multiplier Ilias Stamatis
2021-05-27  8:33   ` Stamatis, Ilias
2021-05-27 13:08     ` Paolo Bonzini [this message]
2021-05-28 10:44       ` Stamatis, Ilias
2021-05-26 18:44 ` [PATCH v4 10/11] KVM: nVMX: Enable nested TSC scaling Ilias Stamatis
2021-05-26 18:44 ` [PATCH v4 11/11] KVM: selftests: x86: Add vmx_nested_tsc_scaling_test Ilias Stamatis
2021-06-15  8:44 ` [PATCH v4 00/11] KVM: Implement nested TSC scaling Stamatis, Ilias
2021-06-15  9:33   ` Stamatis, Ilias

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=9e971115-5634-e64e-72b6-5e41c024c796@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dwmw@amazon.co.uk \
    --cc=ilstam@amazon.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlevitsk@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=zamsden@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.