]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
x86/kexec: Use named labels in swap_pages in relocate_kernel_64.S
authorDavid Woodhouse <dwmw@amazon.co.uk>
Sat, 2 Nov 2024 22:45:36 +0000 (22:45 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 5 Nov 2024 20:21:01 +0000 (20:21 +0000)
Make the code a little more readable.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Acked-by: Kai Huang <kai.huang@intel.com>
arch/x86/kernel/relocate_kernel_64.S

index 7ee32bcb6e01d4b9d7717ea6699dfc559c5bb6c9..ca01e3e2f097cb373bdc002ccd742ab13e0f05da 100644 (file)
@@ -272,31 +272,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 */
 
-0:     /* top, read another word for the indirection page */
+.Lloop:        /* top, read another word for the indirection page */
 
        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
 
@@ -321,8 +321,8 @@ SYM_CODE_START_LOCAL_NOALIGN(swap_pages)
        rep ; movsq
 
        lea     PAGE_SIZE(%rax), %rsi
-       jmp     0b
-3:
+       jmp     .Lloop
+.Ldone:
        ANNOTATE_UNRET_SAFE
        ret
        int3