Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2883114pxb; Mon, 4 Apr 2022 01:22:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyijjwWTGsazuSJiP/5hokQuB98y9owHFKs1BuhtK0fK0g8hLjp0yEw/rjx0+mDD0T4mHIR X-Received: by 2002:a17:907:97cf:b0:6df:846f:ad0a with SMTP id js15-20020a17090797cf00b006df846fad0amr9994791ejc.286.1649060574433; Mon, 04 Apr 2022 01:22:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649060574; cv=none; d=google.com; s=arc-20160816; b=lhCNORIsDIzwiUaTce/8WHuGA9xtX+nwE2fDkN2nxSconS5lG8iV8udTIoZA9R8/ua HO0vtcKWC2eCvgKA6IVnO8X4wQNaxnRh3VXw0653/BYJ8DgOaov2EMhAHApK6QwTqn4g BMbiz57S1CvcoSmF5ZxyloEi0CZECUZPhFlxsqGVl8Ocsg5nssEA8S7+GHoK3cCKZC+c P9Mc/k7xtwlsk3YQ7mx1P7tgKbxvWkkq4CrtlTAGGXjsOulN1bgsrWSjDa6rAdp0ljDV X+PeG9whw6jqKYCqRx61XmAPqnjvSlOAPj/KHjGx9NYkS2GXJ1ob9K6SDpsQs4OVFhyT nUGw== 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=dbnVPzWLY1eIgo63w9x2OPwiWhh6dMEKj7pYN/e2hho=; b=WGizQUCvrsqIW1WtbHiK1kIYGDZGTzdQwg4WRq+Un4gNfue/MX20nHYB0sjXnHsc4K gpX6BIogEuAQXt5qv2sxEDB50l42C/D1dJJDr5jSgVxwT3QdCWiL5at7hmHF8o9U/V0S S53m6lBMqSDqvj+wa8OpS7OfxKPYd8lQLvDCUq/fpEZKsf1IG21ZJ1kTKh1Ty6VdB8/x phjPuWVxLhADKrRKjENNEqioJDjpnG3fXRHVR1/HAaNlfzMps6mowxudMiKe3yQkhOWL ANIyWrAEmwZhczGbhoYu+EzSnIqveKJE3izR51TxcRSR/of++gpaBT60LwdnJKv3BZok PFqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Wm1ws09m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f6-20020a50e086000000b0041b60dcde7csi5788642edl.147.2022.04.04.01.22.29; Mon, 04 Apr 2022 01:22:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Wm1ws09m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237519AbiDBCma (ORCPT + 99 others); Fri, 1 Apr 2022 22:42:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbiDBCm2 (ORCPT ); Fri, 1 Apr 2022 22:42:28 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90BB81A1280; Fri, 1 Apr 2022 19:40: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=1648867238; x=1680403238; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=bj4rfjg830Wz124zyu46gMY5uDkjqoPuQpgNrHl2G3U=; b=Wm1ws09myZ6uHiGSS0vhUo6Exp0xBZMfG5s0eraGqXImVhmZNfDEqLxY fM5uPEmACgCbS8sF/yOgNZpGwoumM7wlRRwLhdtM7mguRY3wTK8S95i0z cOYG04KnIsmx0IA1Zq5X844LczdEgECNJQzFEbCpLwx3tUZvdhhFK3TeN OKu8KNfer921lnuWc+GMU7sUVkWg377cPzeFOl2BUnrS/i3/8cGwQZvKt 6YdI4nRHSA6y5UTHB90zz1ElNkmlZkk7C5JI0myp1WeFcIbeLdU7dsxFE 8tylG490Yl5Kp3Htq3jHx5SL61YFQs5fVS4NaAL88UWEwArfI93YMStIw A==; X-IronPort-AV: E=McAfee;i="6200,9189,10304"; a="257850134" X-IronPort-AV: E=Sophos;i="5.90,229,1643702400"; d="scan'208";a="257850134" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2022 19:40:38 -0700 X-IronPort-AV: E=Sophos;i="5.90,229,1643702400"; d="scan'208";a="548030893" Received: from xiaoyaol-hp-g830.ccr.corp.intel.com (HELO [10.255.31.112]) ([10.255.31.112]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2022 19:40:35 -0700 Message-ID: Date: Sat, 2 Apr 2022 10:40:32 +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.6.1 Subject: Re: [RFC PATCH v5 008/104] KVM: TDX: Add a function to initialize TDX module Content-Language: en-US To: Isaku Yamahata Cc: Kai Huang , isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Jim Mattson , erdemaktas@google.com, Connor Kuehl , Sean Christopherson References: <36aac3cb7c7447db6454ee396e25eea3bad378e6.camel@intel.com> <20220331194144.GA2084469@ls.amr.corp.intel.com> <20220401201806.GA2862421@ls.amr.corp.intel.com> From: Xiaoyao Li In-Reply-To: <20220401201806.GA2862421@ls.amr.corp.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 4/2/2022 4:18 AM, Isaku Yamahata wrote: > On Fri, Apr 01, 2022 at 02:56:40PM +0800, > Xiaoyao Li wrote: > >> On 4/1/2022 3:41 AM, Isaku Yamahata wrote: >>> On Thu, Mar 31, 2022 at 04:31:10PM +1300, >>> Kai Huang wrote: >>> >>>> On Fri, 2022-03-04 at 11:48 -0800, isaku.yamahata@intel.com wrote: >>>>> From: Isaku Yamahata >>> >>>>> Add a wrapper function to initialize the TDX module and get system-wide >>>>> parameters via those APIs. Because TDX requires VMX enabled, It will be >>>>> called on-demand when the first guest TD is created via x86 KVM init_vm >>>>> callback. >>>> >>>> Why not just merge this patch with the change where you implement the init_vm >>>> callback? Then you can just declare this patch as "detect and initialize TDX >>>> module when first VM is created", or something like that.. >>> >>> Ok. Anyway in the next respoin, tdx module initialization will be done when >>> loading kvm_intel.ko. So the whole part will be changed and will be a part >>> of module loading. >> >> Will we change the GET_TDX_CAPABILITIES ioctl back to KVM scope? > > No because it system scoped KVM_TDX_CAPABILITIES requires one more callback for > it. We can reduce the change. > > Or do you have any use case for system scoped KVM_TDX_CAPABILITIES? No. Just to confirm. on the other hand, vm-scope IOCTL seems more flexible if different capabilities are reported per VM in the future.