Skip to contentSkip to conversation

x86/kexec: Add a comment to relocate_kernel() for better readability

PATCH New Kai Huang 1 participant 1 message Jun 12, 2023 x86

lore
Share & tools
lore

Kai Huang

author
#0 lore raw

PATCH v2 1/1 x86/kexec: Add a comment to relocate_kernel() for better readability

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.

---

v1 -> v2:
- Avoided line split in the comment.
- Added Kirill's Acked-by.

v1: https://lore.kernel.org/lkml/[email protected]/T/

---
 arch/x86/kernel/relocate_kernel_64.S | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/relocate_kernel_64.S +1 -0
index 56cab1bb25f5..fea1aed16142 100644
@@ -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

Signature · 1 line
2.40.1