Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1217643pxb; Fri, 1 Apr 2022 07:39:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw24psI7piuj8Bq3QlRkYn+Ic92pyTBVvzbSg7CuXnfR0lwXCzsUFVnMuQWyBKakH1nAQPJ X-Received: by 2002:a17:906:a4b:b0:6d0:fbdd:7cb5 with SMTP id x11-20020a1709060a4b00b006d0fbdd7cb5mr150713ejf.152.1648823972057; Fri, 01 Apr 2022 07:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648823972; cv=none; d=google.com; s=arc-20160816; b=LW1pCGMjbm8Z6YXA2lSEsPaj/uA62TjH8oOX3lmF0ZcSmAfrJSHV5syRLfnspHpfV8 sl1dM9Jp0Kz8jBCzAL/bsiQpN9QBHMzVyf6E7sOcwmnjWmFNJkXuGKSHXWXjC9mke3ct Bd5Y1ICsNqZXmjEgtGxSE6OAy6yXZH1eXOeOcAAVo+5doXbYJe+Ff54/WS+3xr1hqNau zgkwhrOq3PJndAXr1wYXm/QR/x22kLCw534nV+5J8Iz5XPR3UaZL2vh3npBO9Q6X3Oev InuZncM5wzeDB5IbAP2gJq8hpaSzWa02VCv85e+xhzYR2FcjjbiMUjV07bmmf6EvVZgG zivg== 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=u4XgJ1gCX6aNxxvX8jaXKPM/y83C6S8GovuZD9chj6o=; b=RV1DaWIsZ5B6AlO84a1uryMD+IhwRmlN8PImVuu1XvLzrOLbgSBD/AlSskrvhTFMsW Wp+qJVMlwX+sOsErU0C1pC6jlmJ1voy9dz+NMZvy9xKlcNBvNdz/rX3GKHFP1VSEGF9T mordI/6pEdNLe7nD9R2mMcOYG9qH9M60wbx53vRI+Anow2G9rFNs7Vfi62JXqid31Tvz ubF+TXc7VTXbigMh2Xf2EMVuE4+zZ6aMMWFryMKp9tIIVpDGMftGktycdvQmFdWNTRUO unGu/amxPxJB3G3ZVRgrH1vK3J1tFpZkMoY4j7EcEx36F9ulhYFR3VVobtEYpgucvHDS 25/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eKgaeZs2; 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 hk19-20020a170906c9d300b006dffb6427bdsi1670501ejb.269.2022.04.01.07.39.06; Fri, 01 Apr 2022 07:39:32 -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=eKgaeZs2; 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 S1343570AbiDAG6q (ORCPT + 99 others); Fri, 1 Apr 2022 02:58:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343565AbiDAG6m (ORCPT ); Fri, 1 Apr 2022 02:58:42 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B243B19F45E; Thu, 31 Mar 2022 23:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648796207; x=1680332207; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Wxp4yJ/NukfxY6U5mWq/JBboluF6jxxrl8HF3wv1pMc=; b=eKgaeZs2O26Nin60M62tJcf55tS38SGNyv7Xg65rho9I7cXRxzvxZdOV lVg8aNJEZF2y3yyLjKuIWLOBxZrzMTxKvDWvq8NEZcxOnbPHUyGhRXJHj vtEkZECGe8Ke3xqaEKSvCHumW9QirU2L9I8sHJmkDfX1ZOoiR7JOKRisO ygxoS2KdWxieN69xbmRPKK9KaubAxHUyKgvGZtrwYoBDlROy/tzMphyiv oL0NbM0gBIDKv5rkDJsKrDSOQ4ZMChYzGWCXb+ApG/NluMfoarQPv7H+z NcMh4NlIURuy9eqlDr6OYNlECy5bznV9u1zC8BHiDElGzG/Miy5e3jFTt w==; X-IronPort-AV: E=McAfee;i="6200,9189,10303"; a="260045758" X-IronPort-AV: E=Sophos;i="5.90,226,1643702400"; d="scan'208";a="260045758" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2022 23:56:46 -0700 X-IronPort-AV: E=Sophos;i="5.90,226,1643702400"; d="scan'208";a="567217562" Received: from xiaoyaol-hp-g830.ccr.corp.intel.com (HELO [10.249.171.24]) ([10.249.171.24]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2022 23:56:43 -0700 Message-ID: Date: Fri, 1 Apr 2022 14:56:40 +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 , Kai Huang Cc: 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> From: Xiaoyao Li In-Reply-To: <20220331194144.GA2084469@ls.amr.corp.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 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_LOW,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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/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?