Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1281642lqj; Mon, 3 Jun 2024 16:47:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXmyY/PLYBQZidDvHCyJ4cPWN3xy7pfQxSB0T6Xy1NHp9Os4jy5LY9J51FTdfkFDXlJb4nEgkvBaevX1IMq8tszpafAkTfs/rHCr8qo5Q== X-Google-Smtp-Source: AGHT+IFGp5lch6Ypy+30UaNOpisCF1VMP4eboqToSeguPEEDdCI7edu6n9/jW8OMxixVv6LmQygM X-Received: by 2002:a17:902:d2c9:b0:1f3:620:c92 with SMTP id d9443c01a7336-1f6936ab7ebmr16284255ad.7.1717458475912; Mon, 03 Jun 2024 16:47:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717458475; cv=pass; d=google.com; s=arc-20160816; b=I2UhjpFiJCUAJ32HxJyGO6TgEFUKfVlBSE3b75BklPjjacNNh/ICgtKik9yh84hUE8 vMym1oG6CXK0/rpA+nAW9IdrhcbeKxFi/odl54VvwxdC6RYfnF+jB3J8qluSSgGCR+WS Wr0ZGD6rZ23J+IwC5bXICL+zDts5ZFeMLy9Y2vQ6mdEBq9JaBLwkRMTDO5xSwNkeSVHY tIVy/glCcAVsCPjweedKmenGoPlrdNbKek4WE3PNq7lzex70Irq5yQJoBgd5lcg5VkxV gUdg6Cpues+hlcEmueQSS+67LC34TR7NwUGfggXziikcQ4dD4+23XX7XTODN5dbDJpuT KJkw== 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=wuD6WLaEWhP4n3Qasi9wvzUCa2upP1PV62NIREW0BKw=; fh=1KzsxvQ9xT2ekUUAlY3Qu9u+cP1ICA3yRGr3KDK7qow=; b=wCcVoG4RsDmbaCewQaca6/OG5y99L9QCh2dX4623k+wXNnr0mcWozk2W8tXfZU70gB BB5ulnlReOrGj94CR9ir14GkfW41e3abV+baGY15raAJ5iJwRFdxknWXfv0qG9FjlgbJ T067E1gCi1uSgoX/KTjup9PNhuLL4EodU4eoZcCdCAVDmg61wPyAQn6rY8ayK0eBqs/k 9w5oqx/ZOQYDEzOvPsexIBSsFQzxQsTus8755ocNpWU6Z6l5Vh7X7d1wtgk/dd5rXFqG Qv13Qhc9GWalPSQzUKN5YLQb6JddODWc+SWtjegV+QJGGkGuTXSb7M1GG1oDX3tpVmcv Zffw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zytor.com header.s=2024051501 header.b=FBToC2O4; 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-199846-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199846-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.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 d9443c01a7336-1f679556c05si2294825ad.414.2024.06.03.16.47.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 16:47:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199846-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=@zytor.com header.s=2024051501 header.b=FBToC2O4; 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-199846-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199846-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 89245288E7C for ; Mon, 3 Jun 2024 23:47:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1942413D283; Mon, 3 Jun 2024 23:47:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="FBToC2O4" Received: from mail.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 C71A113D25F; Mon, 3 Jun 2024 23:47:36 +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=1717458458; cv=none; b=rbY7A4uBLJdWJOwZgWUns1kCVblq83oYpyhGfbuhjjreK0BWVg/relnz0blER7nCOo5VcuO60rfggZBf+0F+S9PMq/kGhKiPSzjxqLZDFxb47WuaMWAXjVN2Fq0ZjaspYisQsp09g+KkmMHHzFrGLoWEhxArl8gBgHyy97OL38g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717458458; c=relaxed/simple; bh=kSZeBvRXuEwaL+IlHMDX4WGJNsrJcRdd9a4wOhfLKfY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Mn6t3e+4u6cATNJyZcJgWEL6l4x+CTQ6eyF4jSpLV9Wg62C6hWhC5+SoigDNxvYYBtJcFJsqzYtiBoyh6vtaogrv2J1VfPImVjVBFQCFpNJu+uIiw92VO9o2oE4ssbMR7UKm6HJtnBDwaPjCGBeZ43lgsozNRUD6kQHk5B6BgDE= 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=FBToC2O4; 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:2607:fb90:3707:40b:a32e:4449:b3a:891d] ([IPv6:2607:fb90:3707:40b:a32e:4449:b3a:891d]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 453MhgU5475578 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Mon, 3 Jun 2024 15:43:42 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 453MhgU5475578 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2024051501; t=1717454626; bh=wuD6WLaEWhP4n3Qasi9wvzUCa2upP1PV62NIREW0BKw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=FBToC2O4KGQk197cIv7t84JmESw/VZTY3yCo3LqaSIXdLNAqfkAdoAN+wohABjwpV GG8YdHXGo0U45ht4clybrH6eJ/AiZIL2nz1YNbWGmte1xbtzL3wkn7penFxvDyij1J w1sPlUp39rOPmBXa3KDRfbxxVxioSumuNPHXOXJoU60YnM/WXbT8vWyCloinAqoZ+E lAArupSy4TdrTTju+IaHtBBQsQHt8qzCikfK/2TAoD86qTyqGlwTzhL4m2ipVvPsk+ mp0olUR+8EO4Z6RjUV5pc3lZiwOYm3IvGz1v+NNFEsPXVh1CpFmDZisWBu3BX+ytNL s7upucbc1rdrQ== Message-ID: <2b661d91-badc-4c90-9a9a-fe82635cf514@zytor.com> Date: Mon, 3 Jun 2024 15:43:41 -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: Nikolay Borisov , "Kirill A. Shutemov" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: "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: <1e1d1aea-7346-4022-9f5f-402d171adfda@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/29/24 03:47, Nikolay Borisov wrote: >> >> 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 >>       jmp 1f > Sorry if this is a duplicate; something strange happened with my email. If you are cleaning up this code anyway... this whole piece of code can be simplified to: and $(X86_CR4_PAE | X86_CR4_LA57), %r13d mov %r13, %cr4 The PAE bit in %r13 is guaranteed to be set, and %r13 is dead after this. -hpa