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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9132EB64D7 for ; Fri, 30 Jun 2023 18:30:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 286558E0042; Fri, 30 Jun 2023 14:30:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 236DB8E000F; Fri, 30 Jun 2023 14:30:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FF6B8E0042; Fri, 30 Jun 2023 14:30:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 021658E000F for ; Fri, 30 Jun 2023 14:30:40 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BFED9B0A5A for ; Fri, 30 Jun 2023 18:30:40 +0000 (UTC) X-FDA: 80960255040.09.80952A8 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf06.hostedemail.com (Postfix) with ESMTP id 04960180017 for ; Fri, 30 Jun 2023 18:30:37 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=h03AT+Eg; spf=none (imf06.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688149838; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=CbMDicFOeY5VdckkPN/BPu5OIcTYRlOakMO4pzeR/1s=; b=JPHUEpAw4ifbYbtQm7h4shiRPYg0/h7q7G0qKNICD6g1gfdBW58Xj1gXvUfOUCv8XyYuJT H51grHy/miRGof13xthG4Be4Ngcbwjs5+ZNYTy3DQvrp3kKlJDjxpTCrfrEn6oYvXOrMm+ EcNKW37Lya9ADIczKRdeH/Wut0YfV0I= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688149838; a=rsa-sha256; cv=none; b=pkoGoLiveYxmfIBKtNQl6CN8mHr5WeOCqb2g9vsf2Ze/zjXcUeVav0J2AQHxKPcVPxYEvb tE8hxjmz90A4bhGzALE7gA0I58Xc2+Ub374jAIIriw3tBsrkhrKKLrcVUrPAqHRpGT5ag2 YTdTkE5qAX/gA55/5ihsfka6XBV5f50= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=h03AT+Eg; spf=none (imf06.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CbMDicFOeY5VdckkPN/BPu5OIcTYRlOakMO4pzeR/1s=; b=h03AT+EgdHGL4gmfUn6nIQf9kH tELcfcbxNx0EqJWT5XOxA9ZzAKMuqZW6XgnUq950oj8vWss02KuLnaDjVw94Ajimy1any1YceyFR1 U1yb8klAe0V3ySXfH3TneSOe2xHvZDO/MApSEtk0qHKoA9TjdcIfay9yn2KtAPkRJAIm7prGPyPfz 52C0MdaendV3o4ok05d0OwwXQ6cDBvfh1OT3pM2yxtyZlSEde4fF3LlR1J8lHXLMVWWXSOxietDx/ fwFzj/EWWyW4GJPVLKcip3eE27+oqwqlRGnHY6FISc/OFtMPzNAvPT9TPckRpBCQ1fhQopG1hfYPm +RlqUpoQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qFIsx-005uVm-5a; Fri, 30 Jun 2023 18:30:23 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0500B3002E1; Fri, 30 Jun 2023 20:30:21 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DD53824824672; Fri, 30 Jun 2023 20:30:20 +0200 (CEST) Date: Fri, 30 Jun 2023 20:30:20 +0200 From: Peter Zijlstra To: "Huang, Kai" Cc: "kvm@vger.kernel.org" , "Raj, Ashok" , "Luck, Tony" , "david@redhat.com" , "bagasdotme@gmail.com" , "Hansen, Dave" , "ak@linux.intel.com" , "Wysocki, Rafael J" , "kirill.shutemov@linux.intel.com" , "Chatre, Reinette" , "Christopherson,, Sean" , "pbonzini@redhat.com" , "mingo@redhat.com" , "tglx@linutronix.de" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "Yamahata, Isaku" , "nik.borisov@suse.com" , "hpa@zytor.com" , "Shahar, Sagi" , "imammedo@redhat.com" , "bp@alien8.de" , "Gao, Chao" , "Brown, Len" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "Huang, Ying" , "Williams, Dan J" , "x86@kernel.org" Subject: Re: [PATCH v12 07/22] x86/virt/tdx: Add skeleton to enable TDX on demand Message-ID: <20230630183020.GA4253@hirez.programming.kicks-ass.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2659d6eef84f008635ba300f4712501ac88cef2c.camel@intel.com> X-Rspamd-Queue-Id: 04960180017 X-Rspam-User: X-Stat-Signature: o7qx5mimxt6fizrszt1cq173j5ck791r X-Rspamd-Server: rspam03 X-HE-Tag: 1688149837-300089 X-HE-Meta: U2FsdGVkX18c8XsBeqkcrvBrJ5/lSTvsOXd2XCwJXrn32+25AUQasXeeFVP/3Psv/uLF8ig5Hg1piOhfGnct55Ioe8HrYWgPh80GGMv5z8WdOV9de94ZyfMUCdDcM8KGk5fEGgCuekRZEHc96VacYetDpSa7uEnTrHujOXaflHNLFIyJrq2ciMEEzk+gqUOOSweO0asIiqB2p+HwM3idicf8JDco4Lm7kZAJ1HUBTpCpoHKa7942ObraCV2cwFrx3LHJvNDTiOtc5JD+s8wyjcV4LcGU5J54sO2hc8PCWihzTMK0Kck9cle+rWCm9QkKDjQtYNByI3HEWmpcfPYaO32LFYXmbIM+ypYhvSpkmJromq3tx+H53ZIl44L+P4fK5hY3W2fmmdyyitYIHIcnTsu4hg+AO3ACVIEnk9ZyZmZLlMy7D6eCGEqwQC70/Rl+BDaJulbFcKa1eShdJHc9QC65JxziiGBqKXLxVQgT+yGjuP93VARyaW4BhzC4eJmF9CIi5IsmhZTPZF70TXlAnflpTxYHw9VF0vSiRo7/o/v3DrKqaMeRs/xPBEuc5rmrolg41Tri/RiqsJ0rmuqMq0p9PsaV7SUM4vAfwQJC2gFU/lR61NsKBYdnzLdPiWw+6RjD4XDzjBCaMkv3+E5Podv4HdKnFUfl1zswhlXqqNUOMXo36+ZfVL6ad/kbQdkfYAPuE0vJ5/kfX4GLWHjbHiG5qkok1nopqSwDrtFFNR1xi5Kspxq8FxBGR1KaaGbkIgTqZZAEceFoLg6PhVdib1uzgIt88/geWUecKO+62ZpAQ3+6uot86ygpLr3AwibwF7aVMPi6ltkdgRAOXCcSaUXzj1XZXvGpdctkTJVHOw/2B0B89yqYLrC7BOv+nJszKzhLU3F3+8WopAN6oQYyNMILd0Cbn73KqV5+qLRry591UqEn3ofstFmNivlczdHG0h82N0C6bDEWNwKuxnf mqTlSXpd ySrk9PSQMdYOxIf6o8oXCs/SnVnWzt7cbRFXZIkeH6hgA3QWJy6X4JUMPUFvEJYYBSEuG1eVR0XwQWdOQ5doCU8cCMSSO12th1hL4pVOCCwwbaV/aamR1y4zdOGVTC6pU/IbHRvkGHRA33HrxNFQvfSq/w+m3xiIvc12flcsIwC0IIOTDG1zAqcNMCg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jun 30, 2023 at 09:55:32AM +0000, Huang, Kai wrote: > On Fri, 2023-06-30 at 11:26 +0200, Peter Zijlstra wrote: > > On Thu, Jun 29, 2023 at 12:10:00AM +0000, Huang, Kai wrote: > > > On Wed, 2023-06-28 at 15:17 +0200, Peter Zijlstra wrote: > > > > On Tue, Jun 27, 2023 at 02:12:37AM +1200, Kai Huang wrote: > > > > > +EXPORT_SYMBOL_GPL(tdx_cpu_enable); > > > > > > > > I can't find a single caller of this.. why is this exported? > > > > > > It's for KVM TDX patch to use, which isn't in this series. > > > > > > I'll remove the export. KVM TDX series can export it. > > > > Fair enough; where will the KVM TDX series call this? Earlier there was > > talk about doing it at kvm module load time -- but I objected (and still > > do object) to that. > > > > What's the current plan? > > > > The direction is still doing it during module load (not my series anyway). But > this can be a separate discussion with KVM maintainers involved. They all on Cc afaict. > I understand you have concern that you don't want to have the memory & cpu time > wasted on enabling TDX by default. For that we can have a kernel command line > to disable TDX once for all (we can even make it default). That's insane, I don't want to totally disable it. I want it done at guard creation. Do the whole TDX setup the moment you actually create a TDX guast. Totally killing TDX is stupid, just about as stupid as doing it on module load (which equates to always doing it). > Also, KVM will have a module parameter 'enable_tdx'. I am hoping this could > reduce your concern too. I don't get this obsession with doing at module load time :/