Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2087761lqa; Tue, 30 Apr 2024 07:55:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWau+GMQLhyVcCnjjIsiK2Jf1zIMbNp6P24XB9k+WczApfL4ODUrzY4x76v78dv6V4m7IN30tA1isJPfaxyutcQAvQ9oX2g3wnDe5bCSw== X-Google-Smtp-Source: AGHT+IGTj/wHQUoltzS626DsM5nsu7w/nJGEiUcG3ejgYeVTztbDY8Y0GY5TDiUVRgOZ2achgMYE X-Received: by 2002:a05:6a21:62f:b0:1ac:efbd:dc46 with SMTP id ll47-20020a056a21062f00b001acefbddc46mr58942pzb.2.1714488902115; Tue, 30 Apr 2024 07:55:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714488902; cv=pass; d=google.com; s=arc-20160816; b=P7tlfMZeAJ6gy98QjP4lvvFThgakYpIQbqHZ6cCPfgJq0sEZoGFb1qxxCiYLkLP0zo aIlgzYoZ7NKErj+5R7vnMfrbYP2ttF282orLpBRUDCPLrpUSpydfVoLx3JmlrYYzXTYg IeyLw/5lJN7s6rIUD0CZWS8OuYqmsfx/UAlAM6Q7mCOaXyGDn1dF4pAtViU+H5GiXZo0 8BvTFsgi/0OHHiVWyr6D6jTZqtS/CVGQEoVmFzIIHfW6t1W6ORQ7uYhCBUJQTQqjhVub YBhUcIcQRQleIy79ucccTB2rkCzsThdEzrT2oLe43+2uCNF+Ad1hyWPkN34ssj58MbgC VHWg== 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=Ha0LjX0J0jUG9gde9CPxdLE46fxAysA7o9hmw6V2XA0=; fh=R9SOWlgrJ+QdgfX2d0yJPLfxnZPHbcfaI5ckDE5G38w=; b=fi2sj1NXdbJWym6axjK1P5vsKJvqrjc0pG87M2Mmw1waRMDmpGFsgSbd0C+FsK6eVS jIFI58RrgwqmuyC+8uvHG0eND6eQJc+f8ob6J3aLHwv5IbVsCkK1DbmG0DKyokWYvY1k 8tjBxkSeIQ13dEC9FI9N8F1h5TnH3bf180bzhvChiikvtgsGdRrMX7A274ccq7PPbrKh kQNvIz/QKrCG58l26A5L7l/lBlWA+aNoKPVmlSgaSiobouIDNObBaaXohRQkjRHvhojW NtwiOLiznT4aMvNcubNpo7T0+SCU8MeyXt0GuGoLGHwIqiAEG3pGXexA6O9YygEflQcz elBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z7HekdCa; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-164197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164197-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y23-20020a056a00181700b006eccebb90bcsi22665040pfa.143.2024.04.30.07.55.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 07:55:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z7HekdCa; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-164197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164197-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5EB4928636C for ; Tue, 30 Apr 2024 14:49:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 14B93152796; Tue, 30 Apr 2024 14:49:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Z7HekdCa" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 DFD5EBE49 for ; Tue, 30 Apr 2024 14:49:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714488556; cv=none; b=eZ2Eyn0+Xbmdm3JzTR9CDnzQc/f+u29zfApuTa4SGBHn9pn8jOYCaiPFKTwFbc0QISMrCFwc1cnTTO4uQhTvF/ER1g4uP0dNdBk8MZ7hzsBdNE13eReTJUdWxuE45YBCMZXMd78ZJsPp++fKXKLdlnYmsWeArnn0Vj8F7kI4GzM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714488556; c=relaxed/simple; bh=D8fOR3tKfUk/VedpB6Kp/qfPdRU/1bC9Ahf877NrOig=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YLdZ5C1lQSJ1Bmzajs3q/sPTShHFfDajYFBU7u82F/NPeIbanPutN8kqBkER/gxggZhfp8XqWA5tCOFevCoF0eeNe+4xkLvLipGMbfGUspGSaeoDpqS+RYjIqanCDuOH/MLKTc7UXavGNybZCY8m5/VRwkoDtPgi7cEf5rfNNv0= 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=Z7HekdCa; arc=none smtp.client-ip=198.175.65.13 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=1714488555; x=1746024555; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=D8fOR3tKfUk/VedpB6Kp/qfPdRU/1bC9Ahf877NrOig=; b=Z7HekdCalqrGaUJTwNqA0r5lCyoLDTsBr9dVSkaRUq/XXKG+iKz+tAD6 8AIf5iVTQCXWGsf2asNLKaulXmulJxv6BMw0Z2SVloaPu9IEwEVJfNVyD maZzRv9gvPHar+BH/Gp+tuG0RDYwhj8mlLA+qMxpWNHIxmscfpvHZAwFu GN4k30yqrcbFYOrmJloXllM7dl3Izqwv/iLs3BLP1q2PWNX/ROUyeNYpe THv91dLgBf642LIpwpuBKLcdJmoBT8mtgS2nffWYe/aVfJeeQuOpoZTWy JM7aY/OuQFP1X8SiD/ZhjpYy0e6u/LWOEDNwhoAKWXjZ+lPtTXHsjWdKt g==; X-CSE-ConnectionGUID: Wl8DFSGDSKybcxBtnI9JaQ== X-CSE-MsgGUID: daf035PhQxGbQtnoTys0mQ== X-IronPort-AV: E=McAfee;i="6600,9927,11060"; a="21350242" X-IronPort-AV: E=Sophos;i="6.07,242,1708416000"; d="scan'208";a="21350242" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2024 07:49:15 -0700 X-CSE-ConnectionGUID: cK5AUJaAQWiWfFZrIJ3DXA== X-CSE-MsgGUID: JhJfI17xS8CacJcZ6ZtrSw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,242,1708416000"; d="scan'208";a="31280904" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 30 Apr 2024 07:49:09 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 4FF831A1; Tue, 30 Apr 2024 17:49:08 +0300 (EEST) Date: Tue, 30 Apr 2024 17:49:08 +0300 From: "Kirill A. Shutemov" To: Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , 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: [PATCHv10 05/18] x86/kexec: Keep CR4.MCE set during kexec for TDX guest Message-ID: References: <20240409113010.465412-1-kirill.shutemov@linux.intel.com> <20240409113010.465412-6-kirill.shutemov@linux.intel.com> <20240430130323.GAZjDsG00Xdhv5mv8W@fat_crate.local> 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: <20240430130323.GAZjDsG00Xdhv5mv8W@fat_crate.local> On Tue, Apr 30, 2024 at 03:03:23PM +0200, Borislav Petkov wrote: > On Tue, Apr 09, 2024 at 02:29:57PM +0300, Kirill A. Shutemov wrote: > > +1: > > + testq $X86_CR4_MCE, %r13 > > + jz 1f > > + ALTERNATIVE "", __stringify(orl $X86_CR4_MCE, %eax), X86_FEATURE_TDX_GUEST > > 1: > > Please add the below patch to your set. Those same-number labels are > just abominable. > > Thx. > > --- > From: "Borislav Petkov (AMD)" > Date: Tue, 30 Apr 2024 15:00:16 +0200 > Subject: [PATCH] x86/relocate_kernel: Use named labels for less confusion > > That identity_mapped() function was loving that "1" label to the point > of completely confusing its readers. > > Use named labels in each place for clarity. > > No functional changes. > > Signed-off-by: Borislav Petkov (AMD) > --- > arch/x86/kernel/relocate_kernel_64.S | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S > index 8e2037d78a1f..0077c9e562a7 100644 > --- a/arch/x86/kernel/relocate_kernel_64.S > +++ b/arch/x86/kernel/relocate_kernel_64.S > @@ -152,13 +152,15 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped) > */ > movl $X86_CR4_PAE, %eax > testq $X86_CR4_LA57, %r13 > - jz 1f > + jz no_la57 > orl $X86_CR4_LA57, %eax > -1: > +no_la57: I assume all of these new labels have to be prefixed with ".L", right? -- Kiryl Shutsemau / Kirill A. Shutemov