arm64: fix !CONFIG_COMPAT build failures
authorMark Salter <msalter@redhat.com>
Sat, 5 Apr 2014 14:25:49 +0000 (15:25 +0100)
committerMark Brown <broonie@linaro.org>
Wed, 21 May 2014 18:06:59 +0000 (19:06 +0100)
Recent arm64 builds using CONFIG_ARM64_64K_PAGES are failing with:

  arch/arm64/kernel/perf_regs.c: In function ‘perf_reg_abi’:
  arch/arm64/kernel/perf_regs.c:41:2: error: implicit declaration of function ‘is_compat_thread’

  arch/arm64/kernel/perf_event.c:1398:2: error: unknown type name ‘compat_uptr_t’

This is due to some recent arm64 perf commits with compat support:

  commit 23c7d70d55c6d9:
    ARM64: perf: add support for frame pointer unwinding in compat mode

  commit 2ee0d7fd36a3f8:
    ARM64: perf: add support for perf registers API

Those patches make the arm64 kernel unbuildable if CONFIG_COMPAT is not
defined and CONFIG_ARM64_64K_PAGES depends on !CONFIG_COMPAT. This patch
allows the arm64 kernel to build with and without CONFIG_COMPAT.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit ff268ff7f32bf5388b7422f0c0773d88add23423)
Signed-off-by: Mark Brown <broonie@linaro.org>
arch/arm64/kernel/perf_event.c
arch/arm64/kernel/perf_regs.c

index 1b020200fffabee2bb4d7cb1b8b0b0994275ccea..3047c6ad0a8dc3ab20b2b407872b172937501729 100644 (file)
@@ -1374,6 +1374,7 @@ user_backtrace(struct frame_tail __user *tail,
        return buftail.fp;
 }
 
+#ifdef CONFIG_COMPAT
 /*
  * The registers we're interested in are at the end of the variable
  * length saved register structure. The fp points at the end of this
@@ -1418,6 +1419,7 @@ compat_user_backtrace(struct compat_frame_tail __user *tail,
 
        return (struct compat_frame_tail __user *)compat_ptr(buftail.fp) - 1;
 }
+#endif /* CONFIG_COMPAT */
 
 void perf_callchain_user(struct perf_callchain_entry *entry,
                         struct pt_regs *regs)
@@ -1439,6 +1441,7 @@ void perf_callchain_user(struct perf_callchain_entry *entry,
                       tail && !((unsigned long)tail & 0xf))
                        tail = user_backtrace(tail, entry);
        } else {
+#ifdef CONFIG_COMPAT
                /* AARCH32 compat mode */
                struct compat_frame_tail __user *tail;
 
@@ -1447,6 +1450,7 @@ void perf_callchain_user(struct perf_callchain_entry *entry,
                while ((entry->nr < PERF_MAX_STACK_DEPTH) &&
                        tail && !((unsigned long)tail & 0x3))
                        tail = compat_user_backtrace(tail, entry);
+#endif
        }
 }
 
index f2d6f0a36d63361286a5816d716a600dc0d5aca3..422ebd63b619253d23c7a82d5fb14b322dc47fe1 100644 (file)
@@ -2,6 +2,8 @@
 #include <linux/kernel.h>
 #include <linux/perf_event.h>
 #include <linux/bug.h>
+
+#include <asm/compat.h>
 #include <asm/perf_regs.h>
 #include <asm/ptrace.h>