From: kernel test robot <lkp@intel.com>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [intel-tdx:guest-kexec 1/2] arch/x86/kernel/relocate_kernel_64.S:151: Error: too many positional arguments
Date: Wed, 28 Jun 2023 09:49:13 +0800 [thread overview]
Message-ID: <202306280926.g6GuOctj-lkp@intel.com> (raw)
tree: https://github.com/intel/tdx.git guest-kexec
head: ac18652a4806023b0986b468dc9061c640383279
commit: 0dc7dad5e4c5ab94e4429d16272f65de6307c5c0 [1/2] x86/kexec: Keep CR4.MCE during kexec for TDX guest
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20230628/202306280926.g6GuOctj-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230628/202306280926.g6GuOctj-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306280926.g6GuOctj-lkp@intel.com/
All errors (new ones prefixed by >>):
arch/x86/kernel/relocate_kernel_64.S: Assembler messages:
>> arch/x86/kernel/relocate_kernel_64.S:151: Error: too many positional arguments
vim +151 arch/x86/kernel/relocate_kernel_64.S
114
115 SYM_CODE_START_LOCAL_NOALIGN(identity_mapped)
116 UNWIND_HINT_END_OF_STACK
117 /* set return address to 0 if not preserving context */
118 pushq $0
119 /* store the start address on the stack */
120 pushq %rdx
121
122 /*
123 * Clear X86_CR4_CET (if it was set) such that we can clear CR0_WP
124 * below.
125 */
126 movq %cr4, %rax
127 andq $~(X86_CR4_CET), %rax
128 movq %rax, %cr4
129
130 /*
131 * Set cr0 to a known state:
132 * - Paging enabled
133 * - Alignment check disabled
134 * - Write protect disabled
135 * - No task switch
136 * - Don't do FP software emulation.
137 * - Protected mode enabled
138 */
139 movq %cr0, %rax
140 andq $~(X86_CR0_AM | X86_CR0_WP | X86_CR0_TS | X86_CR0_EM), %rax
141 orl $(X86_CR0_PG | X86_CR0_PE), %eax
142 movq %rax, %cr0
143
144 /*
145 * Set cr4 to a known state:
146 * - physical address extension enabled
147 * - 5-level paging, if it was enabled before
148 * - Machine check exception on TDX guest. Clearing MCE is not allowed
149 * in TDX guests.
150 */
> 151 ALTERNATIVE "movl "$X86_CR4_PAE", %eax", \
152 "movl "$(X86_CR4_PAE | X86_CR4_MCE)", %eax", X86_FEATURE_TDX_GUEST
153 testq $X86_CR4_LA57, %r13
154 jz 1f
155 orl $X86_CR4_LA57, %eax
156 1:
157 movq %rax, %cr4
158
159 jmp 1f
160 1:
161
162 /* Flush the TLB (needed?) */
163 movq %r9, %cr3
164
165 /*
166 * If SME is active, there could be old encrypted cache line
167 * entries that will conflict with the now unencrypted memory
168 * used by kexec. Flush the caches before copying the kernel.
169 */
170 testq %r12, %r12
171 jz 1f
172 wbinvd
173 1:
174
175 movq %rcx, %r11
176 call swap_pages
177
178 /*
179 * To be certain of avoiding problems with self-modifying code
180 * I need to execute a serializing instruction here.
181 * So I flush the TLB by reloading %cr3 here, it's handy,
182 * and not processor dependent.
183 */
184 movq %cr3, %rax
185 movq %rax, %cr3
186
187 /*
188 * set all of the registers to known values
189 * leave %rsp alone
190 */
191
192 testq %r11, %r11
193 jnz 1f
194 xorl %eax, %eax
195 xorl %ebx, %ebx
196 xorl %ecx, %ecx
197 xorl %edx, %edx
198 xorl %esi, %esi
199 xorl %edi, %edi
200 xorl %ebp, %ebp
201 xorl %r8d, %r8d
202 xorl %r9d, %r9d
203 xorl %r10d, %r10d
204 xorl %r11d, %r11d
205 xorl %r12d, %r12d
206 xorl %r13d, %r13d
207 xorl %r14d, %r14d
208 xorl %r15d, %r15d
209
210 ANNOTATE_UNRET_SAFE
211 ret
212 int3
213
214 1:
215 popq %rdx
216 leaq PAGE_SIZE(%r10), %rsp
217 ANNOTATE_RETPOLINE_SAFE
218 call *%rdx
219
220 /* get the re-entry point of the peer system */
221 movq 0(%rsp), %rbp
222 leaq relocate_kernel(%rip), %r8
223 movq CP_PA_SWAP_PAGE(%r8), %r10
224 movq CP_PA_BACKUP_PAGES_MAP(%r8), %rdi
225 movq CP_PA_TABLE_PAGE(%r8), %rax
226 movq %rax, %cr3
227 lea PAGE_SIZE(%r8), %rsp
228 call swap_pages
229 movq $virtual_mapped, %rax
230 pushq %rax
231 ANNOTATE_UNRET_SAFE
232 ret
233 int3
234 SYM_CODE_END(identity_mapped)
235
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2023-06-28 1:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 1:49 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-06-28 1:38 [intel-tdx:guest-kexec 1/2] arch/x86/kernel/relocate_kernel_64.S:151: Error: too many positional arguments kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202306280926.g6GuOctj-lkp@intel.com \
--to=lkp@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.