From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B4D2C4707F for ; Thu, 27 May 2021 13:08:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03CF26128B for ; Thu, 27 May 2021 13:08:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236368AbhE0NJz (ORCPT ); Thu, 27 May 2021 09:09:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56516 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236099AbhE0NJy (ORCPT ); Thu, 27 May 2021 09:09:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622120901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4/m/R0Y4SSIGq3cr+IGc7ZzV74IkxCMTJe5tIS2RfzU=; b=XXUmJg3jLndO20IXS1mRnVgF6AYkONe8yQVabD+tZG33FRwJdZor/jjDthuAjWhfHKaUrT 0U19SwbvmrwO3QsjD66C/yUGt4VLWOTR3ha81r74jED4GMbxf70lvOrv5xzJVbDk+UMqOt h+J1D+TIhoE1TKTH7Lok9KlWvuKhca8= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-7-IcwN-RyKO06MSQWTq_u6OQ-1; Thu, 27 May 2021 09:08:17 -0400 X-MC-Unique: IcwN-RyKO06MSQWTq_u6OQ-1 Received: by mail-ed1-f71.google.com with SMTP id v18-20020a0564023492b029038d5ad7c8a8so282753edc.11 for ; Thu, 27 May 2021 06:08:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4/m/R0Y4SSIGq3cr+IGc7ZzV74IkxCMTJe5tIS2RfzU=; b=iCylU604sXlpoVyzlQL2hpwJeQ4RDC+J1/iy7mxg5JFTKu6W8qY2y1wDcBv/mJ1FFA wtqgqctpOxjz7Z1IutzDOf9sxaYAQYyVb6FJXsrLfsaysZknosvZBDJhWxDViG/PNoQa ZlVglJes6R2D/kPwO5H7yxDGPRqoQzFpWXlfRfgBoK1J7kCT4GNP5HMjDRCVgiSpsLl7 4+KH4GDeXLaNYiRU4WjgaiSljvZl5fmT+62ykx4a3IyflEhpYFgr+JQkNbo+Bs+MOLND rH3KnQ7ZBlHy6EpruOn3fxU/WuMEh6rKmGMgxIS9GVdIY1tRlCoSYdBE5FFgo6zYCXXK /m0Q== X-Gm-Message-State: AOAM532iAhfBC3+tXfbzUJKSKv2McXmwNHma6ITLgQhNWfa6VTUl2/+x O6JOrWrD0wWuMrehw9vdO7FnJspNnAqadeBuDN7Z7H7t24imb26pO9dT44nMAS6saXWsp/92yGQ qSb8LVeXRDJLcRgGVdbX3iZdN X-Received: by 2002:a05:6402:268f:: with SMTP id w15mr3915294edd.321.1622120896106; Thu, 27 May 2021 06:08:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbFOvAXWs89cDDtIzzw6gRGYvp7A0dnMp3IKHJUpfq+3OyEwsfxK65t5dXbkPwYYGx4PKWQg== X-Received: by 2002:a05:6402:268f:: with SMTP id w15mr3915270edd.321.1622120895958; Thu, 27 May 2021 06:08:15 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id y23sm1063513eds.60.2021.05.27.06.08.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 May 2021 06:08:15 -0700 (PDT) To: "Stamatis, Ilias" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" Cc: "jmattson@google.com" , "Woodhouse, David" , "vkuznets@redhat.com" , "joro@8bytes.org" , "mtosatti@redhat.com" , "zamsden@gmail.com" , "seanjc@google.com" , "mlevitsk@redhat.com" , "wanpengli@tencent.com" References: <20210526184418.28881-1-ilstam@amazon.com> <20210526184418.28881-10-ilstam@amazon.com> From: Paolo Bonzini Subject: Re: [PATCH v4 09/11] KVM: X86: Add vendor callbacks for writing the TSC multiplier Message-ID: <9e971115-5634-e64e-72b6-5e41c024c796@redhat.com> Date: Thu, 27 May 2021 15:08:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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