From patchwork Mon Mar 20 12:32:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 9633967 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 91C98601E9 for ; Mon, 20 Mar 2017 12:35:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D4942808F for ; Mon, 20 Mar 2017 12:35:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81F1B2843A; Mon, 20 Mar 2017 12:35:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5CD6026E49 for ; Mon, 20 Mar 2017 12:35:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpwUA-00051O-QV; Mon, 20 Mar 2017 12:32:30 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpwUA-00051B-1r for xen-devel@lists.xenproject.org; Mon, 20 Mar 2017 12:32:30 +0000 Received: from [193.109.254.147] by server-9.bemta-6.messagelabs.com id F0/15-14382-DDBCFC85; Mon, 20 Mar 2017 12:32:29 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRWlGSWpSXmKPExsVyuP0Ov+7t0+c jDHZuFbX4vmUykwOjx+EPV1gCGKNYM/OS8isSWDO+b1nOXHArpOL4kXssDYw/PLoYOTkkBIwk 3k78x9TFyMUhJLCQUaL/bA8bSIJNQFGi5ew1JhBbREBE4uDD7WwgRcwC95kkztzqYQVJCAu4S zye08QOYrMIqEp03nwFZvMKGEt0Le1hgtggL7Fo0wwWEJtTwETi5PIJzCC2kECyxLLPN1gmMH IvYGRYxahRnFpUllqka2ykl1SUmZ5RkpuYmaNraGCml5taXJyYnpqTmFSsl5yfu4kR6GEGINj BeHpd4CFGSQ4mJVHez3MPRgjxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4GX7BpQTLEpNT61Iy8wB hhpMWoKDR0mEVxskzVtckJhbnJkOkTrFqMsxZ/buN0xCLHn5ealS4ryqIEUCIEUZpXlwI2Bhf 4lRVkqYlxHoKCGegtSi3MwSVPlXjOIcjErCEJfwZOaVwG16BXQEE9AR0/jAjihJREhJNTC6io UrMJ6aE3bb8cHyLUU7PrR8TJlb/MZ+cWzunZ0fzqY9+LZi1dHnj5lu89b3nJphHXXT8tRd7av v3ff+uH/8kN+0iojtftylHp6tobM+2Aq0yqnVlzhazFT9LbLzzZayzE26R+XZCraccNvHWyV3 NEC1Tq43rHnei2pZ8z7PVPGXX4oKDtcpsRRnJBpqMRcVJwIA+3dBUnYCAAA= X-Env-Sender: jslaby@suse.cz X-Msg-Ref: server-9.tower-27.messagelabs.com!1490013147!92778633!1 X-Originating-IP: [195.135.220.15] X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG, MAILTO_TO_SPAM_ADDR X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 58249 invoked from network); 20 Mar 2017 12:32:27 -0000 Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by server-9.tower-27.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 20 Mar 2017 12:32:27 -0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E1CBCAD34; Mon, 20 Mar 2017 12:32:26 +0000 (UTC) From: Jiri Slaby To: mingo@redhat.com Date: Mon, 20 Mar 2017 13:32:15 +0100 Message-Id: <20170320123222.15453-3-jslaby@suse.cz> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170320123222.15453-1-jslaby@suse.cz> References: <9ea5e137-61f9-dccc-bb9d-ac3ff86e5867@suse.cz> <20170320123222.15453-1-jslaby@suse.cz> Cc: Juergen Gross , hpa@zytor.com, linux-pm@vger.kernel.org, x86@kernel.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Pavel Machek , jpoimboe@redhat.com, xen-devel@lists.xenproject.org, tglx@linutronix.de, Jiri Slaby , Boris Ostrovsky Subject: [Xen-devel] [PATCH v2 03/10] x86: assembly, use SYM_FUNC_END for functions X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Somewhere END was used to end a function, elsewhere, nothing was used. So unify it and mark them all by SYM_FUNC_END. Signed-off-by: Jiri Slaby Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Cc: "Rafael J. Wysocki" Cc: Pavel Machek Cc: Cc: Boris Ostrovsky Cc: Juergen Gross Reviewed-by: Juergen Gross [xen parts] Cc: --- arch/x86/entry/entry_64.S | 40 ++++++++++++++++++------------------ arch/x86/entry/entry_64_compat.S | 5 +++-- arch/x86/kernel/mcount_64.S | 12 ++++++----- arch/x86/power/hibernate_asm_64.S | 2 ++ arch/x86/realmode/rm/reboot.S | 1 + arch/x86/realmode/rm/trampoline_64.S | 4 ++++ arch/x86/realmode/rm/wakeup_asm.S | 1 + arch/x86/xen/xen-asm_64.S | 2 ++ arch/x86/xen/xen-head.S | 2 +- arch/x86/xen/xen-pvh.S | 2 +- 10 files changed, 42 insertions(+), 29 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index d2b2a2948ffe..3e523f8d7e7f 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -324,7 +324,7 @@ syscall_return_via_sysret: opportunistic_sysret_failed: SWAPGS jmp restore_c_regs_and_iret -END(entry_SYSCALL_64) +SYM_FUNC_END(entry_SYSCALL_64) ENTRY(stub_ptregs_64) /* @@ -350,13 +350,13 @@ ENTRY(stub_ptregs_64) 1: jmp *%rax /* Called from C */ -END(stub_ptregs_64) +SYM_FUNC_END(stub_ptregs_64) .macro ptregs_stub func ENTRY(ptregs_\func) leaq \func(%rip), %rax jmp stub_ptregs_64 -END(ptregs_\func) +SYM_FUNC_END(ptregs_\func) .endm /* Instantiate ptregs_stub for each ptregs-using syscall */ @@ -399,7 +399,7 @@ ENTRY(__switch_to_asm) popq %rbp jmp __switch_to -END(__switch_to_asm) +SYM_FUNC_END(__switch_to_asm) /* * A newly forked process directly context switches into this address. @@ -435,7 +435,7 @@ ENTRY(ret_from_fork) */ movq $0, RAX(%rsp) jmp 2b -END(ret_from_fork) +SYM_FUNC_END(ret_from_fork) /* * Build the entry stubs with some assembler magic. @@ -450,7 +450,7 @@ ENTRY(irq_entries_start) jmp common_interrupt .align 8 .endr -END(irq_entries_start) +SYM_FUNC_END(irq_entries_start) /* * Interrupt entry/exit. @@ -652,7 +652,7 @@ native_irq_return_ldt: */ jmp native_irq_return_iret #endif -END(common_interrupt) +SYM_FUNC_END(common_interrupt) /* * APIC interrupts. @@ -664,7 +664,7 @@ ENTRY(\sym) .Lcommon_\sym: interrupt \do_sym jmp ret_from_intr -END(\sym) +SYM_FUNC_END(\sym) .endm #ifdef CONFIG_TRACING @@ -830,7 +830,7 @@ ENTRY(\sym) jmp error_exit /* %ebx: no swapgs flag */ .endif -END(\sym) +SYM_FUNC_END(\sym) .endm #ifdef CONFIG_TRACING @@ -873,7 +873,7 @@ ENTRY(native_load_gs_index) SWAPGS popfq ret -END(native_load_gs_index) +SYM_FUNC_END(native_load_gs_index) EXPORT_SYMBOL(native_load_gs_index) _ASM_EXTABLE(.Lgs_change, bad_gs) @@ -903,7 +903,7 @@ ENTRY(do_softirq_own_stack) leaveq decl PER_CPU_VAR(irq_count) ret -END(do_softirq_own_stack) +SYM_FUNC_END(do_softirq_own_stack) #ifdef CONFIG_XEN idtentry xen_hypervisor_callback xen_do_hypervisor_callback has_error_code=0 @@ -939,7 +939,7 @@ ENTRY(xen_do_hypervisor_callback) /* do_hypervisor_callback(struct *pt_regs) */ call xen_maybe_preempt_hcall #endif jmp error_exit -END(xen_do_hypervisor_callback) +SYM_FUNC_END(xen_do_hypervisor_callback) /* * Hypervisor uses this for application faults while it executes. @@ -985,7 +985,7 @@ ENTRY(xen_failsafe_callback) SAVE_EXTRA_REGS ENCODE_FRAME_POINTER jmp error_exit -END(xen_failsafe_callback) +SYM_FUNC_END(xen_failsafe_callback) apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \ xen_hvm_callback_vector xen_evtchn_do_upcall @@ -1036,7 +1036,7 @@ ENTRY(paranoid_entry) SWAPGS xorl %ebx, %ebx 1: ret -END(paranoid_entry) +SYM_FUNC_END(paranoid_entry) /* * "Paranoid" exit path from exception stack. This is invoked @@ -1065,7 +1065,7 @@ paranoid_exit_restore: RESTORE_C_REGS REMOVE_PT_GPREGS_FROM_STACK 8 INTERRUPT_RETURN -END(paranoid_exit) +SYM_FUNC_END(paranoid_exit) /* * Save all registers in pt_regs, and switch gs if needed. @@ -1147,7 +1147,7 @@ ENTRY(error_entry) mov %rax, %rsp decl %ebx jmp .Lerror_entry_from_usermode_after_swapgs -END(error_entry) +SYM_FUNC_END(error_entry) /* @@ -1161,7 +1161,7 @@ ENTRY(error_exit) testl %ebx, %ebx jnz retint_kernel jmp retint_user -END(error_exit) +SYM_FUNC_END(error_exit) /* Runs on exception stack */ ENTRY(nmi) @@ -1509,12 +1509,12 @@ nmi_restore: * mode, so this cannot result in a fault. */ INTERRUPT_RETURN -END(nmi) +SYM_FUNC_END(nmi) ENTRY(ignore_sysret) mov $-ENOSYS, %eax sysret -END(ignore_sysret) +SYM_FUNC_END(ignore_sysret) ENTRY(rewind_stack_do_exit) /* Prevent any naive code from trying to unwind to our caller. */ @@ -1525,4 +1525,4 @@ ENTRY(rewind_stack_do_exit) call do_exit 1: jmp 1b -END(rewind_stack_do_exit) +SYM_FUNC_END(rewind_stack_do_exit) diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S index 73d7ff0b125c..9239f80e11ce 100644 --- a/arch/x86/entry/entry_64_compat.S +++ b/arch/x86/entry/entry_64_compat.S @@ -262,7 +262,7 @@ sysret32_from_system_call: movq RSP-ORIG_RAX(%rsp), %rsp swapgs sysretl -END(entry_SYSCALL_compat) +SYM_FUNC_END(entry_SYSCALL_compat) /* * 32-bit legacy system call entry. @@ -340,7 +340,7 @@ ENTRY(entry_INT80_compat) TRACE_IRQS_ON SWAPGS jmp restore_regs_and_iret -END(entry_INT80_compat) +SYM_FUNC_END(entry_INT80_compat) SYM_FUNC_START(stub32_clone) /* @@ -352,3 +352,4 @@ SYM_FUNC_START(stub32_clone) */ xchg %r8, %rcx jmp sys_clone +SYM_FUNC_END(stub32_clone) diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S index 2b4d7045e823..f3b0cb57a8c7 100644 --- a/arch/x86/kernel/mcount_64.S +++ b/arch/x86/kernel/mcount_64.S @@ -152,7 +152,7 @@ EXPORT_SYMBOL(mcount) ENTRY(function_hook) retq -END(function_hook) +SYM_FUNC_END(function_hook) ENTRY(ftrace_caller) /* save_mcount_regs fills in first two parameters */ @@ -184,11 +184,12 @@ GLOBAL(ftrace_epilogue) GLOBAL(ftrace_graph_call) jmp ftrace_stub #endif +SYM_FUNC_END(ftrace_caller) /* This is weak to keep gas from relaxing the jumps */ WEAK(ftrace_stub) retq -END(ftrace_caller) +SYM_FUNC_END(ftrace_caller) ENTRY(ftrace_regs_caller) /* Save the current flags before any operations that can change them */ @@ -259,7 +260,7 @@ GLOBAL(ftrace_regs_caller_end) jmp ftrace_epilogue -END(ftrace_regs_caller) +SYM_FUNC_END(ftrace_regs_caller) #else /* ! CONFIG_DYNAMIC_FTRACE */ @@ -295,7 +296,7 @@ trace: restore_mcount_regs jmp fgraph_trace -END(function_hook) +SYM_FUNC_END(function_hook) #endif /* CONFIG_DYNAMIC_FTRACE */ #endif /* CONFIG_FUNCTION_TRACER */ @@ -318,7 +319,7 @@ ENTRY(ftrace_graph_caller) restore_mcount_regs retq -END(ftrace_graph_caller) +SYM_FUNC_END(ftrace_graph_caller) SYM_FUNC_START(return_to_handler) subq $24, %rsp @@ -335,4 +336,5 @@ SYM_FUNC_START(return_to_handler) movq (%rsp), %rax addq $24, %rsp jmp *%rdi +SYM_FUNC_END(return_to_handler) #endif diff --git a/arch/x86/power/hibernate_asm_64.S b/arch/x86/power/hibernate_asm_64.S index ce8da3a0412c..5b6eb95e1b7b 100644 --- a/arch/x86/power/hibernate_asm_64.S +++ b/arch/x86/power/hibernate_asm_64.S @@ -68,6 +68,7 @@ ENTRY(restore_image) /* jump to relocated restore code */ movq relocated_restore_code(%rip), %rcx jmpq *%rcx +SYM_FUNC_END(restore_image) /* code below has been relocated to a safe page */ ENTRY(core_restore_code) @@ -98,6 +99,7 @@ ENTRY(core_restore_code) .Ldone: /* jump to the restore_registers address from the image header */ jmpq *%r8 +SYM_FUNC_END(core_restore_code) /* code below belongs to the image kernel */ .align PAGE_SIZE diff --git a/arch/x86/realmode/rm/reboot.S b/arch/x86/realmode/rm/reboot.S index d66c607bdc58..3dec2ba4adc5 100644 --- a/arch/x86/realmode/rm/reboot.S +++ b/arch/x86/realmode/rm/reboot.S @@ -62,6 +62,7 @@ GLOBAL(machine_real_restart_paging_off) movl %ecx, %gs movl %ecx, %ss ljmpw $8, $1f +SYM_FUNC_END(machine_real_restart_asm) /* * This is 16-bit protected mode code to disable paging and the cache, diff --git a/arch/x86/realmode/rm/trampoline_64.S b/arch/x86/realmode/rm/trampoline_64.S index dac7b20d2f9d..6869f1229c3a 100644 --- a/arch/x86/realmode/rm/trampoline_64.S +++ b/arch/x86/realmode/rm/trampoline_64.S @@ -79,6 +79,8 @@ ENTRY(trampoline_start) no_longmode: hlt jmp no_longmode +SYM_FUNC_END(trampoline_start) + #include "../kernel/verify_cpu.S" .section ".text32","ax" @@ -116,6 +118,7 @@ ENTRY(startup_32) * the new gdt/idt that has __KERNEL_CS with CS.L = 1. */ ljmpl $__KERNEL_CS, $pa_startup_64 +SYM_FUNC_END(startup_32) .section ".text64","ax" .code64 @@ -123,6 +126,7 @@ ENTRY(startup_32) ENTRY(startup_64) # Now jump into the kernel using virtual addresses jmpq *tr_start(%rip) +SYM_FUNC_END(startup_64) .section ".rodata","a" # Duplicate the global descriptor table diff --git a/arch/x86/realmode/rm/wakeup_asm.S b/arch/x86/realmode/rm/wakeup_asm.S index 9e7e14797a72..b5f711327aef 100644 --- a/arch/x86/realmode/rm/wakeup_asm.S +++ b/arch/x86/realmode/rm/wakeup_asm.S @@ -134,6 +134,7 @@ ENTRY(wakeup_start) #else jmp trampoline_start #endif +SYM_FUNC_END(wakeup_start) bogus_real_magic: 1: diff --git a/arch/x86/xen/xen-asm_64.S b/arch/x86/xen/xen-asm_64.S index c3df43141e70..2a968c087269 100644 --- a/arch/x86/xen/xen-asm_64.S +++ b/arch/x86/xen/xen-asm_64.S @@ -49,6 +49,7 @@ ENTRY(xen_iret) 1: jmp hypercall_iret ENDPATCH(xen_iret) RELOC(xen_iret, 1b+1) +SYM_FUNC_END(xen_iret) ENTRY(xen_sysret64) /* @@ -68,6 +69,7 @@ ENTRY(xen_sysret64) 1: jmp hypercall_iret ENDPATCH(xen_sysret64) RELOC(xen_sysret64, 1b+1) +SYM_FUNC_END(xen_sysret64) /* * Xen handles syscall callbacks much like ordinary exceptions, which diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S index 37794e42b67d..f8b2371faf62 100644 --- a/arch/x86/xen/xen-head.S +++ b/arch/x86/xen/xen-head.S @@ -32,7 +32,7 @@ ENTRY(startup_xen) mov $init_thread_union+THREAD_SIZE, %_ASM_SP jmp xen_start_kernel - +SYM_FUNC_END(startup_xen) __FINIT .pushsection .text diff --git a/arch/x86/xen/xen-pvh.S b/arch/x86/xen/xen-pvh.S index 5e246716d58f..7dc332435c14 100644 --- a/arch/x86/xen/xen-pvh.S +++ b/arch/x86/xen/xen-pvh.S @@ -133,7 +133,7 @@ ENTRY(pvh_start_xen) ljmp $__BOOT_CS, $_pa(startup_32) #endif -END(pvh_start_xen) +SYM_FUNC_END(pvh_start_xen) .section ".init.data","aw" .balign 8