From nobody Thu Dec 18 09:42:57 2025 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 476A121C184 for ; Thu, 5 Dec 2024 15:34:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733412842; cv=none; b=baLguykYWVtV11qC4+avN+laC75KOYThtYlwTMkSKttLRCQWOju1Q6sg2hGgVk32u2ZgaB8YZh3zYRtvjBsqRwMndSLUxt2dLdW/T2pBvJi116AnaAwTEC89Vm9RjEYzWppm+RIMEkvC5YHEIO+FxSrxODTTK4AedqG33/w2XGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733412842; c=relaxed/simple; bh=0IXqucUxMBmTpYcXB8raPtO79+38AarfDo7A5uJ9hsA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QThbJcF5yN3S7BWqA9l5ZUeWazPmcRtqjyNgo8kAd8CHcVkkROPiOAu3zam0pNMDifCLpSVbvCUfNARz0xWmfS1ywpUO8OALOugbWPxlybc7N6hJ+oX8/4zybLiVHrjvsZ0pxYt9ljPQu4dLGHbdhWecA+x/jrQLmIOq9nHsTtI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=desiato.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=OvlLIdO8; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=desiato.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="OvlLIdO8" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=fLZisNRVnIE7XYTDFZ5u5GD/dt85ViU8LD82f5fJODE=; b=OvlLIdO8MBFyua0hQFVP1IO5U7 qk0EDfwd3osFg6IKBJsWAY6j5tbZPgIv7ULvPs0O8CkLX3YWLfpA70Ms64PpUy7/QPKi6mrzYJMGe YZ9BJ3cSdkfhosq98d9UkIlkjgl+i5HUkJapeZLIHjeiilC62WC7JQ38PqXdEszVw3HwJwy8WTxfu nwKZVnIh/b8mtH4jhUdiminVutNo8zMSwD/feY6RmaknURT4wxUvpRfZ+IsGg0sjvfm64okv+5IiP wZfOLuq3ep7eUPx9yKcBcaty2kR+ja8LSgJKZjQncuXLJptGeKV/pip7Hy3XN430c/kbmdCUCUjVx WdAl6M5A==; Received: from [2001:8b0:10b:1::ebe] (helo=i7.infradead.org) by desiato.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tJDrN-00000002wEt-359S; Thu, 05 Dec 2024 15:33:46 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tJDrN-0000000DyLG-1Gvs; Thu, 05 Dec 2024 15:33:45 +0000 From: David Woodhouse To: kexec@lists.infradead.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , David Woodhouse , "Kirill A. Shutemov" , Kai Huang , Nikolay Borisov , linux-kernel@vger.kernel.org, Simon Horman , Dave Young , Peter Zijlstra , jpoimboe@kernel.org, bsz@amazon.de Subject: [PATCH v5 03/20] x86/kexec: Use named labels in swap_pages in relocate_kernel_64.S Date: Thu, 5 Dec 2024 15:05:09 +0000 Message-ID: <20241205153343.3275139-4-dwmw2@infradead.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241205153343.3275139-1-dwmw2@infradead.org> References: <20241205153343.3275139-1-dwmw2@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by desiato.infradead.org. See http://www.infradead.org/rpr.html Content-Type: text/plain; charset="utf-8" From: David Woodhouse Make the code a little more readable. Signed-off-by: David Woodhouse Acked-by: Kai Huang --- arch/x86/kernel/relocate_kernel_64.S | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocat= e_kernel_64.S index 92478e2e254f..fea650f92606 100644 --- a/arch/x86/kernel/relocate_kernel_64.S +++ b/arch/x86/kernel/relocate_kernel_64.S @@ -279,31 +279,31 @@ SYM_CODE_START_LOCAL_NOALIGN(swap_pages) movq %rdi, %rcx /* Put the indirection_page in %rcx */ xorl %edi, %edi xorl %esi, %esi - jmp 1f + jmp .Lstart /* Should start with an indirection record */ =20 -0: /* top, read another word for the indirection page */ +.Lloop: /* top, read another word for the indirection page */ =20 movq (%rbx), %rcx addq $8, %rbx -1: +.Lstart: testb $0x1, %cl /* is it a destination page? */ - jz 2f + jz .Lnotdest movq %rcx, %rdi andq $0xfffffffffffff000, %rdi - jmp 0b -2: + jmp .Lloop +.Lnotdest: testb $0x2, %cl /* is it an indirection page? */ - jz 2f + jz .Lnotind movq %rcx, %rbx andq $0xfffffffffffff000, %rbx - jmp 0b -2: + jmp .Lloop +.Lnotind: testb $0x4, %cl /* is it the done indicator? */ - jz 2f - jmp 3f -2: + jz .Lnotdone + jmp .Ldone +.Lnotdone: testb $0x8, %cl /* is it the source indicator? */ - jz 0b /* Ignore it otherwise */ + jz .Lloop /* Ignore it otherwise */ movq %rcx, %rsi /* For ever source page do a copy */ andq $0xfffffffffffff000, %rsi =20 @@ -328,8 +328,8 @@ SYM_CODE_START_LOCAL_NOALIGN(swap_pages) rep ; movsq =20 lea PAGE_SIZE(%rax), %rsi - jmp 0b -3: + jmp .Lloop +.Ldone: ANNOTATE_UNRET_SAFE ret int3 --=20 2.47.0