Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp420743rdb; Tue, 5 Dec 2023 08:57:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IHl/YcH1SSN7fkaFneRBGpcFczgDlyemkbkotKockowoIirTf7F/aBjZrAtJ8F+E2N85scj X-Received: by 2002:a05:6358:280e:b0:170:17eb:7c55 with SMTP id k14-20020a056358280e00b0017017eb7c55mr8237799rwb.40.1701795473509; Tue, 05 Dec 2023 08:57:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701795473; cv=none; d=google.com; s=arc-20160816; b=SklIQug1D74E08C6mpZjyzQJB8v8B33zjqTtFSsjDkHdMcv0wagLr0l0kVpnOWefjE vvQ2xnBVKinIO6UCJvl7gYQ7sEse3LF5x9SPn9HDb/1vF9RVDWVQMjqoGNEPI2+znzTB aYBK4aqKFkfu2YlWiNW2BNeXR3i76mjELAXEAf6pKj7RT8P3G/CqCgkJDA6GA2/xqSdP KU0/AeIeM6eOGf/ih6Vt172rucjjMpSGju7ZCdNej7wIYw7pH210sausqwC0hzOYtzP9 Gd5IVKFUARtNrZcez+REu8eH2m3gqYGwIltsjzY9sflpiAgpf7d9JbFeGbvClWGzoVA/ YDPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=jK7s+QAqQUTPUwpooiy5GVM6IbU9OMdsdVHDH5OFNq4=; fh=maHtkR72+aKZ1IoVlN8LgfHda4byGdBTj+tLWDHcn68=; b=Rt6Er56gtDQ37ySCgsNScKD8fHCvDlbeuopu/ESiHfUbPnSlpwwMS4qU8Bf9o+5k5B XizferANdkS2V2FPu6qYsTPkJQA2oMotHeEiWJSAg6TKaAz81H18U5W4b1/pgiQzgHpu S4aur+xfp5D9lSrlcWAZ5/pjEx6cfyShAaSroCF2IxKI04LyC2lfzr9Yl+WHab31mH28 pCz+Pft8x8OdRncxzj0LxPoA7fZ4llpMRwxKx1XFTkmRY5oJzFTrjUOpUpfu/LNcHqXE N/uO2sW6d0PUXMNu0/dP9aoEeHZpTplpgmCaFhyJYYGsN3WJAVUv6urU4ZobeHZumVxn ubgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="aOevY/Qe"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id l15-20020a65680f000000b005c67dd98b12si4502942pgt.280.2023.12.05.08.57.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 08:57:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="aOevY/Qe"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 634AD80E7094; Tue, 5 Dec 2023 08:57:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232070AbjLEQ5d (ORCPT + 99 others); Tue, 5 Dec 2023 11:57:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345170AbjLEQ5a (ORCPT ); Tue, 5 Dec 2023 11:57:30 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 884A3188 for ; Tue, 5 Dec 2023 08:57:36 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5ca2a6f07b6so94918797b3.2 for ; Tue, 05 Dec 2023 08:57:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701795455; x=1702400255; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=jK7s+QAqQUTPUwpooiy5GVM6IbU9OMdsdVHDH5OFNq4=; b=aOevY/Qe7zUcXkFFuv4sbeDRgX2s2dMIMYU38YRJMA3jSFDQfypw3w+KH5AlPPUv0w D8dt/0bTkQXcn1gfG1mEK61F0x5t9vHyDj5+V51NPzmoaCYUhvsSbRy7MLjVG++p5/tU p4BABMJSdN2GtIHBBHI/68XeG/e2jjGk6xi8Qmqma7Mvd2sEDs/QUv3TMS6G5Db28pNo YDAsya+vzspvw2FdeMQoEo0CXiT9fCxXckkRa7ou5gpkeJdlaSi+XaDOwXcL7rfFqS1C tA8inX0axpPuuR+cMZx7ojqdvmCVi9oAbPFNg5YSY3IToePjS1v37mj8QOoPTe5UiyjV CKXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701795455; x=1702400255; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jK7s+QAqQUTPUwpooiy5GVM6IbU9OMdsdVHDH5OFNq4=; b=XPzu+u+5Nw01cm275gnFrW2aH0dQhX/A3Vagkfvj8egMpmkQp+dS17KEsAIABrHz5M FdyyQDtclaw841qEj1x3FnyuQNdW6NOw3SkXTTkrTM661ySEoDcNAxkiFRdkdHWrEh8V UzzoVoG2mAokECqiN1NUUcXkHnVQPdFxGmqcCBA3xozijs/SPwV9g8lrn2t1zsBDCeM2 d37xWC2b6+nSqLLYAvmgse6X7Upzo21n3ivcQ7vkp4MlgtvY3cRqHudb7zQbmE4FlvBY k4f6jEh14YX7HpZzWZH85xVTiNOLsVZaon1A63kUIHqAR2/KnK0JwmPslyZ+8jO/gf84 /+ug== X-Gm-Message-State: AOJu0Yy2GodtsJ0yvmyylTUA9430S5QTeYAtiPLiYbbv17A/GBbm3suG nRxksS0EIcIjnPkgWjLOWdVOwcTzMCg= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:9bd6:0:b0:5d3:8857:b78e with SMTP id s205-20020a819bd6000000b005d38857b78emr418668ywg.10.1701795455593; Tue, 05 Dec 2023 08:57:35 -0800 (PST) Date: Tue, 5 Dec 2023 08:57:33 -0800 In-Reply-To: Mime-Version: 1.0 References: <9e80873fac878aa5d697cbcd4d456d01e1009d1f.1699527082.git.kai.huang@intel.com> <9b221937-42df-4381-b79f-05fb41155f7a@intel.com> <1a5b18b2-3072-46d9-9d44-38589cb54e40@intel.com> Message-ID: Subject: Re: [PATCH v15 22/23] x86/mce: Improve error log of kernel space TDX #MC due to erratum From: Sean Christopherson To: Tony Luck Cc: Dave Hansen , Kai Huang , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "rafael@kernel.org" , Chao Gao , "david@redhat.com" , "bagasdotme@gmail.com" , "ak@linux.intel.com" , "kirill.shutemov@linux.intel.com" , "mingo@redhat.com" , "pbonzini@redhat.com" , "tglx@linutronix.de" , Isaku Yamahata , "nik.borisov@suse.com" , "hpa@zytor.com" , "sagis@google.com" , "imammedo@redhat.com" , "peterz@infradead.org" , "bp@alien8.de" , Len Brown , "sathyanarayanan.kuppuswamy@linux.intel.com" , Ying Huang , Dan J Williams , "x86@kernel.org" Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 05 Dec 2023 08:57:48 -0800 (PST) On Tue, Dec 05, 2023, Tony Luck wrote: > >> Fine. This doesn't need to change ... until you load TDX. Once you > >> initialize the TDX module, no more out-of-tree VMMs for you. > > > > It's not just out-of-tree hypervisors, which IMO should be little more than an > > afterthought. The other more important issue is that being post-VMXON blocks INIT, > > Does that make CPU offline a one-way process? Linux uses INIT to bring a CPU back > online again. No, KVM does VMXOFF on the CPU being offlined, and then VMXON if/when the CPU is onlined again. This also handles secondary CPUs for suspend/resume (the primary CPU hooks .suspend() and .resume()). static int kvm_offline_cpu(unsigned int cpu) { mutex_lock(&kvm_lock); if (kvm_usage_count) hardware_disable_nolock(NULL); mutex_unlock(&kvm_lock); return 0; } static int kvm_online_cpu(unsigned int cpu) { int ret = 0; /* * Abort the CPU online process if hardware virtualization cannot * be enabled. Otherwise running VMs would encounter unrecoverable * errors when scheduled to this CPU. */ mutex_lock(&kvm_lock); if (kvm_usage_count) ret = __hardware_enable_nolock(); mutex_unlock(&kvm_lock); return ret; }