Received: by 2002:a9a:4c47:0:b029:116:c383:538 with SMTP id u7csp841610lko; Tue, 13 Jul 2021 11:15:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfutyUMo8DM47hWxSfyj9V+Es7oPSDJKVLMVa5WhuhOuF/Xdb0o+FRI32LR3yI+2A/pQAK X-Received: by 2002:a92:dcc2:: with SMTP id b2mr3875466ilr.84.1626200136866; Tue, 13 Jul 2021 11:15:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626200136; cv=none; d=google.com; s=arc-20160816; b=WImaQRs65qotheTT59HF1I2uCL7ejwwbJTQaW4nhCVWru2kfjyo0h2Hvn5zoRewVZ7 sJhSbv8GCJXS1gLKSDbi2w2NCE1a9eBqm0nBI9K8m6ncG9dyCeOceQcxfn0PbxmEnGS+ AkfaY4al117CTuOQm5NP7JzTygk9BClovyokAV3Y6UAB7WhjXaLA9H5BGERsVRCAPLw1 ZOVq8Uol11cq1uwL5pXOgnq3pSRtNTga4EYX9Qiwi0y/NQlue9nNQ7QC4zNdgq/BcKnq qlq06kq+YYbsrIPvknaePeOfm64Omdn3/iY4i3n7y7iePfchPDNnmH6eVplGRbI5vZkC OgNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qYLRuC1J401GJNPoirPCf0sUsfjE1s5mBPfucqVBo/o=; b=T0sI2d2i6SMX7YVx35nDam+CJwdRmn7iH65Zf6bBhtnQepjKQrQ6w1hcJOsNI7ohcf pAQvjl3q1CBIgv09s0jcoOifxfIwgSVOVoyLP/ypbTkF6rtY60/jz3zbWu7O7Xnh8D4p khBWAxW+PyQCXtV0GsoD5gHw8v4FbS2cMz5i0ILJfc/LQFzk4jbMnRz8kbq1gy+HwbPj jhamN69KvOXW+4RKPosk3JE1XYD/GdsOCPabIwRMZg10RRyGXPfKJ7B0wCZaJm+1APv2 ZMtGyvkP3BtuclSy2YTyCe10p3Wtku1kM7Ifri6pIXM4EpYcKeQGg2cznPiq/6LimIRL hU0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=TemUpZC6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q7si9001501ioi.41.2021.07.13.11.15.23; Tue, 13 Jul 2021 11:15:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=TemUpZC6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230376AbhGMSRc (ORCPT + 99 others); Tue, 13 Jul 2021 14:17:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbhGMSRb (ORCPT ); Tue, 13 Jul 2021 14:17:31 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D628C0613E9 for ; Tue, 13 Jul 2021 11:14:41 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id h4so22306684pgp.5 for ; Tue, 13 Jul 2021 11:14:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qYLRuC1J401GJNPoirPCf0sUsfjE1s5mBPfucqVBo/o=; b=TemUpZC6DppCYmoiy4LOJWEQeqEKh09xAT6P4VzLXIMbauvxoS4EP330OrBhT+KMD8 cR2UVyVjCHceV7KPG7a9NZZmYbyYSNNWo475SwL++N6I4zXO9yWb6VASQns9WnzfMOFh bHOmRt1m1x3AWl7z7ZKkjnUYvtZBijxS76sM/rse9ZmiC4tDHj3JBMAKP7TwgtjAxjVn Xf7JqdMkTGH04bfp2wk+pGQ3QGL2Tjh7KcfaEciMt87JIcLooAuNboN9SqoujtPQpTeI OX+q/7+1EwbpEtAufvbfEpN5lwH2yQY3OLYOTHt6yHv4KeueUCfkzIhTGMNnAtOJtiw6 ZiUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qYLRuC1J401GJNPoirPCf0sUsfjE1s5mBPfucqVBo/o=; b=S6YovX/ykLaRa+7hi7onHQ8TFUZwsfN0MSTTaCe1nMnlKgI1eVrFmwUwvVC9S4sXbt d2zdfFEm2ZtQ42IeBJMSXihlqgFXhy8/SUxnXutCUO/NE+f2PwXqFJrTFgvqcKRQehW2 CufuPGuc95BUx1w7anv/EMVJ06ZkQjgANA7RaeA4EnrlCda8GRVphfBNNNqT+A4RubPU nYEn9AicCAyOKyA011xdC7t9CVeNzdvPSH2XZ32g662YaIBJPgG5ObMPGNcgvpzIq/l9 BnoRoGOZPCltphSu8IwZewTxAbxDqNEv1PJLUf2MCOl55XJQsW8oR/PP4E+miJGSndSq iw8g== X-Gm-Message-State: AOAM531GeZMnQUnKfp2QTYkMnRJRMAfJnII9rljbVK9k4gRRsw6sxTVD cgdZ3K09izdhqbZa29NcTiofgg== X-Received: by 2002:a63:5c1b:: with SMTP id q27mr5441771pgb.284.1626200081027; Tue, 13 Jul 2021 11:14:41 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id x9sm109548pfd.100.2021.07.13.11.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 11:14:40 -0700 (PDT) Date: Tue, 13 Jul 2021 18:14:37 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: isaku.yamahata@intel.com, 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, Xiaoyao Li Subject: Re: [RFC PATCH v2 65/69] KVM: X86: Introduce initial_tsc_khz in struct kvm_arch Message-ID: References: <5f87f0b888555b52041a0fe32280adee0d563e63.1625186503.git.isaku.yamahata@intel.com> <792040b0-4463-d805-d14e-ba264a3f8bbf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <792040b0-4463-d805-d14e-ba264a3f8bbf@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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.