Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29139057rwd; Wed, 5 Jul 2023 07:44:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4OrYyBETwrqau+/wWO7la4iVHjUZYoBTWJsUZAaqIFFMEOeZOl+H0CHyC/218tNg5iikZC X-Received: by 2002:a05:6a20:4c23:b0:126:9f81:1192 with SMTP id fm35-20020a056a204c2300b001269f811192mr15677937pzb.43.1688568253567; Wed, 05 Jul 2023 07:44:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688568253; cv=none; d=google.com; s=arc-20160816; b=GKU+6j2ovFXFGJSrEYacJcqj0zkcwMY/x7lZ2l/MlYpXKHB19DyITDQGCab6w584Lg +6g5MzQGF7bY1OW3sYwm947MarLCJXp7sVivPlowuTnYx2YcM3/6nB1UzpJyHtMB2Kjz fVecxLImvOQJXbqqT+bzn16w7lHa4/LdbSgF+ewUKREnToZ8JDaRH1HELmNDX+/Frafp PhqE10CCpKYbYD5742RB0DAxFcMv3yiV8zuURubfWr46M9qiRxUtzlpz7ndV0VfO3MQE iNRuiHycDoCrBq+RcbQjCtLhtRCERPNLrPCvGuQcXZT/WjSbbUtgvy4u/e810mkRuOdK LsVw== 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=a5hGIExQfFBpM6Th40RZ4SL/NTlDBZygBbBVpl9+xmg=; fh=8G8DKYv6Zj21Ln/Y90V/azCcjcVqdo4YxWyF+wc+8yw=; b=nfLGfhy5RFO6BlnljT+Hc6rVvDbCWOiBSb8Ptn2/niU9ap6vXk6qnw7wUANB+g1q9u 3fcEPe1v2+80BN5qKxLJ9o7CXlFNcCQzHG7ydxPnrupra7gUCI6WNfXiIUB/NBHfW/Ua 6Q6/ps6OdccgKWRxvOkPvAe3TxPkWl06UKB5Ub5F64N3aDaiFC+b759x1bfE+7q5FTmt LQmqlqQd5SuF6RDAVp7+gDVmh/TmJizjIRLQs/whrzqlbPbKfQElLkMffJD//2MFVvzs ZrvsHKA5sWxe9wYJf7vX0ibntBJ6to/31ZdtVGxtq1JSpjsQ8MY9qnpL8CZ5dmvsWL7X OwEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HS9Q9q3+; 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 cg13-20020a056a00290d00b006825b4fae9dsi11857762pfb.166.2023.07.05.07.44.01; Wed, 05 Jul 2023 07:44:13 -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=HS9Q9q3+; 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 S232410AbjGEOfY (ORCPT + 99 others); Wed, 5 Jul 2023 10:35:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231540AbjGEOfX (ORCPT ); Wed, 5 Jul 2023 10:35:23 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A074712A; Wed, 5 Jul 2023 07:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688567722; x=1720103722; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=WQapOgHKiFYlx2YNIHI1rc9qJxC2isYNrPhJNnI3h7Y=; b=HS9Q9q3+4Gv4VVR+IuriLTVR0Il6r4qzpvboPHY/+kA6EC/Sm7jW3a/w 3cyOLVLsRE6qhwb0QiytHoX94AlEaGRnjF4UEShupvX32fu/vl4DqOGzF gs9rbz3Vo6n+slJKiZsAPE1uZbxfk1AheIoauzztTfiWG1Czv7HYLIGs2 +Xu3HuNPJrbgRSOSWrAgnR+3rtn5ryJfNQousd3OpIulfKvx/ot+JEDdM By0SrSPbkKCBTbF9OXpowqYUHOXXCiOiq3QO15c096mJ7zRZ+wcWTZfwD yots5AKWIYPtIA2MqHaSHxm+ygndUGZkVaR1HvVLUZQ2czsquwnVYtzQD w==; X-IronPort-AV: E=McAfee;i="6600,9927,10762"; a="427040562" X-IronPort-AV: E=Sophos;i="6.01,183,1684825200"; d="scan'208";a="427040562" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2023 07:34:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10762"; a="713217660" X-IronPort-AV: E=Sophos;i="6.01,183,1684825200"; d="scan'208";a="713217660" Received: from subrator-mobl1.amr.corp.intel.com (HELO [10.209.29.125]) ([10.209.29.125]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2023 07:34:06 -0700 Message-ID: <1a8099e2-da28-6b2a-7b5a-1d6346b7f95d@intel.com> Date: Wed, 5 Jul 2023 07:34:06 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v12 07/22] x86/virt/tdx: Add skeleton to enable TDX on demand Content-Language: en-US To: Peter Zijlstra , Sean Christopherson Cc: Isaku Yamahata , Kai Huang , "kvm@vger.kernel.org" , Ashok Raj , Tony Luck , "david@redhat.com" , "bagasdotme@gmail.com" , "ak@linux.intel.com" , Rafael J Wysocki , "kirill.shutemov@linux.intel.com" , Reinette Chatre , "pbonzini@redhat.com" , "mingo@redhat.com" , "tglx@linutronix.de" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Isaku Yamahata , "nik.borisov@suse.com" , "hpa@zytor.com" , Sagi Shahar , "imammedo@redhat.com" , "bp@alien8.de" , Chao Gao , Len Brown , "sathyanarayanan.kuppuswamy@linux.intel.com" , Ying Huang , Dan J Williams , "x86@kernel.org" References: <104d324cd68b12e14722ee5d85a660cccccd8892.1687784645.git.kai.huang@intel.com> <20230628131717.GE2438817@hirez.programming.kicks-ass.net> <0c9639db604a0670eeae5343d456e43d06b35d39.camel@intel.com> <20230630092615.GD2533791@hirez.programming.kicks-ass.net> <2659d6eef84f008635ba300f4712501ac88cef2c.camel@intel.com> <20230630183020.GA4253@hirez.programming.kicks-ass.net> <20230630190514.GH3436214@ls.amr.corp.intel.com> <20230704165836.GB462772@hirez.programming.kicks-ass.net> From: Dave Hansen In-Reply-To: <20230704165836.GB462772@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 7/4/23 09:58, Peter Zijlstra wrote: > If we have concerns about allocating the PAMT array, can't we use CMA > for this? Allocate the whole thing at boot as CMA such that when not > used for TDX it can be used for regular things like userspace and > filecache pages? I never thought of CMA as being super reliable. Maybe it's improved over the years. KVM also has a rather nasty habit of pinning pages, like for device passthrough. I suspect that means that we'll have one of two scenarios: 1. CMA works great, but the TDX/CMA area is unusable for KVM because it's pinning all its pages and they just get moved out of the CMA area immediately. The CMA area is effectively wasted. 2. CMA sucks, and users get sporadic TDX failures when they wait a long time to run a TDX guest after boot. Users just work around the CMA support by starting up TDX guests at boot or demanding a module parameter be set. Hacking in CMA support was a waste. Am I just too much of a pessimist?