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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2D56C3A59F for ; Wed, 23 Nov 2022 16:41:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238987AbiKWQl3 (ORCPT ); Wed, 23 Nov 2022 11:41:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236447AbiKWQl0 (ORCPT ); Wed, 23 Nov 2022 11:41:26 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 776CBBA5A3; Wed, 23 Nov 2022 08:41:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669221685; x=1700757685; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=blO4q9CHjwlTLq8BfvWLfz9x3xTEUCmlfYlE/Q+m6is=; b=MmfUQKvjHArSMCC8I9ZX4rquWSsSagcbDH+53ZvSa4aMNGNHKE0p0vBX AiJ9cDIRunTi769bMoiyNjSUBMqiHfFmuUhOfWhJhq8gLlTWfsxGQmxxE Vv1mSEv5YzfHCBmxue4Q9jIpwka3hlU9SuZZGuJ1WSRkDVQnuPJfgZBai bjwiQY6SAUzb+tHP2EFYi311HRUXNJ43/vSt+UWOlbnhrl3Cd6kk8q4DY DvabwLFFGoEpK/Odia92Hfw110ENATMuQ1tOS6tfIUTZEsEx9UkYDYPFN sm5F1I/5IgBDLmcyFxI6IeD2HthjXZHIPpEuondLlrYYZ81HROTW3im0f A==; X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="315259518" X-IronPort-AV: E=Sophos;i="5.96,187,1665471600"; d="scan'208";a="315259518" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2022 08:41:25 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="816537366" X-IronPort-AV: E=Sophos;i="5.96,187,1665471600"; d="scan'208";a="816537366" Received: from vcbudden-mobl3.amr.corp.intel.com (HELO [10.212.129.67]) ([10.212.129.67]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2022 08:41:24 -0800 Message-ID: <168ca2b3-ffac-31c4-0b83-2d0ee75f34a5@intel.com> Date: Wed, 23 Nov 2022 08:41:22 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v7 06/20] x86/virt/tdx: Shut down TDX module in case of error Content-Language: en-US To: Sean Christopherson , "Huang, Kai" Cc: "peterz@infradead.org" , "kvm@vger.kernel.org" , "Luck, Tony" , "bagasdotme@gmail.com" , "ak@linux.intel.com" , "Wysocki, Rafael J" , "linux-kernel@vger.kernel.org" , "Chatre, Reinette" , "pbonzini@redhat.com" , "linux-mm@kvack.org" , "Yamahata, Isaku" , "kirill.shutemov@linux.intel.com" , "Shahar, Sagi" , "imammedo@redhat.com" , "Gao, Chao" , "Brown, Len" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "Huang, Ying" , "Williams, Dan J" References: <48505089b645019a734d85c2c29f3c8ae2dbd6bd.1668988357.git.kai.huang@intel.com> <52b2be9b-defd-63ce-4cb2-96cd624a95a6@intel.com> <791bf9a2-a079-3cd6-90a3-42dbb332a38c@intel.com> <9f1ea2639839305dd8b82694b3d8c697803f43a1.camel@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/23/22 08:20, Sean Christopherson wrote: >>> Why is it done that way? >>> >>> Can it be changed to delay TDX initialization until the first TDX guest >>> needs to run? >>> >> Sean suggested. >> >> Hi Sean, could you commenet? > Waiting until the first TDX guest is created would result in false advertising, > as KVM wouldn't know whether or not TDX is actually supported until that first > VM is created. If we can guarantee that TDH.SYS.INIT will fail if and only if > there is a kernel bug, then I would be ok deferring the "enabling" until the > first VM is created. There's no way we can guarantee _that_. For one, the PAMT* allocations can always fail. I guess we could ask sysadmins to fire up a guest to "prime" things, but that seems a little silly. Maybe that would work as the initial implementation that we merge, but I suspect our users will demand more determinism, maybe a boot or module parameter. * Physical Address Metadata Table, a large physically contiguous data structure, the rough equivalent of 'struct page' for the TDX module