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 923F4C4332F for ; Tue, 22 Nov 2022 19:33:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED1EE6B0071; Tue, 22 Nov 2022 14:33:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E5AA16B0073; Tue, 22 Nov 2022 14:33:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CFAA86B0074; Tue, 22 Nov 2022 14:33:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id BD0656B0071 for ; Tue, 22 Nov 2022 14:33:23 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8FD32120435 for ; Tue, 22 Nov 2022 19:33:23 +0000 (UTC) X-FDA: 80162077086.23.605F8E2 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf14.hostedemail.com (Postfix) with ESMTP id 21E3A100014 for ; Tue, 22 Nov 2022 19:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=ewJjoQL0S/lNHIZz4LCupDwv1iWHwoScCQKkcN/XzFc=; b=XGQjjLHE+GaPoNGTYy+4Y4JZUB 4pNmj0d+J/kKV64iJu24lV5KDMwqdkvtAcBsOeTU8BCoVLEX80t8HT/mXERtoMZoszHaSyl46vXgR qqSGV/dVD4Lm2ESzNtDhKR4dthTkq9qiaqDY71OMiGA2JQM/aVK+KDaOAXv88pgeIU01UjyeSVbza J4bKeyIlTTfz/J9MMOB0GIXNiWF9aY5neZuJ4k+wSGl0gj8mgZ61Dn/rnymADGESZbiCUYdSDbDMf gZihxDBp/9gFFZbubVMwJdacxj3Ul1WYGqlMYPNYD9WZbK+ENe9VkGDNZZm0Idh333+OohG04qCKS +G76noiQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxZ1A-003Z8D-VR; Tue, 22 Nov 2022 19:33:17 +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)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 50A20300445; Tue, 22 Nov 2022 20:33:16 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 349572D2BCFAF; Tue, 22 Nov 2022 20:33:16 +0100 (CET) Date: Tue, 22 Nov 2022 20:33:16 +0100 From: Peter Zijlstra To: Dave Hansen Cc: Kai Huang , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, seanjc@google.com, pbonzini@redhat.com, dan.j.williams@intel.com, rafael.j.wysocki@intel.com, kirill.shutemov@linux.intel.com, ying.huang@intel.com, reinette.chatre@intel.com, len.brown@intel.com, tony.luck@intel.com, ak@linux.intel.com, isaku.yamahata@intel.com, chao.gao@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, bagasdotme@gmail.com, sagis@google.com, imammedo@redhat.com Subject: Re: [PATCH v7 06/20] x86/virt/tdx: Shut down TDX module in case of error Message-ID: References: <48505089b645019a734d85c2c29f3c8ae2dbd6bd.1668988357.git.kai.huang@intel.com> <52b2be9b-defd-63ce-4cb2-96cd624a95a6@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669145602; a=rsa-sha256; cv=none; b=wdKBdWUzNvDW2phYaTx6qL/fX1wROdxQFne4NGJfii5IDCLQgqdPMAGgiSuH41BjRLJD8t Dk2Nh//bVYPWd/s3YygM8KaPKoYwstzWqzX+5U/bMLP1feT2Fq4rMpvH/tsJoNEbmGrxEu CSLQEnDzxHTqhxLiI8Psit1zt1vUEkU= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=XGQjjLHE; dmarc=none; spf=none (imf14.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669145602; 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=ewJjoQL0S/lNHIZz4LCupDwv1iWHwoScCQKkcN/XzFc=; b=j1m0O+LY76yBuwDtBTL2+nN7zMsQOozJP3eYBkZzVdSTI92L+D2uhpiwPF63Doue1qffo8 hZTc7pJcTLzqgGITL0q08tywPvfv7yz7xwKb4XLGDaMRc2x0o6msRGB1c1t9CrU5ITew0f 4Pfdaxuo29dzLLFI919I9wMhsWTwlr4= Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=XGQjjLHE; dmarc=none; spf=none (imf14.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org X-Stat-Signature: rpze7hhfo64oeq8q7he198d47wh3m3wo X-Rspamd-Queue-Id: 21E3A100014 X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1669145601-691151 X-Bogosity: Ham, tests=bogofilter, spamicity=0.007242, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Nov 22, 2022 at 11:24:48AM -0800, Dave Hansen wrote: > > Not intialize TDX on busy NOHZ_FULL cpus and hard-limit the cpumask of > > all TDX using tasks. > > I don't think that works. As I mentioned to Thomas elsewhere, you don't > just need to initialize TDX on the CPUs where it is used. Before the > module will start working you need to initialize it on *all* the CPUs it > knows about. The module itself has a little counter where it tracks > this and will refuse to start being useful until it gets called > thoroughly enough. That's bloody terrible, that is. How are we going to make that work with the SMT mitigation crud that forces the SMT sibilng offline? Then the counters don't match and TDX won't work. Can we get this limitiation removed and simply let the module throw a wobbly (error) when someone tries and use TDX without that logical CPU having been properly initialized?