[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230607103910.407779-1-kai.huang@intel.com>
Date: Wed, 7 Jun 2023 22:39:10 +1200
From: Kai Huang <kai.huang@...el.com>
To: linux-kernel@...r.kernel.org
Cc: dave.hansen@...ux.intel.com, kirill.shutemov@...ux.intel.com,
peterz@...radead.org, hpa@...or.com, konrad.wilk@...cle.com,
rostedt@...dmis.org, jpoimboe@...nel.org,
Kai Huang <kai.huang@...el.com>
Subject: [PATCH] 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.
Signed-off-by: Kai Huang <kai.huang@...el.com>
---
arch/x86/kernel/relocate_kernel_64.S | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S
index 56cab1bb25f5..97deae3c5e6c 100644
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -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
--
2.40.1
Powered by blists - more mailing lists