Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp102529lqz; Fri, 29 Mar 2024 09:48:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUaygsLMrglSGIeBrQLp2kJKQe1n4RE15dLufymOUX0bB1kqYO4vyvhizjqozBGfBahP9n38g1piHuISpdtaUvzlGzAgud/vgj8e/lbCw== X-Google-Smtp-Source: AGHT+IHZlOrWpIUPhbm8P4sUh1BHYlMnOw4Nb1U96WU9jvVv+phiXiM9zCHup/8bo/h+qY1LwxLr X-Received: by 2002:a17:906:ca9:b0:a4e:29b9:b6aa with SMTP id k9-20020a1709060ca900b00a4e29b9b6aamr1691823ejh.51.1711730917070; Fri, 29 Mar 2024 09:48:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711730917; cv=pass; d=google.com; s=arc-20160816; b=QbD6dANSDW5oWwI2jOmFWZHLiKkrWgW9vfWyqQFjz4TqoyMoPgbSNdvLYSIeJSFFEe 87j/EL1IGk+UrJ6S5bnK+K6gAlzc+wEkLMNk7Xke9AMT0Ls0wzeUPxbHoPW5dx98C+44 F9P1g1iJlntzQwdfqlk2cb1lCLcs4xgYUhHnEEXGQzjIuw8GkVXFkemX5zEo3GeUTQMW +Zb8/WdKnCcxnXKMdAAFkKYvpxSRTW/u2xkiZr2D6IQCpaNNq3L0NjwAiRTQwE5tVmA0 orPpZX5LygKA8IyKPwSfnLRncKv60cdQ3KcqrkCYt8Zz/mL7ZuwgfCmHm/dLhxo43N4C d7Sw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Y8NlvqhpJeRV+QrYaG0jO6OtOfco30kxq16UiwqLriM=; fh=HCRqudk9hiz/L+aQEnjhh/59pXX18/0ZO5lqjHfp4b8=; b=xJLY5GvcYRS138L8LPgsZdkjaVSvtW5r6WtI61iTS/7eDiNR+kRWoSLS+QkWaU18Z8 Vbq1UA+BvOkPCDXpSj8VbxxWNdQ1H93yunvFI5jdNcfWRw5pPpoxXDb0O4kKkdmpGlcn l5vpxUD4098p6YFPZP/sJ3hvFdAJjW07AhEIof+wXHzrcDEFyoIlFdZ4wfjST58m3O9m /O4QqTdLp9RUUgOOip223ExwTE5wTjfTP9SlX+WKZxMsFUdaejrfFPg1hhZDkwNKQ0WM FWTzyo4773+UeHZNcNJE8aOH6MYMUKmkV15kxpJI0Hvc/YWRg+WgXMxurDWf+8AFkPOh SQOg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=k7sGzsX5; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-125189-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id k11-20020a1709063e0b00b00a47303dc04csi1888044eji.452.2024.03.29.09.48.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 09:48:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125189-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=k7sGzsX5; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-125189-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C82651F2560E for ; Fri, 29 Mar 2024 16:48:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 612714F218; Fri, 29 Mar 2024 16:48:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="k7sGzsX5" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3031A2C19F for ; Fri, 29 Mar 2024 16:48:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711730909; cv=none; b=gbRG1j141ljUedRcDFT0h1jvidDaTCzhsOfj7FG9LijQc7kMwoZI+aXALnetxW/3Qc/Kiamtuia+9UDntS+gOcRDZZWGrBTidKY/OT1HxkUkzY571F14jJCdPMTk2rcZzYM6Ol1ql2ruTTbNCLtjeMbrjYxkUaidVQvHhTNGA38= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711730909; c=relaxed/simple; bh=VHSFCeLmDsuoG8JZu78Wui4erUPAkz/n1mlCxxF71tE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HbzXTioIBMA57IqLm4h6FgaDKkTeu1IBnJd/F3NAfBv9Xjgs0VX6HejiFgpj+0+wmz6F2M+kqoRncOXR+aT4sQZ4qAFtEzA17yxnG/eqYBLLnEgoI8BxkyD+btbALVve28rYlo6Mj2DscfsHGtoBZzrLadXFqyj7gliNw65WNHM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=k7sGzsX5; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711730908; x=1743266908; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=VHSFCeLmDsuoG8JZu78Wui4erUPAkz/n1mlCxxF71tE=; b=k7sGzsX5crwd+fw9ENSYhKlFKR+2dnE/EnsRycLASfz6Zr+Pb6lrrDH/ 3neB3JkfjlXG0O1DCT1zO2w8PZzd1UmLm6LHxle8oiltHCmKC3lBMGdoA rMD3a8OhN5r1Ol7sDrXmonOfDuP2D4VjGnKKNlCbICFaLGVkxL+lEhOp1 5kYzxWAEsc4qtGpPBY7uPjWAM6hwnSjn/JmJXNzeSmuhXC5VJBgwc2pPN D3V6EcPDxEGIIrABBTVKvxllPx1zINq6Dv1g4b7tZwRSUcMOVry5aAWbp fEsggD3irfk99LM/gWU1ZvV+LI7ybHhkEfkRlaCd/Lxgipwsxip891M2/ w==; X-CSE-ConnectionGUID: L0IqpdhXQ7K3hpdc4HngjQ== X-CSE-MsgGUID: n9VN2X5UQHqVSCPmtJs8Wg== X-IronPort-AV: E=McAfee;i="6600,9927,11028"; a="24385638" X-IronPort-AV: E=Sophos;i="6.07,165,1708416000"; d="scan'208";a="24385638" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2024 09:48:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11028"; a="937078212" X-IronPort-AV: E=Sophos;i="6.07,165,1708416000"; d="scan'208";a="937078212" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 29 Mar 2024 09:48:22 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 59EA818F; Fri, 29 Mar 2024 18:48:21 +0200 (EET) Date: Fri, 29 Mar 2024 18:48:21 +0200 From: "Kirill A. Shutemov" To: Xiaoyao Li Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "Rafael J. Wysocki" , Peter Zijlstra , Adrian Hunter , Kuppuswamy Sathyanarayanan , Elena Reshetova , Jun Nakajima , Rick Edgecombe , Tom Lendacky , "Kalra, Ashish" , Sean Christopherson , "Huang, Kai" , Baoquan He , kexec@lists.infradead.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCHv9 05/17] x86/kexec: Keep CR4.MCE set during kexec for TDX guest Message-ID: References: <20240325103911.2651793-1-kirill.shutemov@linux.intel.com> <20240325103911.2651793-6-kirill.shutemov@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Mar 29, 2024 at 11:21:32PM +0800, Xiaoyao Li wrote: > On 3/25/2024 6:38 PM, Kirill A. Shutemov wrote: > > TDX guests are not allowed to clear CR4.MCE. Attempt to clear it leads > > to #VE. > > Will we consider making it more safe and compatible for future to guard > against X86_FEATURE_MCE as well? > > If in the future, MCE becomes configurable for TD guest, then CR4.MCE might > not be fixed1. Good point. I guess we can leave it clear if it was clear. This should be easy enough. But we might want to clear even if was set if clearing is allowed. It would require some kind of indication that clearing MCE is fine. We don't have such indication yet. Not sure we can reasonably future-proof the code at this point. But let me think more. -- Kiryl Shutsemau / Kirill A. Shutemov