Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6022335rwb; Tue, 22 Nov 2022 07:50:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Re/PuReCpd3ggoYwWLWFo0finTCURaI7IQunKlHZbL+0fW9+8WB7fAI2tVyNh995DehJ4 X-Received: by 2002:a17:906:d211:b0:79d:f5f2:6f55 with SMTP id w17-20020a170906d21100b0079df5f26f55mr3558363ejz.531.1669132257077; Tue, 22 Nov 2022 07:50:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669132257; cv=none; d=google.com; s=arc-20160816; b=PZuE3qfGRWzpiFmRIqyCxY4qO8LHOYA72UsSoCY/XJ5xBEfJR97nqVxKiRLTz10wsJ kz+joSploxuWFcnwq1DiZJWLcy2aJjFNrujpRXZ562aN0BHGuLhDya3GL6HikHS3o2y+ MbdnM/F2ROmgCe1LE7IwlBG7XqWJThD6AjtXJGNK4PoGL2Y0MhSiCNo9o/wWOq5X/hrR sWcIWFWyoUvgRUJHJGFwZCGyapqceliXGZG68a3ORCnsBf8IkdcD7HMyMv2JLKPnFLkq g9H3Q718OVBZHVurCRPAXeolsrLRLUOYlx77aynNevVQw23hlUTzldY6qKxq4goCkj7x QwNA== 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=zYNxxpMELQ26e/UECB1rL4GQp8vjMc4zFxe3sEFS5pk=; b=ApFZU4JLBzFSjccFO0z0/04682CB+JjEAZgqeV4hMl4OPzoVbf7qAYkcZ3OTWSjHlt tEErmlu3orbcVj7y7gzQteDhVrJgSS4ECrQ4c5jgfiy1RfalHQUelNd8Cy/CMWm37D5R yZ9AaVqLC/FeMdzBKHc3EWGlaqUUHZbkvu6zS+M7+M0yucTXCPjw3R1X9ur5s0tre6AH DGky/Z/jnC5PdUDR5zFaT+O1WCeAOuhBJfIjmjkEcCE1tje1MQMcvBRdBk82r7f4dond jTdeXRlC45/VwE9AMxerF8/LBd/Xa3G1Fy13sQQzxq9zcVKQDUtnB6bNKX6wYRXEabWI BzJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Om3ssplW; 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 g38-20020a056402322600b00461c12f1f4csi4784112eda.478.2022.11.22.07.50.34; Tue, 22 Nov 2022 07:50:57 -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=@intel.com header.s=Intel header.b=Om3ssplW; 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 S233254AbiKVPOX (ORCPT + 90 others); Tue, 22 Nov 2022 10:14:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232626AbiKVPOU (ORCPT ); Tue, 22 Nov 2022 10:14:20 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFBA2248F0; Tue, 22 Nov 2022 07:14:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669130060; x=1700666060; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=r2krHQGmMwXskHlRA/gzgQj5fk0U4oZy2ymf007Yg90=; b=Om3ssplW7cuvyeHGz7LLUt/fEAbe2FNPK9nC8cZwsSlwaEwrVeC8aSZc +SZnGkMHcJ0RRdpsZXZoXCjHhJfDfy7u9c0Ti/EXBRGaDTX5gG3GHy2Pf 6LfUu1XjvivRQhqkiU9RSp7YA8huLtkNcQqi5uJZQevsVyzuApNRMiDCH ctsVRaCL04Koj9X3H328yOF8Fx7PPWzvVp0xc2pCD1NdrXsbXW3j7zMJp J2o0MEhAoY/rt+HaemD5wDbcugyI+/ajCKC9xbBg1SwwKHqdJj7VXpKNR GZHy6GVn2JpP8PFlEX/5dj/LniKuOCIx2GehDZWLpBMkjYzJB7gtdM0hD w==; X-IronPort-AV: E=McAfee;i="6500,9779,10539"; a="375979955" X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="375979955" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 07:14:17 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10539"; a="886568675" X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="886568675" Received: from lcano-mobl1.amr.corp.intel.com (HELO [10.255.231.75]) ([10.255.231.75]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 07:14:15 -0800 Message-ID: <52b2be9b-defd-63ce-4cb2-96cd624a95a6@intel.com> Date: Tue, 22 Nov 2022 07:14:14 -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: Peter Zijlstra , Kai Huang Cc: 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 References: <48505089b645019a734d85c2c29f3c8ae2dbd6bd.1668988357.git.kai.huang@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 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 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 11/22/22 01:13, Peter Zijlstra wrote: > On Mon, Nov 21, 2022 at 01:26:28PM +1300, Kai Huang wrote: >> +/* >> + * Call the SEAMCALL on all online CPUs concurrently. Caller to check >> + * @sc->err to determine whether any SEAMCALL failed on any cpu. >> + */ >> +static void seamcall_on_each_cpu(struct seamcall_ctx *sc) >> +{ >> + on_each_cpu(seamcall_smp_call_function, sc, true); >> +} > > Suppose the user has NOHZ_FULL configured, and is already running > userspace that will terminate on interrupt (this is desired feature for > NOHZ_FULL), guess how happy they'll be if someone, on another parition, > manages to tickle this TDX gunk? Yeah, they'll be none too happy. But, what do we do? There are technical solutions like detecting if NOHZ_FULL is in play and refusing to initialize TDX. There are also non-technical solutions like telling folks in the documentation that they better modprobe kvm early if they want to do TDX, or their NOHZ_FULL apps will pay. We could also force the TDX module to be loaded early in boot before NOHZ_FULL is in play, but that would waste memory on TDX metadata even if TDX is never used. How do NOHZ_FULL folks deal with late microcode updates, for example? Those are roughly equally disruptive to all CPUs.