Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7054aad authored by Jon Medhurst's avatar Jon Medhurst
Browse files

ARM: kprobes: Add Thumb instruction simulation test cases

parent a43bc69b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -45,6 +45,9 @@ obj-$(CONFIG_KPROBES) += kprobes-arm.o
endif
obj-$(CONFIG_ARM_KPROBES_TEST)	+= test-kprobes.o
test-kprobes-objs		:= kprobes-test.o
ifdef CONFIG_THUMB2_KERNEL
test-kprobes-objs		+= kprobes-test-thumb.o
endif
obj-$(CONFIG_ATAGS_PROC)	+= atags.o
obj-$(CONFIG_OABI_COMPAT)	+= sys_oabi-compat.o
obj-$(CONFIG_ARM_THUMBEE)	+= thumbee.o
+1187 −0

File added.

Preview size limit exceeded, changes collapsed.

+25 −0
Original line number Diff line number Diff line
@@ -1117,6 +1117,15 @@ static uintptr_t __used kprobes_test_case_end(void)
 * Top level test functions
 */

static int run_test_cases(void (*tests)(void))
{
	pr_info("    Run test cases\n");
	tests();

	return 0;
}


static int __init run_all_tests(void)
{
	int ret = 0;
@@ -1147,8 +1156,24 @@ static int __init run_all_tests(void)
	if (ret)
		goto out;

	pr_info("16-bit Thumb instruction simulation\n");
	ret = run_test_cases(kprobe_thumb16_test_cases);
	if (ret)
		goto out;

	pr_info("32-bit Thumb instruction simulation\n");
	ret = run_test_cases(kprobe_thumb32_test_cases);
	if (ret)
		goto out;
#endif

	pr_info("Total instruction simulation tests=%d, pass=%d fail=%d\n",
		test_try_count, test_pass_count, test_fail_count);
	if (test_fail_count) {
		ret = -EINVAL;
		goto out;
	}

out:
	if (ret == 0)
		pr_info("Finished kprobe tests OK\n");
+6 −0
Original line number Diff line number Diff line
@@ -382,3 +382,9 @@ struct test_arg_end {
#define VALR	0xdeaddead
#define HH1	0x0123fecb
#define HH2	0xa9874567


#ifdef CONFIG_THUMB2_KERNEL
void kprobe_thumb16_test_cases(void);
void kprobe_thumb32_test_cases(void);
#endif