lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170421141305.25180-10-jslaby@suse.cz>
Date:   Fri, 21 Apr 2017 16:12:46 +0200
From:   Jiri Slaby <jslaby@...e.cz>
To:     mingo@...hat.com
Cc:     tglx@...utronix.de, hpa@...or.com, x86@...nel.org,
        jpoimboe@...hat.com, linux-kernel@...r.kernel.org,
        Jiri Slaby <jslaby@...e.cz>
Subject: [PATCH v3 10/29] x86: assembly, annotate relocate_kernel

Annotate all functions in relocate_kernel by SYM_FUNC_START,
SYM_FUNC_START_LOCAL, and SYM_FUNC_END properly.

We get in return:
  0000   108 FUNC    GLOBAL DEFAULT    1 relocate_kernel
  0070   165 FUNC    LOCAL  DEFAULT    1 identity_mapped
  0120    53 FUNC    LOCAL  DEFAULT    1 virtual_mapped
  0160   127 FUNC    LOCAL  DEFAULT    1 swap_pages

Signed-off-by: Jiri Slaby <jslaby@...e.cz>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: x86@...nel.org
---
 arch/x86/kernel/relocate_kernel_32.S | 13 ++++++++-----
 arch/x86/kernel/relocate_kernel_64.S | 13 ++++++++-----
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/relocate_kernel_32.S b/arch/x86/kernel/relocate_kernel_32.S
index 77630d57e7bf..4f0f80da0454 100644
--- a/arch/x86/kernel/relocate_kernel_32.S
+++ b/arch/x86/kernel/relocate_kernel_32.S
@@ -37,8 +37,7 @@
 #define CP_PA_BACKUP_PAGES_MAP	DATA(0x1c)
 
 	.text
-	.globl relocate_kernel
-relocate_kernel:
+SYM_FUNC_START(relocate_kernel)
 	/* Save the CPU context, used for jumping back */
 
 	pushl	%ebx
@@ -95,8 +94,9 @@ relocate_kernel:
 	addl    $(identity_mapped - relocate_kernel), %eax
 	pushl   %eax
 	ret
+SYM_FUNC_END(relocate_kernel)
 
-identity_mapped:
+SYM_FUNC_START_LOCAL(identity_mapped)
 	/* set return address to 0 if not preserving context */
 	pushl	$0
 	/* store the start address on the stack */
@@ -193,8 +193,9 @@ identity_mapped:
 	addl	$(virtual_mapped - relocate_kernel), %eax
 	pushl	%eax
 	ret
+SYM_FUNC_END(identity_mapped)
 
-virtual_mapped:
+SYM_FUNC_START_LOCAL(virtual_mapped)
 	movl	CR4(%edi), %eax
 	movl	%eax, %cr4
 	movl	CR3(%edi), %eax
@@ -210,9 +211,10 @@ virtual_mapped:
 	popl	%esi
 	popl	%ebx
 	ret
+SYM_FUNC_END(virtual_mapped)
 
 	/* Do the copies */
-swap_pages:
+SYM_FUNC_START_LOCAL(swap_pages)
 	movl	8(%esp), %edx
 	movl	4(%esp), %ecx
 	pushl	%ebp
@@ -272,6 +274,7 @@ swap_pages:
 	popl	%ebx
 	popl	%ebp
 	ret
+SYM_FUNC_END(swap_pages)
 
 	.globl kexec_control_code_size
 .set kexec_control_code_size, . - relocate_kernel
diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S
index 98111b38ebfd..5138b0587816 100644
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -40,8 +40,7 @@
 	.text
 	.align PAGE_SIZE
 	.code64
-	.globl relocate_kernel
-relocate_kernel:
+SYM_FUNC_START(relocate_kernel)
 	/*
 	 * %rdi indirection_page
 	 * %rsi page_list
@@ -98,8 +97,9 @@ relocate_kernel:
 	addq	$(identity_mapped - relocate_kernel), %r8
 	pushq	%r8
 	ret
+SYM_FUNC_END(relocate_kernel)
 
-identity_mapped:
+SYM_FUNC_START_LOCAL(identity_mapped)
 	/* set return address to 0 if not preserving context */
 	pushq	$0
 	/* store the start address on the stack */
@@ -189,8 +189,9 @@ identity_mapped:
 	movq	$virtual_mapped, %rax
 	pushq	%rax
 	ret
+SYM_FUNC_END(identity_mapped)
 
-virtual_mapped:
+SYM_FUNC_START_LOCAL(virtual_mapped)
 	movq	RSP(%r8), %rsp
 	movq	CR4(%r8), %rax
 	movq	%rax, %cr4
@@ -208,9 +209,10 @@ virtual_mapped:
 	popq	%rbp
 	popq	%rbx
 	ret
+SYM_FUNC_END(virtual_mapped)
 
 	/* Do the copies */
-swap_pages:
+SYM_FUNC_START_LOCAL(swap_pages)
 	movq	%rdi, %rcx 	/* Put the page_list in %rcx */
 	xorl	%edi, %edi
 	xorl	%esi, %esi
@@ -263,6 +265,7 @@ swap_pages:
 	jmp	0b
 3:
 	ret
+SYM_FUNC_END(swap_pages)
 
 	.globl kexec_control_code_size
 .set kexec_control_code_size, . - relocate_kernel
-- 
2.12.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ