diff options
author | James Hogan <jhogan@kernel.org> | 2017-10-24 13:07:54 +0100 |
---|---|---|
committer | James Hogan <jhogan@kernel.org> | 2018-02-22 11:07:21 +0000 |
commit | bb6fb6dfcc17cddac11ac295861f7608194447a7 (patch) | |
tree | 47ee071a415546dd01adbf628f61acb80473d476 /arch/metag/kernel/perf_callchain.c | |
parent | Linux 4.16-rc2 (diff) | |
download | linux-dev-bb6fb6dfcc17cddac11ac295861f7608194447a7.tar.xz linux-dev-bb6fb6dfcc17cddac11ac295861f7608194447a7.zip |
metag: Remove arch/metag/
The earliest Meta architecture port of Linux I have a record of was an
import of a Meta port of Linux v2.4.1 in February 2004, which was worked
on significantly over the next few years by Graham Whaley, Will Newton,
Matt Fleming, myself and others.
Eventually the port was merged into mainline in v3.9 in March 2013, not
long after Imagination Technologies bought MIPS Technologies and shifted
its CPU focus over to the MIPS architecture.
As a result, though the port was maintained for a while, kept on life
support for a while longer, and useful for testing a few specific
drivers for which I don't have ready access to the equivalent MIPS
hardware, it is now essentially dead with no users.
It is also stuck using an out-of-tree toolchain based on GCC 4.2.4 which
is no longer maintained, now struggles to build modern kernels due to
toolchain bugs, and doesn't itself build with a modern GCC. The latest
buildroot port is still using an old uClibc snapshot which is no longer
served, and the latest uClibc doesn't build with GCC 4.2.4.
So lets call it a day and drop the Meta architecture port from the
kernel. RIP Meta.
Signed-off-by: James Hogan <jhogan@kernel.org>
Link: https://lkml.kernel.org/r/95906b76-6ce1-3f84-eaba-c29b4ae952eb@roeck-us.net
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Graham Whaley <graham.whaley@gmail.com>
Cc: linux-metag@vger.kernel.org
Diffstat (limited to 'arch/metag/kernel/perf_callchain.c')
-rw-r--r-- | arch/metag/kernel/perf_callchain.c | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/arch/metag/kernel/perf_callchain.c b/arch/metag/kernel/perf_callchain.c deleted file mode 100644 index d325ba101de0..000000000000 --- a/arch/metag/kernel/perf_callchain.c +++ /dev/null @@ -1,97 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Perf callchain handling code. - * - * Based on the ARM perf implementation. - */ - -#include <linux/kernel.h> -#include <linux/sched.h> -#include <linux/perf_event.h> -#include <linux/uaccess.h> -#include <asm/ptrace.h> -#include <asm/stacktrace.h> - -static bool is_valid_call(unsigned long calladdr) -{ - unsigned int callinsn; - - /* Check the possible return address is aligned. */ - if (!(calladdr & 0x3)) { - if (!get_user(callinsn, (unsigned int *)calladdr)) { - /* Check for CALLR or SWAP PC,D1RtP. */ - if ((callinsn & 0xff000000) == 0xab000000 || - callinsn == 0xa3200aa0) - return true; - } - } - return false; -} - -static struct metag_frame __user * -user_backtrace(struct metag_frame __user *user_frame, - struct perf_callchain_entry_ctx *entry) -{ - struct metag_frame frame; - unsigned long calladdr; - - /* We cannot rely on having frame pointers in user code. */ - while (1) { - /* Also check accessibility of one struct frame beyond */ - if (!access_ok(VERIFY_READ, user_frame, sizeof(frame))) - return 0; - if (__copy_from_user_inatomic(&frame, user_frame, - sizeof(frame))) - return 0; - - --user_frame; - - calladdr = frame.lr - 4; - if (is_valid_call(calladdr)) { - perf_callchain_store(entry, calladdr); - return user_frame; - } - } - - return 0; -} - -void -perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs) -{ - unsigned long sp = regs->ctx.AX[0].U0; - struct metag_frame __user *frame; - - frame = (struct metag_frame __user *)sp; - - --frame; - - while ((entry->nr < entry->max_stack) && frame) - frame = user_backtrace(frame, entry); -} - -/* - * Gets called by walk_stackframe() for every stackframe. This will be called - * whist unwinding the stackframe and is like a subroutine return so we use - * the PC. - */ -static int -callchain_trace(struct stackframe *fr, - void *data) -{ - struct perf_callchain_entry_ctx *entry = data; - perf_callchain_store(entry, fr->pc); - return 0; -} - -void -perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs) -{ - struct stackframe fr; - - fr.fp = regs->ctx.AX[1].U0; - fr.sp = regs->ctx.AX[0].U0; - fr.lr = regs->ctx.DX[4].U1; - fr.pc = regs->ctx.CurrPC; - walk_stackframe(&fr, callchain_trace, entry); -} |