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=-14.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,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 F3D94C4320E for ; Mon, 26 Jul 2021 05:31:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D6DA06023F for ; Mon, 26 Jul 2021 05:31:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231627AbhGZEu7 (ORCPT ); Mon, 26 Jul 2021 00:50:59 -0400 Received: from mga04.intel.com ([192.55.52.120]:64123 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbhGZEu5 (ORCPT ); Mon, 26 Jul 2021 00:50:57 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10056"; a="210272248" X-IronPort-AV: E=Sophos;i="5.84,270,1620716400"; d="scan'208";a="210272248" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2021 22:31:27 -0700 X-IronPort-AV: E=Sophos;i="5.84,270,1620716400"; d="scan'208";a="504644556" Received: from xiaoyaol-mobl.ccr.corp.intel.com (HELO [10.249.175.15]) ([10.249.175.15]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2021 22:31:23 -0700 Subject: Re: [RFC PATCH v2 65/69] KVM: X86: Introduce initial_tsc_khz in struct kvm_arch To: Sean Christopherson , Paolo Bonzini Cc: "Yamahata, Isaku" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , "erdemaktas@google.com" , Connor Kuehl , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "isaku.yamahata@gmail.com" References: <5f87f0b888555b52041a0fe32280adee0d563e63.1625186503.git.isaku.yamahata@intel.com> <792040b0-4463-d805-d14e-ba264a3f8bbf@redhat.com> From: Xiaoyao Li Message-ID: <2705e8a4-6783-cfb7-e24d-0ffcffbefd6a@intel.com> Date: Mon, 26 Jul 2021 13:31:21 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/14/2021 2:14 AM, Sean Christopherson wrote: > On Tue, Jul 06, 2021, Paolo Bonzini wrote: >> On 03/07/21 00:05, isaku.yamahata@intel.com wrote: >>> From: Xiaoyao Li >>> >>> Introduce a per-vm variable initial_tsc_khz to hold the default tsc_khz >>> for kvm_arch_vcpu_create(). >>> >>> This field is going to be used by TDX since TSC frequency for TD guest >>> is configured at TD VM initialization phase. >>> >>> Signed-off-by: Xiaoyao Li >>> Signed-off-by: Isaku Yamahata >>> --- >>> arch/x86/include/asm/kvm_host.h | 1 + >>> arch/x86/kvm/x86.c | 3 ++- >>> 2 files changed, 3 insertions(+), 1 deletion(-) >> >> So this means disabling TSC frequency scaling on TDX. No. It still supports TSC frequency scaling on TDX. Only that we need to configure TSC frequency for TD guest at VM level, not vcpu level. >> Would it make sense >> to delay VM creation to a separate ioctl, similar to KVM_ARM_VCPU_FINALIZE >> (KVM_VM_FINALIZE)? > > There's an equivalent of that in the next mega-patch, the KVM_TDX_INIT_VM sub-ioctl > of KVM_MEMORY_ENCRYPT_OP. The TSC frequency for the guest gets provided at that > time. >