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 312B6C4332F for ; Tue, 22 Nov 2022 15:14:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 78F326B0073; Tue, 22 Nov 2022 10:14:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 740306B0074; Tue, 22 Nov 2022 10:14:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 608546B0075; Tue, 22 Nov 2022 10:14:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 522846B0073 for ; Tue, 22 Nov 2022 10:14:19 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CABBF1C6810 for ; Tue, 22 Nov 2022 15:14:18 +0000 (UTC) X-FDA: 80161424196.25.559DFD7 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by imf08.hostedemail.com (Postfix) with ESMTP id CD343160012 for ; Tue, 22 Nov 2022 15:14:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669130057; x=1700666057; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=r2krHQGmMwXskHlRA/gzgQj5fk0U4oZy2ymf007Yg90=; b=efiEr1Oz6QekxkZTirV/UzqwNtISHHtgPltjct2Ewm1O4HHY2wAScV/d Np966uVzQD5fc2QJk95F7UQOE3bP8mt+hx6piKKvF9kaA4ZXfkJpD+Bc6 xa8EPBo4cYRM0DsFogjqP1RL5IMmHkg4ZPO7lGxJx38GUX8iaJFebiYdH U0yhEgFFF59SuW3iHbTa6rwNc0JPyR5ZyGQOeXkSsj/F8RwEi2zY7pb8E StamKvRoNdTnxnYS9W2Bc/VM4ir/PuV7itfiFVoelnXMqZ5A3EjR8ES9C NzWADkuTeJfPyyLX/nyFKxgs5ZCJXGeZnGSnmxpX2MshClWTaM/Pbo39b Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10539"; a="400125909" X-IronPort-AV: E=Sophos;i="5.96,184,1665471600"; d="scan'208";a="400125909" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 07:14:16 -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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669130058; a=rsa-sha256; cv=none; b=UURBKTc80h80PWh0hCUWEiNCeDdhOqVMZf9h+oboH2xgwy19c9WTyiwEakHmpc+5vXyDiF 6kErUMflM95VnRli7Nd6qx17xDzQRHxIbbLbo3p+Y+E402klLpbvT9AEb99I3EYNL8em86 atkOiQZWVVT7xWwYNv3nWA3xQyJ3mEk= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=efiEr1Oz; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf08.hostedemail.com: domain of dave.hansen@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=dave.hansen@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669130058; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zYNxxpMELQ26e/UECB1rL4GQp8vjMc4zFxe3sEFS5pk=; b=vyPc6oYVZEAHafIuGTXINLx2ESIJmQUHMK0cuFU8xA95fh4KoVFbfuBiyeuHWPxBbaC5TG NEKJgislDIFxtDlJReQ5agtXk6piRM7Ott6TaPtVXyGzfN5p54Ec7QAFE5XmCicchqBvaK LmDWVX9U5+Zhs8Ish/1nNNBJ5aomBm4= X-Stat-Signature: 41pct7mjdrizj4n3u91ws3hose1xyuig X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: CD343160012 Authentication-Results: imf08.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=efiEr1Oz; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf08.hostedemail.com: domain of dave.hansen@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=dave.hansen@intel.com X-Rspam-User: X-HE-Tag: 1669130057-802416 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 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.