From aaa4dd1b47f5ff5ef477fec5dcc6c397b457f1c2 Mon Sep 17 00:00:00 2001 From: Wang Kefeng Date: Sun, 4 Dec 2022 04:46:40 +0100 Subject: ARM: 9279/1: support function error injection This enables HAVE_FUNCTION_ERROR_INJECTION by adding necessary regs_set_return_value() and override_function_with_return(). Simply tested according to Documentation/fault-injection/fault-injection.rst. Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) --- arch/arm/lib/error-inject.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 arch/arm/lib/error-inject.c (limited to 'arch/arm/lib/error-inject.c') diff --git a/arch/arm/lib/error-inject.c b/arch/arm/lib/error-inject.c new file mode 100644 index 000000000000..5a5b405792ba --- /dev/null +++ b/arch/arm/lib/error-inject.c @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include + +void override_function_with_return(struct pt_regs *regs) +{ + instruction_pointer_set(regs, regs->ARM_lr); +} +NOKPROBE_SYMBOL(override_function_with_return); -- cgit v1.2.3