Commit 49cf78ef7bb34833496d59b6dfe84ae51b1ab097

Authored by Chris Metcalf
1 parent 80f184108e

tile: support FRAME_POINTER

Allow enabling frame pointer support; this makes it easier to hook
into the various kernel features that claim they require it without
having to add Kconfig conditionals everywhere (a la mips, ppc, s390,
and microblaze).  When enabled, it basically eliminates leaf functions
as such, and stops optimizing tail and sibling calls.  It adds around
3% to the size of the kernel when enabled.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

Showing 4 changed files with 12 additions and 9 deletions Side-by-side Diff

... ... @@ -26,6 +26,7 @@
26 26 select HAVE_SYSCALL_TRACEPOINTS
27 27 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
28 28 select HAVE_DEBUG_STACKOVERFLOW
  29 + select ARCH_WANT_FRAME_POINTERS
29 30  
30 31 # FIXME: investigate whether we need/want these options.
31 32 # select HAVE_IOREMAP_PROT
arch/tile/lib/Makefile
... ... @@ -6,14 +6,14 @@
6 6 memmove.o memcpy_$(BITS).o memchr_$(BITS).o memset_$(BITS).o \
7 7 strchr_$(BITS).o strlen_$(BITS).o strnlen_$(BITS).o
8 8  
9   -ifeq ($(CONFIG_TILEGX),y)
10   -CFLAGS_REMOVE_memcpy_user_64.o = -fno-omit-frame-pointer
11   -lib-y += memcpy_user_64.o
12   -else
13   -lib-y += atomic_32.o atomic_asm_32.o memcpy_tile64.o
14   -endif
15   -
  9 +lib-$(CONFIG_TILEGX) += memcpy_user_64.o
  10 +lib-$(CONFIG_TILEPRO) += atomic_32.o atomic_asm_32.o memcpy_tile64.o
16 11 lib-$(CONFIG_SMP) += spinlock_$(BITS).o usercopy_$(BITS).o
17 12  
18 13 obj-$(CONFIG_MODULES) += exports.o
  14 +
  15 +# The finv_buffer_remote() and copy_{to,from}_user() routines can't
  16 +# have -pg added, since they both rely on being leaf functions.
  17 +CFLAGS_REMOVE_cacheflush.o = -pg
  18 +CFLAGS_REMOVE_memcpy_user_64.o = -pg
arch/tile/lib/cacheflush.c
... ... @@ -36,7 +36,8 @@
36 36 * core (if "!hfh") or homed via hash-for-home (if "hfh"), waiting
37 37 * until the memory controller holds the flushed values.
38 38 */
39   -void finv_buffer_remote(void *buffer, size_t size, int hfh)
  39 +void __attribute__((optimize("omit-frame-pointer")))
  40 +finv_buffer_remote(void *buffer, size_t size, int hfh)
40 41 {
41 42 char *p, *base;
42 43 size_t step_size, load_count;
arch/tile/lib/memcpy_64.c
... ... @@ -54,7 +54,8 @@
54 54 * macros to return a count of uncopied bytes due to mm fault.
55 55 */
56 56 #define RETVAL 0
57   -int USERCOPY_FUNC(void *__restrict dstv, const void *__restrict srcv, size_t n)
  57 +int __attribute__((optimize("omit-frame-pointer")))
  58 +USERCOPY_FUNC(void *__restrict dstv, const void *__restrict srcv, size_t n)
58 59 #endif
59 60 {
60 61 char *__restrict dst1 = (char *)dstv;