Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp543902lqb; Wed, 29 May 2024 03:48:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXsFZE+hknBIRVu9aTEV2lIKRtetnNM/Y9VkfV6NiTt4X/lI+OsBRDIS7bCwZdR6UKQoqYvjH6AJn9kVTM7B3uK2nkv9/egpJOZAgD+rw== X-Google-Smtp-Source: AGHT+IGIbNHkqZ3IbcYXvgsWdFP/Uv4ONfFfpmPBoWD/J2Rap61XA/y7BMyIUWjQn4OGAvVhtDY1 X-Received: by 2002:a17:906:b083:b0:a5a:1b57:426f with SMTP id a640c23a62f3a-a62641c4347mr1047243666b.13.1716979712335; Wed, 29 May 2024 03:48:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716979712; cv=pass; d=google.com; s=arc-20160816; b=ZtTA0ji8GVRfcNv6NJwNn6Q+HZi9GcSKLrMhcAgjccb0+ZSWaRFf7DcFuRSHv+aZSf Q+1qAYvG+zbXPTKeOoBuqgDbaV7Fw4jqbFWso8gumHlzWCipfIJ0T/G5RGzDNiQKiFpl vAbYygJA58IN46XPiWFbfEYXi73LmlLw9mbWW0a3vDqaGJjiEMmdW3aX3a8xcWPxTfe7 9x/MfvPUTnGhn9pkmAQ8GH0klaP0EopmK/r2FldQor9aDstSAbX9cgqkls0H1fiWoo07 ETh3dM+N7W1Wbb1T/EEc1KdjFQaXA3rMOZX6HEQ0D0BpHSKz1b15VeIQXZOoyKOdpDsM spfQ== 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; bh=KwTOdZ/RFlQPDVFnmQ6lMLq54IcHFFkkOCYIgsO+Y4g=; fh=uaBRGAIhqrbJID3rhV4zQ7ipQJQBXSdMyezWcC9AqAY=; b=Bh01gdRMVTug6nbacv3ORGicOLA7FFKcYKt4+HF3AYwGwru/p/hbxQdT0K74UMNW3y ZJ6hoiU6WAPLdRnfxtB3QU3TJGjlxekHhyvzS/Z5b4A63o+xYqgQyg7ZzL9WMKUh9pka ZraaSFVWZOlEWN20W/cxFEeYoQo94VczWqfeQVhQhZCOxeVjtRz3UjsZkSZtVeenDQcO hEDhNcJPewSX0FqbKCuYooIG1vt03LZ2qs5uS7/CaiE/+usLiaj68x+kh2/zpwySzj9j MGUTH0E3uAxiJmKNt2iJ46iVkCgQcVfzehdzSoG7BDz55IrSfntrvP2SbVNawRtb/rQF whEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=eTwlKTnT; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-193978-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193978-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cd920c2si631351166b.775.2024.05.29.03.48.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 03:48:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193978-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=@suse.com header.s=google header.b=eTwlKTnT; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-193978-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193978-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.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 6188C1F25217 for ; Wed, 29 May 2024 10:48:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37A3817B51D; Wed, 29 May 2024 10:47:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="eTwlKTnT" Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23B6817B404 for ; Wed, 29 May 2024 10:47:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716979678; cv=none; b=Voc0Y1c5KmIfG/JUyRgE6//y858niNaMPS7W+A75eE9sE2N+k4R7g4AgUGpzrDXwQg1p54e1qAL5m6SHG64iiwzFFSB3vvMKH8H/rv3fayqqRPxmfUneQOFWhtWJ6NEUmm+4eDnTjAtqktcfqVVkGVarYDvA37M9WUlQfNqHkcs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716979678; c=relaxed/simple; bh=biTHQy47V8Q8BKCW+K43IFMoQQNOJzPVouRP8f6euts=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TP7LHj9UwEgGLsJxcYtJzJZ3lmasb86wILhSwpAfEmIj2Pt1aD8IXcvmLbwfSfkY0IoXW4F3QQAvFxAME2XdWJ3gXhP8BMS1+OtvNT4MuYLrBVjHl0gF4zoTxKjrAiS3o6JPbdRiW5DisAwWjHJhGGWPDSDq1azq7mpxVAg53e0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=eTwlKTnT; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-52ae38957e8so593381e87.1 for ; Wed, 29 May 2024 03:47:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1716979674; x=1717584474; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KwTOdZ/RFlQPDVFnmQ6lMLq54IcHFFkkOCYIgsO+Y4g=; b=eTwlKTnTia03KZBiVV2TXw2T+4hSXhZc69CR5G14gorixmsuZEiVdngfHDfLrj5usU jdEFeSgzn8UTGnSchaqSO8Uhvlk42h5YJgWbBpngh27kgUhBG1bh7OLrWw09ZyxjTJ94 clDTKAxz4tZLEwvmnap+C+QZ2a6QqdgBo788KhkhReTkp3wRwqAOIuYWyMW4+dFPjhzx jFDAYJEOllu5LL88G4wy9Dd1sy62tZm38rqFFDTBy315Q8TL79F5vweMLd4RyYfdr4Vl 3FgNvOQEqbTsPYcb111ehwKZGMfVXq+7+o7g261HvmpYj7dprjIw5RXmxOWySEQ7cxtE RqrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716979674; x=1717584474; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KwTOdZ/RFlQPDVFnmQ6lMLq54IcHFFkkOCYIgsO+Y4g=; b=Xp+zN31YnhgwT0DCmU7/Zx7NOXnVHqCTIAD/ED/ASQLwpnd78xXDmYfmsn6I9DkSAh XmdqQJXW3hQ+t/uyX/GyTMtyOU9rb7kP9LqvqZpMxW+jrsW4dBY1ePksFxWDRZAIkHiP fNpAUbJndmex5r98vqWfgWoqBoD5esZBQH8FtP+baoZT8zcPTHfosS5EuCCSVCJ7g2/C YOLrlNUBP8VlZKr7SpPCNRV2VHXjmESCt5XmK7nyovD0aerVbxvZZ9AJQtrIxYepZAzz +qE0He97s12nlnYgQ2nu6EqAn75fMhKDd+y7B124YPrDRWlK8YOeCxu6sYapFsB3fcsC D4iA== X-Forwarded-Encrypted: i=1; AJvYcCX7+q1KFNNDDK7YzgE4++39ypRbgNtofhLxQPzy9BhyswIdsZlxktIFxP7EfcgEkG8oVNUVjv3BfLc+lBkIhhZFBNsYqLT6MF7ORO4o X-Gm-Message-State: AOJu0Yzc29IEhdfuKnZ4aYkWoCMqCtKZ/wrxOocb1l/3mQ1wvCi7rX5G A9NCHmKJ/A63HvyfJHjOh6IRqo/Al1fUNDPH0tpYlGjvzTiJetqb5xT44frNblY= X-Received: by 2002:a05:6512:4c4:b0:52a:fdcb:6652 with SMTP id 2adb3069b0e04-52afdcb66efmr721019e87.68.1716979673442; Wed, 29 May 2024 03:47:53 -0700 (PDT) Received: from ?IPV6:2a10:bac0:b000:5de0:ca17:8dd8:7313:d6fd? ([2a10:bac0:b000:5de0:ca17:8dd8:7313:d6fd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42108970b4esm176411645e9.14.2024.05.29.03.47.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 May 2024 03:47:53 -0700 (PDT) Message-ID: <1e1d1aea-7346-4022-9f5f-402d171adfda@suse.com> Date: Wed, 29 May 2024 13:47:50 +0300 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" , 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 , "H. Peter Anvin" , "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> Content-Language: en-US From: Nikolay Borisov In-Reply-To: <20240528095522.509667-6-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 28.05.24 г. 12:55 ч., Kirill A. Shutemov wrote: > From: Borislav Petkov > > That identity_mapped() functions 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) > Signed-off-by: Kirill A. Shutemov > --- > arch/x86/kernel/relocate_kernel_64.S | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > 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 That jmp 1f becomes redundant now as it simply jumps 1 line below. > @@ -165,9 +166,9 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped) > * used by kexec. Flush the caches before copying the kernel. > */ > testq %r12, %r12 > - jz 1f > + jz .Lsme_off > wbinvd > -1: > +.Lsme_off: > > movq %rcx, %r11 > call swap_pages > @@ -187,7 +188,7 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped) > */ > > testq %r11, %r11 > - jnz 1f > + jnz .Lrelocate > xorl %eax, %eax > xorl %ebx, %ebx > xorl %ecx, %ecx > @@ -208,7 +209,7 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped) > ret > int3 > > -1: > +.Lrelocate: > popq %rdx > leaq PAGE_SIZE(%r10), %rsp > ANNOTATE_RETPOLINE_SAFE