summaryrefslogtreecommitdiff
path: root/arch/riscv/lib/error-inject.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2021-03-08 10:11:33 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2021-03-08 10:11:33 -0300
commit009ef05f98129aa91c62c3baab859ba593a15bb2 (patch)
treef3414f08d636a597545b1e4f443b373b9d6d8f4b /arch/riscv/lib/error-inject.c
parent2777b81b379df772defd654bc4d3fa82dca17a4b (diff)
parent144c79ef33536b4ecb4951e07dbc1f2b7fa99d32 (diff)
downloadlwn-009ef05f98129aa91c62c3baab859ba593a15bb2.tar.gz
lwn-009ef05f98129aa91c62c3baab859ba593a15bb2.zip
Merge remote-tracking branch 'torvalds/master' into perf/core
To pick up the fixes sent for v5.12 and continue development based on v5.12-rc2, i.e. without the swap on file bug. This also gets a slightly newer and better tools/perf/arch/arm/util/cs-etm.c patch version, using the BIT() macro, that had already been slated to v5.13 but ended up going to v5.12-rc1 on an older version. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'arch/riscv/lib/error-inject.c')
-rw-r--r--arch/riscv/lib/error-inject.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/riscv/lib/error-inject.c b/arch/riscv/lib/error-inject.c
new file mode 100644
index 000000000000..d667ade2bc41
--- /dev/null
+++ b/arch/riscv/lib/error-inject.c
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/error-injection.h>
+#include <linux/kprobes.h>
+
+void override_function_with_return(struct pt_regs *regs)
+{
+ instruction_pointer_set(regs, regs->ra);
+}
+NOKPROBE_SYMBOL(override_function_with_return);