diff options
author | Mark Salter <msalter@redhat.com> | 2014-04-05 10:25:49 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2014-04-06 18:25:04 -0400 |
commit | ff268ff7f32bf5388b7422f0c0773d88add23423 (patch) | |
tree | 8529cf6667316fde9cec43de153fd27f244f25b4 | |
parent | 0a997ecc08e0b551119c56d52a591d9e5b38a7cd (diff) |
arm64: fix !CONFIG_COMPAT build failures
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>
-rw-r--r-- | arch/arm64/kernel/perf_event.c | 4 | ||||
-rw-r--r-- | arch/arm64/kernel/perf_regs.c | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index e868c72a7938..baf5afb7e6a0 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c | |||
@@ -1386,6 +1386,7 @@ user_backtrace(struct frame_tail __user *tail, | |||
1386 | return buftail.fp; | 1386 | return buftail.fp; |
1387 | } | 1387 | } |
1388 | 1388 | ||
1389 | #ifdef CONFIG_COMPAT | ||
1389 | /* | 1390 | /* |
1390 | * The registers we're interested in are at the end of the variable | 1391 | * The registers we're interested in are at the end of the variable |
1391 | * length saved register structure. The fp points at the end of this | 1392 | * length saved register structure. The fp points at the end of this |
@@ -1430,6 +1431,7 @@ compat_user_backtrace(struct compat_frame_tail __user *tail, | |||
1430 | 1431 | ||
1431 | return (struct compat_frame_tail __user *)compat_ptr(buftail.fp) - 1; | 1432 | return (struct compat_frame_tail __user *)compat_ptr(buftail.fp) - 1; |
1432 | } | 1433 | } |
1434 | #endif /* CONFIG_COMPAT */ | ||
1433 | 1435 | ||
1434 | void perf_callchain_user(struct perf_callchain_entry *entry, | 1436 | void perf_callchain_user(struct perf_callchain_entry *entry, |
1435 | struct pt_regs *regs) | 1437 | struct pt_regs *regs) |
@@ -1451,6 +1453,7 @@ void perf_callchain_user(struct perf_callchain_entry *entry, | |||
1451 | tail && !((unsigned long)tail & 0xf)) | 1453 | tail && !((unsigned long)tail & 0xf)) |
1452 | tail = user_backtrace(tail, entry); | 1454 | tail = user_backtrace(tail, entry); |
1453 | } else { | 1455 | } else { |
1456 | #ifdef CONFIG_COMPAT | ||
1454 | /* AARCH32 compat mode */ | 1457 | /* AARCH32 compat mode */ |
1455 | struct compat_frame_tail __user *tail; | 1458 | struct compat_frame_tail __user *tail; |
1456 | 1459 | ||
@@ -1459,6 +1462,7 @@ void perf_callchain_user(struct perf_callchain_entry *entry, | |||
1459 | while ((entry->nr < PERF_MAX_STACK_DEPTH) && | 1462 | while ((entry->nr < PERF_MAX_STACK_DEPTH) && |
1460 | tail && !((unsigned long)tail & 0x3)) | 1463 | tail && !((unsigned long)tail & 0x3)) |
1461 | tail = compat_user_backtrace(tail, entry); | 1464 | tail = compat_user_backtrace(tail, entry); |
1465 | #endif | ||
1462 | } | 1466 | } |
1463 | } | 1467 | } |
1464 | 1468 | ||
diff --git a/arch/arm64/kernel/perf_regs.c b/arch/arm64/kernel/perf_regs.c index f2d6f0a36d63..422ebd63b619 100644 --- a/arch/arm64/kernel/perf_regs.c +++ b/arch/arm64/kernel/perf_regs.c | |||
@@ -2,6 +2,8 @@ | |||
2 | #include <linux/kernel.h> | 2 | #include <linux/kernel.h> |
3 | #include <linux/perf_event.h> | 3 | #include <linux/perf_event.h> |
4 | #include <linux/bug.h> | 4 | #include <linux/bug.h> |
5 | |||
6 | #include <asm/compat.h> | ||
5 | #include <asm/perf_regs.h> | 7 | #include <asm/perf_regs.h> |
6 | #include <asm/ptrace.h> | 8 | #include <asm/ptrace.h> |
7 | 9 | ||