x86/kexec: Add a comment to relocate_kernel() for better readability
PATCH 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.
--- arch/x86/kernel/relocate_kernel_64.S | 4 ++++ 1 file changed, 4 insertions(+)
arch/x86/kernel/relocate_kernel_64.S +4 -0
@@ -169,6 +169,10 @@ 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
Quoted 14 lines · Kai Huang
The reason to save %rcx to %r11 before calling
swap_pagesisn't that obvious w/o looking into theswap_pagesitself. Add a comment to improve the readability.Signed-off-by Kai Huang <[email protected]>--- arch/x86/kernel/relocate_kernel_64.S | 4 ++++ 1 file changed, 4 insertions(+)arch/x86/kernel/relocate_kernel_64.S +0
-0
arch/x86/kernel/relocate_kernel_64.S SYM_CODE_START_LOCAL_NOALIGN(identity_mapped) · line 175
Quoted 7 lines
arch/x86/kernel/relocate_kernel_64.S +4
-0@@ -169,6 +169,10 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped) wbinvd 1: + /* + * Save the preserve_context to %r11 as + * swap_pages clobbers %rcx. + */
Line split is not needed. It fits nicely under 80-characters.
+ /* Save the preserve_context to %r11 as swap_pages clobbers %rcx. */
Otherwise, LGTM.
Quoted 8 lines
arch/x86/kernel/relocate_kernel_64.S +0
-0movq %rcx, %r11 call swap_pagesbase-commit:
409bf2895d71bb68bc5b8589036e5ed1ca30badaSignature · 1 line
2.40.1
Signature · 1 line
Kiryl Shutsemau / Kirill A. Shutemov
Quoted 27 lines · On Wed, 2023-06-07 at 14:19 +0300, [email protected] wrote:
Quoted 14 lines · Kai Huang
The reason to save %rcx to %r11 before calling
swap_pagesisn't that obvious w/o looking into theswap_pagesitself. Add a comment to improve the readability.Signed-off-by Kai Huang <[email protected]>--- arch/x86/kernel/relocate_kernel_64.S | 4 ++++ 1 file changed, 4 insertions(+)arch/x86/kernel/relocate_kernel_64.S +0
-0arch/x86/kernel/relocate_kernel_64.S SYM_CODE_START_LOCAL_NOALIGN(identity_mapped) · line 175
Quoted 7 lines
arch/x86/kernel/relocate_kernel_64.S +4
-0@@ -169,6 +169,10 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped) wbinvd 1: + /* + * Save the preserve_context to %r11 as + * swap_pages clobbers %rcx. + */Line split is not needed. It fits nicely under 80-characters.
(quoted diff) +1
-0+ /* Save the preserve_context to %r11 as swap_pages clobbers %rcx. */
Quoted 1 line
Otherwise, LGTM.
Sure. Will do.
With above change, may I add your Acked-by ? :)
Quoted 10 lines
Quoted 9 lines
arch/x86/kernel/relocate_kernel_64.S +0
-0movq %rcx, %r11 call swap_pagesbase-commit:
409bf2895d71bb68bc5b8589036e5ed1ca30badaSignature · 1 line
2.40.1
Quoted 26 lines · Kai
Quoted 25 lines · On Wed, 2023-06-07 at 14:19 +0300, [email protected] wrote:
Quoted 14 lines · Kai Huang
The reason to save %rcx to %r11 before calling
swap_pagesisn't that obvious w/o looking into theswap_pagesitself. Add a comment to improve the readability.Signed-off-by Kai Huang <[email protected]>--- arch/x86/kernel/relocate_kernel_64.S | 4 ++++ 1 file changed, 4 insertions(+)arch/x86/kernel/relocate_kernel_64.S +0
-0arch/x86/kernel/relocate_kernel_64.S SYM_CODE_START_LOCAL_NOALIGN(identity_mapped) · line 175
Quoted 7 lines
arch/x86/kernel/relocate_kernel_64.S +4
-0@@ -169,6 +169,10 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped) wbinvd 1: + /* + * Save the preserve_context to %r11 as + * swap_pages clobbers %rcx. + */Line split is not needed. It fits nicely under 80-characters.
Quoted 7 lines
Quoted 3 lines
(quoted diff) +1
-0+ /* Save the preserve_context to %r11 as swap_pages clobbers %rcx. */Otherwise, LGTM.
Sure. Will do.
With above change, may I add your Acked-by ? :)
Sure.
Signature · 1 line
Kiryl Shutsemau / Kirill A. Shutemov