Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4754872iob; Mon, 9 May 2022 00:21:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqsQ+OmOaSs5uXWqVxb4Z4RmKs7TYSd6sjU0jSQ2yaQ8MknuFZ8T4D2tOizw14fhq1SIgh X-Received: by 2002:a17:902:d3c6:b0:15f:186a:69f0 with SMTP id w6-20020a170902d3c600b0015f186a69f0mr1837615plb.144.1652080894637; Mon, 09 May 2022 00:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652080894; cv=none; d=google.com; s=arc-20160816; b=pOeMJ1O767IjWJ1A+nenHFEqRATyyaYQxjj8OUerdzXYmX0wZnD/kv5DwA4YrvnUeS hps446tllyW6nqbv7gyG2ae2rgrGxZDM1NRb9xBsYDHDaol438Xr3tuzB/V5x/dxcUZ9 hsztMupr5secCCPpGA0ZM/fuhixtKaSAdo6XDV5zwydhjn5NXv/rlKa6yssiWkabcdLh bwDUHoolVygyRTEAkAeJSb2y75Fsj7tjV2zsHdND3jI3ZU5hX+xy6GDUq593kfyEVnne cF5F7qMaaZ9mJpQ5k0U351lOTKgnz4StU5AvctVUs6R1j65vYKnvHv8+tgRm7nlhTxi2 gMYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=gnKMQ1lHSXM4Bg+Op2LEYaNn7P9RD6KgXzqRJeFyt30=; b=nwxH8wCdnfwKRwbbAPEZ+pMDqxshjMdXT9TMI+cbyuQ7Jh4HtnTZ1It4asev4OoGnJ 0+peB8V727/z4Ho7o4NTAVlAz3nfRDh9yqBaXqVpBS7seQyQYfvWLY+zxTt4F4xKk7kT Wlm+CI25ukOdmYnBbeS17wWxVAmXIQn0qmLvi7B3ZSz4zgxaSCP86D49Wco85Ls0foIl 5bFVeWV3PeK9Np/3W8BCyxyExinBg8S/jkGffeITX6EbwZnWJpj5I4wCjlaXLGM5aazJ PLURMcnpCMhJX4Ppayv5xf+5TFG5wzvVvndmgSC+RXkmi4yX8b55UOqUCG2gBcT7Odtb Vbpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NHkpr+PE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m7-20020a170902db0700b0015e8edcdee2si12141895plx.602.2022.05.09.00.21.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 00:21:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NHkpr+PE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 948A817335C; Mon, 9 May 2022 00:18:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389128AbiEFFbX (ORCPT + 99 others); Fri, 6 May 2022 01:31:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1389116AbiEFFbV (ORCPT ); Fri, 6 May 2022 01:31:21 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6282C91; Thu, 5 May 2022 22:27:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651814859; x=1683350859; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=jjJ7o6bLleTyPSL5b0r/x/WkMwEejBsryTcFEZh8gPU=; b=NHkpr+PE1Rb8RVvHCpakawJcvpL9zOrcoFMsayLXcdo/795v+pQ2CAMT hHy6jOqA+7sJ+pAIUEj9umkWCjRt3qAmZqbdOSwTtY0q7arkVgFNUGzKm Tsd9Rhtg+/n+G1ZBawkcB2m3f0XYWNQZkYl/fuOaRv4YL7ofvNJgibgIc 06uThUi7552dzJ7GIOBPJrN5VLtAxkTvTlzbVLfosyOpQLSwlagypxGIZ E7hrZG1gCvZlYs7luQQZti/0MFhnAPSo4ef28maJE7RxLKjaOJgrvawZr tEdA/j43g0UWJwJ+ufNecxdTMwq3poEor6RgrgHmz5MJgiPh+gxp6W1sc g==; X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="328901599" X-IronPort-AV: E=Sophos;i="5.91,203,1647327600"; d="scan'208";a="328901599" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 22:27:38 -0700 X-IronPort-AV: E=Sophos;i="5.91,203,1647327600"; d="scan'208";a="585780403" Received: from xiaoyaol-hp-g830.ccr.corp.intel.com (HELO [10.249.169.36]) ([10.249.169.36]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 22:27:35 -0700 Message-ID: <0233f2dc-31b9-ff30-67c9-2ad5871e7dda@intel.com> Date: Fri, 6 May 2022 13:27:33 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.8.1 Subject: Re: [RFC PATCH v6 025/104] KVM: TDX: initialize VM with TDX specific parameters Content-Language: en-US To: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar References: From: Xiaoyao Li In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, HK_RANDOM_FROM,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/6/2022 2:14 AM, isaku.yamahata@intel.com wrote: ... > + if (init_vm->tsc_khz) { > + guest_tsc_khz = init_vm->tsc_khz; > + kvm->arch.default_tsc_khz = guest_tsc_khz; > + } else > + guest_tsc_khz = kvm->arch.default_tsc_khz; > + td_params->tsc_frequency = TDX_TSC_KHZ_TO_25MHZ(guest_tsc_khz); Isaku, I think Paolo meant 1. user space calls VM-scope KVM_SET_TSC_KHZ and 2. td_params->tsc_frequency = TDX_TSC_KHZ_TO_25MHZ(kvm->arch.default_tsc_khz); in https://lore.kernel.org/all/e392b53a-fbaa-4724-07f4-171424144f70@redhat.com/ so we can drop @tsc_khz in struct kvm_tdx_init_vm.