diff options
| author | Masami Hiramatsu <mhiramat@kernel.org> | 2017-11-04 00:31:21 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2017-11-07 05:25:14 -0500 |
| commit | a443026a48ad7a8b1b966b00fb5d7111b81a219b (patch) | |
| tree | 06859f1f0fc1de27f734a354ca64df3caa5e3932 | |
| parent | 4650209b166789182657c8eb0612cecd5b54d591 (diff) | |
arm/kprobes: Remove jprobe test case
Remove the jprobes test case because jprobes is a deprecated feature.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jon Medhurst <tixy@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/150976988105.2012.13618117383683725047.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
| -rw-r--r-- | arch/arm/probes/kprobes/test-core.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/arch/arm/probes/kprobes/test-core.c b/arch/arm/probes/kprobes/test-core.c index 9c3ceba69015..9ed0129bed3c 100644 --- a/arch/arm/probes/kprobes/test-core.c +++ b/arch/arm/probes/kprobes/test-core.c | |||
| @@ -227,7 +227,6 @@ static bool test_regs_ok; | |||
| 227 | static int test_func_instance; | 227 | static int test_func_instance; |
| 228 | static int pre_handler_called; | 228 | static int pre_handler_called; |
| 229 | static int post_handler_called; | 229 | static int post_handler_called; |
| 230 | static int jprobe_func_called; | ||
| 231 | static int kretprobe_handler_called; | 230 | static int kretprobe_handler_called; |
| 232 | static int tests_failed; | 231 | static int tests_failed; |
| 233 | 232 | ||
| @@ -370,50 +369,6 @@ static int test_kprobe(long (*func)(long, long)) | |||
| 370 | return 0; | 369 | return 0; |
| 371 | } | 370 | } |
| 372 | 371 | ||
| 373 | static void __kprobes jprobe_func(long r0, long r1) | ||
| 374 | { | ||
| 375 | jprobe_func_called = test_func_instance; | ||
| 376 | if (r0 == FUNC_ARG1 && r1 == FUNC_ARG2) | ||
| 377 | test_regs_ok = true; | ||
| 378 | jprobe_return(); | ||
| 379 | } | ||
| 380 | |||
| 381 | static struct jprobe the_jprobe = { | ||
| 382 | .entry = jprobe_func, | ||
| 383 | }; | ||
| 384 | |||
| 385 | static int test_jprobe(long (*func)(long, long)) | ||
| 386 | { | ||
| 387 | int ret; | ||
| 388 | |||
| 389 | the_jprobe.kp.addr = (kprobe_opcode_t *)func; | ||
| 390 | ret = register_jprobe(&the_jprobe); | ||
| 391 | if (ret < 0) { | ||
| 392 | pr_err("FAIL: register_jprobe failed with %d\n", ret); | ||
| 393 | return ret; | ||
| 394 | } | ||
| 395 | |||
| 396 | ret = call_test_func(func, true); | ||
| 397 | |||
| 398 | unregister_jprobe(&the_jprobe); | ||
| 399 | the_jprobe.kp.flags = 0; /* Clear disable flag to allow reuse */ | ||
| 400 | |||
| 401 | if (!ret) | ||
| 402 | return -EINVAL; | ||
| 403 | if (jprobe_func_called != test_func_instance) { | ||
| 404 | pr_err("FAIL: jprobe handler function not called\n"); | ||
| 405 | return -EINVAL; | ||
| 406 | } | ||
| 407 | if (!call_test_func(func, false)) | ||
| 408 | return -EINVAL; | ||
| 409 | if (jprobe_func_called == test_func_instance) { | ||
| 410 | pr_err("FAIL: probe called after unregistering\n"); | ||
| 411 | return -EINVAL; | ||
| 412 | } | ||
| 413 | |||
| 414 | return 0; | ||
| 415 | } | ||
| 416 | |||
| 417 | static int __kprobes | 372 | static int __kprobes |
| 418 | kretprobe_handler(struct kretprobe_instance *ri, struct pt_regs *regs) | 373 | kretprobe_handler(struct kretprobe_instance *ri, struct pt_regs *regs) |
| 419 | { | 374 | { |
| @@ -468,18 +423,6 @@ static int run_api_tests(long (*func)(long, long)) | |||
| 468 | if (ret < 0) | 423 | if (ret < 0) |
| 469 | return ret; | 424 | return ret; |
| 470 | 425 | ||
| 471 | pr_info(" jprobe\n"); | ||
| 472 | ret = test_jprobe(func); | ||
| 473 | #if defined(CONFIG_THUMB2_KERNEL) && !defined(MODULE) | ||
| 474 | if (ret == -EINVAL) { | ||
| 475 | pr_err("FAIL: Known longtime bug with jprobe on Thumb kernels\n"); | ||
| 476 | tests_failed = ret; | ||
| 477 | ret = 0; | ||
| 478 | } | ||
| 479 | #endif | ||
| 480 | if (ret < 0) | ||
| 481 | return ret; | ||
| 482 | |||
| 483 | pr_info(" kretprobe\n"); | 426 | pr_info(" kretprobe\n"); |
| 484 | ret = test_kretprobe(func); | 427 | ret = test_kretprobe(func); |
| 485 | if (ret < 0) | 428 | if (ret < 0) |
