* [PATCH v2] x86/kexec: Add a comment to relocate_kernel() for better readability
@ 2023-06-12 12:34 Kai Huang
0 siblings, 0 replies; only message in thread
From: Kai Huang @ 2023-06-12 12:34 UTC (permalink / raw)
To: linux-kernel
Cc: kirill.shutemov, dave.hansen, bp, tglx, mingo, peterz, hpa, x86,
jpoimboe, rostedt, konrad.wilk, Kai Huang
The reason to save %rcx to %r11 before calling swap_pages isn't that
obvious w/o looking into the swap_pages itself. Add a comment to
improve the readability.
Signed-off-by: Kai Huang <kai.huang@intel.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
v1 -> v2:
- Avoided line split in the comment.
- Added Kirill's Acked-by.
v1: https://lore.kernel.org/lkml/538335b164bf8b84b8a55c5654ed15d849479388.camel@intel.com/T/
---
arch/x86/kernel/relocate_kernel_64.S | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S
index 56cab1bb25f5..fea1aed16142 100644
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -169,6 +169,7 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped)
wbinvd
1:
+ /* Save the preserve_context to %r11 as swap_pages clobbers %rcx */
movq %rcx, %r11
call swap_pages
base-commit: 409bf2895d71bb68bc5b8589036e5ed1ca30bada
--
2.40.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-12 12:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 12:34 [PATCH v2] x86/kexec: Add a comment to relocate_kernel() for better readability Kai Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®