lto: Make asmlinkage __visible

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86: Fix sys_call_table type in asm/syscall.h v2

Make the sys_call_table type defined in asm/syscall.h match
the definition in syscall_64.c

v2: include asm/syscall.h in syscall_64.c too. I left uml alone
because it doesn't have an syscall.h on its own and including
the native one leads to other errors.
Cc: x86@kernel.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage: Change dotraplinkage into __visible on 32bit v2

Mark 32bit dotraplinkage functions as __visible for LTO.
64bit already is using asmlinkage which includes it.

v2: Clean up (M.Marek)
Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage: Make all interrupt handlers asmlinkage / __visible

These handlers are all referenced from assembler stubs, so need
to be visible.

The handlers without arguments become asmlinkage, the others __visible
to not force regparms(0) on x86-32.

I put it all into a single patch, please let me know if you want
it it split up.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage: Make _*_start_kernel visible

Obviously these functions have to be visible, otherwise
the whole kernel could be optimized away.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage: Make 32bit/64bit __switch_to visible

This function is called from inline assembler, so has to be visible.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage: Make various syscalls asmlinkage

FWIW I suspect sys_rt_sigreturn/sys_sigreturn should use
standard SYSCALL wrappers.  But I didn't do that change in this
patch.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage: Make kprobes code visible and fix assembler code

- Make all the external assembler template symbols __visible
- Move the templates inline assembler code into a top level
assembler statement, not inside a function. This avoids it being
optimized away or cloned.

Cc: ananth@in.ibm.com
Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage, kexec: Drop bogus asmlinkage in machine_kexec_32

A function pointer cannot be asmlinkage. Just drop it.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage: Make several variables used from assembler/linker script visible

plus one function load_gs_index

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage: Make syscall tables visible

They are referenced from entry*.S.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage, apm: Make APM data structure used from assembler visible

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage, paravirt: Add __visible/asmlinkage to xen paravirt ops

Cc: jeremy@goop.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage: Make 64bit checksum functions visible

They are implemented in assembler.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage: Make dump_stack visible

dump_stack is used from assembler code, so make it visible.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage, power: Make various symbols used by the suspend asm code visible

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, asmlinkage, vdso: Mark vdso variables __visible

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, lto, lguest: Pass in globals into assembler statement

Tell the compiler that the inline assembler statement
references lguest_entry.

This fixes compile problems with LTO where the variable
and the assembler code may end up in different files.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, lto, lguest: Fix C functions used by inline assembler

- Make the C code used by the paravirt stubs visible
- Since they have to be global now, give them a more unique
name.

Cc: rusty@rustcorp.com.au
Signed-off-by: Andi Kleen <ak@linux.intel.com>
x86, lto, paravirt: Don't rely on local assembler labels

The paravirt patching code assumes that it can reference a
local assembler label between two different top level assembler
statements. This does not work with some experimental gcc builds,
where the assembler code may end up in different assembler files.

Replace it with extern / global /asm linkage labels.

This also removes one redundant copy of the macro.

Cc: jeremy@goop.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>