Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1300330lqj; Mon, 3 Jun 2024 17:45:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/8H4zRxQWmJowIYg0N7t0M6h56I5uhH525LU1/4QThglMtoyC+56erHcpRIrvrnxdMJ5WrpXN3Yj6JCzYhQPqU4SGWw1l80EtkEn2ZA== X-Google-Smtp-Source: AGHT+IHvtKGNwiKeW9u1Vf7FvfH3pmumM6sNQhJWr1JqbbthCUO9IUrQ+Z7o7o/XnSEc0C4zbImn X-Received: by 2002:a2e:7d19:0:b0:2ea:75c5:69cb with SMTP id 38308e7fff4ca-2ea9510daa9mr58187451fa.27.1717461920176; Mon, 03 Jun 2024 17:45:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717461920; cv=pass; d=google.com; s=arc-20160816; b=neD+ZqMiPZC6opPJvLlSn/Iu/Qo4/DsPosrVloWWDl9BorTUKxpNKHjM7eGQayPbpp yJVPM1I6NosGB+La5x3HEN5SkyqSa+DQKg1mqAIG8C+iH892ITtxcaz8Pp+NGuCxv5n2 zFZIbVY3cJMhSozfGKbJQor1AyKj7ffXLJZhy3iK9Fk7hcRyc/f6cR5wH2GWWJT9Zaj+ T1tuXqG1/hZWevbxhpx/CCBhkGDCI/W8ec5h74L8+k8Xjg0ja5HfcZ4GV7WVw66jlicn 3sAjReFSJJp1DizmheFOfFENDZHPLkBaiIn8U5uvze14NmkAIZvCuaPlSSa36fX9Ovf8 0EWA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-filter; bh=hPNX3NSLHYNb2TcI1l7fuFsWwNCcNc5ytF4+K+xW86o=; fh=Z/rW67TNx3+0fAmc6s73Og0w+oiJT2BKmGntTtpK8LE=; b=IBbYRGjk7dRVAMdjhAR3w/VDp8x/UipYq0XQ5xNCP0WF/ujs2x97MJwk0xD7jQZENg X90TK0ZMAG/XMSQUDccP98spg4aEGUP9Bc+cKSlzwdQTHenTVWXoIsvSR1h3Gs4jYN1+ isLdvq7RGSS+0eP/1qzb2+N2Svim3+9rYUCQXcDsgpnG+b07VYj1jnnW6qxW3jxVSo6Z F0iMf0iW8nAHkZWJlu1pq76J7OmrY3VOi3i/ZAkuj6b/OimElpTI45seQ3B7QayPoMIc vdwTjlsTdUfQL/GSLkltdBdJJ3mWO8WlDARmcb4ONWUamcRKE88bZmS4xj4wunmLqA4k edfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zytor.com header.s=2024051501 header.b=IcBtkMGI; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-199876-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199876-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31c67d5bsi4427323a12.292.2024.06.03.17.45.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 17:45:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199876-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=@zytor.com header.s=2024051501 header.b=IcBtkMGI; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-199876-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199876-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.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 DBA991F23C99 for ; Tue, 4 Jun 2024 00:45:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 523A86FD3; Tue, 4 Jun 2024 00:45:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="IcBtkMGI" Received: from terminus.zytor.com (terminus.zytor.com [198.137.202.136]) (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 20160399; Tue, 4 Jun 2024 00:45:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717461910; cv=none; b=jcLSdkocjdnAFsiiFOKLg8ZACdJAiORboQTib3EH0WNoQlKTpc8a5VCoE84WWGhCi84V9qvmTolBsvuT3UMvHl2n+1OTh2GLq2oL+YS9xwWYdw2zbZiyfVUJBLobFWQ/Q88GHysrhdOpL/phHQYU5xtSKEoZL3uJBCq849ba+GM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717461910; c=relaxed/simple; bh=7mlxyKX/tSYlAa4UsecWzVPrQObeMubwDYBXeApQ3Po=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EhI2csFK/VT1uyqj+FIGQO/tuPaZz2FvUvenxGnZCGjzihLxJ4h7bgS8x+3UIR6DO5wyxT57ik+Pgfp19YH+dply3sEqlpaqFqrkIKxK+Gpv0S6XGMWeTYk6lWWJhmoL0oT7VViF2hss03NwE7NWd8X8BJxECIkH3x22nILj2vw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=IcBtkMGI; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Received: from [IPV6:2601:646:8002:4641:eb14:ad94:2806:1c1a] ([IPv6:2601:646:8002:4641:eb14:ad94:2806:1c1a]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 4540O6GP697624 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Mon, 3 Jun 2024 17:24:06 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 4540O6GP697624 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2024051501; t=1717460652; bh=hPNX3NSLHYNb2TcI1l7fuFsWwNCcNc5ytF4+K+xW86o=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=IcBtkMGIO/Y/xzeu3xUgo0V2bIRkGJWdFYBCuvM7FvQFv4DD5SqW52rOMi1M1NXq0 UbpxLqPThJOMWS5OGoH5JDJTneX9Fz4WB6HCAlD3DdwNRoR6DOySE7liMPJ2OoJXwk kN0YOjNf4IHAm/j/fRONallpudtEaMW7a9guw+zMWdMJsw0v5yTE4w+UjP4qPSHwDW +lzLAyxf6BQR+J+gKWA9WL4tVNflr3bNAQgvUQ8ZJY3ET9y22IPwofcNUeVC+3avqJ UFYXxzGbHKtq+nJW3AUi/L4zQrxGWhTvCCXwlR00kYfSxD0xpWVzLtMVCBflrX/zBr fTdcJY72jn6bw== Message-ID: <748d3b70-60b4-44e0-bd81-9117f1ab699d@zytor.com> Date: Mon, 3 Jun 2024 17:24:00 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCHv11 05/19] x86/relocate_kernel: Use named labels for less confusion To: "Kirill A. Shutemov" , Nikolay Borisov 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" , Ard Biesheuvel , Baoquan He , "K. Y. Srinivasan" , Haiyang Zhang , kexec@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-acpi@vger.kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org References: <20240528095522.509667-1-kirill.shutemov@linux.intel.com> <20240528095522.509667-6-kirill.shutemov@linux.intel.com> <1e1d1aea-7346-4022-9f5f-402d171adfda@suse.com> Content-Language: en-US From: "H. Peter Anvin" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Trying one more time; sorry (again) if someone receives this in duplicate. >>> >>> diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S >>> index 56cab1bb25f5..085eef5c3904 100644 >>> --- a/arch/x86/kernel/relocate_kernel_64.S >>> +++ b/arch/x86/kernel/relocate_kernel_64.S >>> @@ -148,9 +148,10 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped) >>> */ >>> movl $X86_CR4_PAE, %eax >>> testq $X86_CR4_LA57, %r13 >>> - jz 1f >>> + jz .Lno_la57 >>> orl $X86_CR4_LA57, %eax >>> -1: >>> +.Lno_la57: >>> + >>> movq %rax, %cr4 If we are cleaning up this code... the above can simply be: andl $(X86_CR4_PAE | X86_CR4_LA54), %r13 movq %r13, %cr4 %r13 is dead afterwards, and the PAE bit *will* be set in %r13 anyway. -hpa