]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/kexec: Fix a comment of swap_pages() assembly
authorKai Huang <kai.huang@intel.com>
Sun, 25 Aug 2024 08:18:05 +0000 (20:18 +1200)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 25 Aug 2024 12:29:39 +0000 (14:29 +0200)
When relocate_kernel() gets called, %rdi holds 'indirection_page' and
%rsi holds 'page_list'.  And %rdi always holds 'indirection_page' when
swap_pages() is called.

Therefore the comment of the first line code of swap_pages()

movq    %rdi, %rcx      /* Put the page_list in %rcx */

.. isn't correct because it actually moves the 'indirection_page' to
the %rcx.  Fix it.

Signed-off-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Link: https://lore.kernel.org/all/adafdfb1421c88efce04420fc9a996c0e2ca1b34.1724573384.git.kai.huang@intel.com
arch/x86/kernel/relocate_kernel_64.S

index 042c9a0334e94b87d4877b6a1c4a2d139c18c21d..f7a3ca3dee5386a5995224fe1e9131b0b7407b3d 100644 (file)
@@ -258,7 +258,7 @@ SYM_CODE_END(virtual_mapped)
        /* Do the copies */
 SYM_CODE_START_LOCAL_NOALIGN(swap_pages)
        UNWIND_HINT_END_OF_STACK
-       movq    %rdi, %rcx      /* Put the page_list in %rcx */
+       movq    %rdi, %rcx      /* Put the indirection_page in %rcx */
        xorl    %edi, %edi
        xorl    %esi, %esi
        jmp     1f