From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161489AbdDUOVE (ORCPT ); Fri, 21 Apr 2017 10:21:04 -0400 Received: from mx2.suse.de ([195.135.220.15]:56059 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1040445AbdDUONM (ORCPT ); Fri, 21 Apr 2017 10:13:12 -0400 From: Jiri Slaby To: mingo@redhat.com Cc: tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, jpoimboe@redhat.com, linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH v3 10/29] x86: assembly, annotate relocate_kernel Date: Fri, 21 Apr 2017 16:12:46 +0200 Message-Id: <20170421141305.25180-10-jslaby@suse.cz> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170421141305.25180-1-jslaby@suse.cz> References: <20170421141305.25180-1-jslaby@suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x86@kernel.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