Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6331775rwb; Tue, 22 Nov 2022 11:48:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf4bbqB2W3QgLmsUt3kOp2jTDM3My035dyIp+X96FSe7ow0wkhUFqbHUtyBmpyTjrZe0rRLi X-Received: by 2002:a17:90b:2792:b0:218:a152:12c4 with SMTP id pw18-20020a17090b279200b00218a15212c4mr15345408pjb.125.1669146517941; Tue, 22 Nov 2022 11:48:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669146517; cv=none; d=google.com; s=arc-20160816; b=ph/Sp0brlY6EFAnCMSc300CgIUdAmfceSfIoHh6RTtM8RtPpPKSWSrUXi7kTFIUwEs qQE1KNIxC2BTIkNTzmswh7Wcd9aCREetzGOA6vp7cynXi5czZsugn0BoJ57kZF124NSI T/N/WdpBPmGaPQleTr8Qb+5AgTrYRqzvckGo8mjlEsTMv22+Borg26njr2y+IixNYNTc zD8jH60ib5S3JYc9mCZLKEx0HzuNzMr+BoZKH40xeaHdIJI+iCti2kbUKqp/TlzDvV3h 2T0BtkaXNpfneXdZudU6TPZ9bWDZPa7nOBUxia99eaAx+bm0YdjqhvZYMuaI10R6P106 3zHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ewJjoQL0S/lNHIZz4LCupDwv1iWHwoScCQKkcN/XzFc=; b=Wk2d0C7st68qflnyq5z4HRKpScai3EkajdxMJW/Ht2yUUdkR9iLe2jhIP/+bUdQ3NS rvGAV/FbSSRvbmUTI2XLPNyc5MfH5jsSb/i1UAQfiGf0p312FR+PoO1HBdQ+NnW/gIgA O7Ajj884vZtzy+MAPtOymflyKsJ/UxpY+tVo0NQ4alwpkzAhZLOZMvj6SQt7zxUeFv7A 2wRfxnfpyVLkScANRCrdLU72WXWIOJ8/+PARKF/NzhcFH3UD+uvqMeSFcYeK+V4SjEyv dnfOMMRkYezouMPypDzdx0NG7fNRkvmZdHJ0wbcHZvNmjo7YsEXEvjIkPL3zLYs98jdN CiDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=XGQjjLHE; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h24-20020a17090ac39800b002138cf12ae0si17012732pjt.117.2022.11.22.11.48.24; Tue, 22 Nov 2022 11:48:37 -0800 (PST) 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=@infradead.org header.s=desiato.20200630 header.b=XGQjjLHE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234817AbiKVTdp (ORCPT + 91 others); Tue, 22 Nov 2022 14:33:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234429AbiKVTdc (ORCPT ); Tue, 22 Nov 2022 14:33:32 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51D1B25C54; Tue, 22 Nov 2022 11:33:29 -0800 (PST) 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: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 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?