Skip to content

Commit

Permalink
x86/relocate_kernel: Use named labels for less confusion
Browse files Browse the repository at this point in the history
That identity_mapped() function was loving that "1" label to the point of
completely confusing its readers.

Use named labels in each place for clarity.

No functional changes.

Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Signed-off-by: Kirill A. Shutemov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
bp3tk0v committed Jun 17, 2024
1 parent 66e48e4 commit 7b46a89
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions arch/x86/kernel/relocate_kernel_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped)
*/
movl $X86_CR4_PAE, %eax
testq $X86_CR4_LA57, %r13
jz 1f
jz .Lno_la57
orl $X86_CR4_LA57, %eax
1:
.Lno_la57:

movq %rax, %cr4

/* Flush the TLB (needed?) */
Expand All @@ -162,9 +163,9 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped)
* used by kexec. Flush the caches before copying the kernel.
*/
testq %r12, %r12
jz 1f
jz .Lsme_off
wbinvd
1:
.Lsme_off:

movq %rcx, %r11
call swap_pages
Expand All @@ -184,7 +185,7 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped)
*/

testq %r11, %r11
jnz 1f
jnz .Lrelocate
xorl %eax, %eax
xorl %ebx, %ebx
xorl %ecx, %ecx
Expand All @@ -205,7 +206,7 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped)
ret
int3

1:
.Lrelocate:
popq %rdx
leaq PAGE_SIZE(%r10), %rsp
ANNOTATE_RETPOLINE_SAFE
Expand Down

0 comments on commit 7b46a89

Please sign in to comment.