[PATCH v2 02/10] x86: assembly, FUNC_START for fn, DATA_START for data

From: Jiri Slaby
Date: Mon Mar 20 2017 - 08:35:49 EST


This is a start of series to cleanup macros used for starting functions,
data, globals etc. across x86. When we have all this sorted out, this
will help to inject DWARF unwinding info by objtool later.

The goal is forcing SYM_FUNC_START to emit .cfi_startproc and
SYM_FUNC_END to emit .cfi_endproc. Automatically at best.

This particular patch makes proper use of SYM_DATA_START on data and
SYM_FUNC_START on a function which was not the case on 4 locations.

Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: <x86@xxxxxxxxxx>
Cc: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
Cc: Juergen Gross <jgross@xxxxxxxx>
Reviewed-by: Juergen Gross <jgross@xxxxxxxx> [xen parts]
Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
Cc: "Rafael J. Wysocki" <rjw@xxxxxxxxxxxxx>
Cc: Len Brown <len.brown@xxxxxxxxx>
Cc: Pavel Machek <pavel@xxxxxx>
Cc: <linux-pm@xxxxxxxxxxxxxxx>
---
arch/x86/entry/entry_64_compat.S | 3 +--
arch/x86/kernel/acpi/wakeup_64.S | 14 +++++++-------
arch/x86/kernel/head_64.S | 2 +-
arch/x86/kernel/mcount_64.S | 2 +-
4 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S
index e1721dafbcb1..73d7ff0b125c 100644
--- a/arch/x86/entry/entry_64_compat.S
+++ b/arch/x86/entry/entry_64_compat.S
@@ -342,8 +342,7 @@ ENTRY(entry_INT80_compat)
jmp restore_regs_and_iret
END(entry_INT80_compat)

- ALIGN
-GLOBAL(stub32_clone)
+SYM_FUNC_START(stub32_clone)
/*
* The 32-bit clone ABI is: clone(..., int tls_val, int *child_tidptr).
* The 64-bit clone ABI is: clone(..., int *child_tidptr, int tls_val).
diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S
index 50b8ed0317a3..0b5a5573f57d 100644
--- a/arch/x86/kernel/acpi/wakeup_64.S
+++ b/arch/x86/kernel/acpi/wakeup_64.S
@@ -125,12 +125,12 @@ ENTRY(do_suspend_lowlevel)
ENDPROC(do_suspend_lowlevel)

.data
-ENTRY(saved_rbp) .quad 0
-ENTRY(saved_rsi) .quad 0
-ENTRY(saved_rdi) .quad 0
-ENTRY(saved_rbx) .quad 0
+SYM_DATA_START(saved_rbp) .quad 0
+SYM_DATA_START(saved_rsi) .quad 0
+SYM_DATA_START(saved_rdi) .quad 0
+SYM_DATA_START(saved_rbx) .quad 0

-ENTRY(saved_rip) .quad 0
-ENTRY(saved_rsp) .quad 0
+SYM_DATA_START(saved_rip) .quad 0
+SYM_DATA_START(saved_rsp) .quad 0

-ENTRY(saved_magic) .quad 0
+SYM_DATA_START(saved_magic) .quad 0
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index ac9d327d2e42..e093a804f1fb 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -487,7 +487,7 @@ early_gdt_descr:
early_gdt_descr_base:
.quad INIT_PER_CPU_VAR(gdt_page)

-ENTRY(phys_base)
+SYM_DATA_START(phys_base)
/* This must match the first entry in level2_kernel_pgt */
.quad 0x0000000000000000
EXPORT_SYMBOL(phys_base)
diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S
index 7b0d3da52fb4..2b4d7045e823 100644
--- a/arch/x86/kernel/mcount_64.S
+++ b/arch/x86/kernel/mcount_64.S
@@ -320,7 +320,7 @@ ENTRY(ftrace_graph_caller)
retq
END(ftrace_graph_caller)

-GLOBAL(return_to_handler)
+SYM_FUNC_START(return_to_handler)
subq $24, %rsp

/* Save the return values */
--
2.12.0