linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 0/2] arm: kprobes: Remove jprobe test case
@ 2017-11-04  4:30 Masami Hiramatsu
  2017-11-04  4:30 ` [PATCH -next 1/2] arm: kprobes: Fix kretprobe test to check correct counter Masami Hiramatsu
  2017-11-04  4:31 ` [PATCH -next 2/2] arm: kprobes: Remove jprobe test case Masami Hiramatsu
  0 siblings, 2 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2017-11-04  4:30 UTC (permalink / raw)
  To: Russell King, Jon Medhurst
  Cc: Arnd Bergmann, Mark Brown, Ingo Molnar, linux-arm-kernel,
	linux-kernel, Wang Nan, Stephen Rothwell

Hi,

This series fixes a typo and remove jprobe test case
because jprobe is deprecated feature. The typo is
related to jprobe so need to be fixed in this series.

Thank you,

---

Masami Hiramatsu (2):
      arm: kprobes: Fix kretprobe test to check correct counter
      arm: kprobes: Remove jprobe test case


 arch/arm/probes/kprobes/test-core.c |   59 +----------------------------------
 1 file changed, 1 insertion(+), 58 deletions(-)

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH -next 1/2] arm: kprobes: Fix kretprobe test to check correct counter
  2017-11-04  4:30 [PATCH -next 0/2] arm: kprobes: Remove jprobe test case Masami Hiramatsu
@ 2017-11-04  4:30 ` Masami Hiramatsu
  2017-11-07 11:15   ` [tip:perf/kprobes] arm/kprobes: " tip-bot for Masami Hiramatsu
  2017-11-04  4:31 ` [PATCH -next 2/2] arm: kprobes: Remove jprobe test case Masami Hiramatsu
  1 sibling, 1 reply; 5+ messages in thread
From: Masami Hiramatsu @ 2017-11-04  4:30 UTC (permalink / raw)
  To: Russell King, Jon Medhurst
  Cc: Arnd Bergmann, Mark Brown, Ingo Molnar, linux-arm-kernel,
	linux-kernel, Wang Nan, Stephen Rothwell

test_kretprobe() uses jprobe_func_called at the
last test, but it must check kretprobe_handler_called.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 arch/arm/probes/kprobes/test-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/probes/kprobes/test-core.c b/arch/arm/probes/kprobes/test-core.c
index 1c98a87786ca..9c3ceba69015 100644
--- a/arch/arm/probes/kprobes/test-core.c
+++ b/arch/arm/probes/kprobes/test-core.c
@@ -451,7 +451,7 @@ static int test_kretprobe(long (*func)(long, long))
 	}
 	if (!call_test_func(func, false))
 		return -EINVAL;
-	if (jprobe_func_called == test_func_instance) {
+	if (kretprobe_handler_called == test_func_instance) {
 		pr_err("FAIL: kretprobe called after unregistering\n");
 		return -EINVAL;
 	}

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH -next 2/2] arm: kprobes: Remove jprobe test case
  2017-11-04  4:30 [PATCH -next 0/2] arm: kprobes: Remove jprobe test case Masami Hiramatsu
  2017-11-04  4:30 ` [PATCH -next 1/2] arm: kprobes: Fix kretprobe test to check correct counter Masami Hiramatsu
@ 2017-11-04  4:31 ` Masami Hiramatsu
  2017-11-07 11:15   ` [tip:perf/kprobes] arm/kprobes: " tip-bot for Masami Hiramatsu
  1 sibling, 1 reply; 5+ messages in thread
From: Masami Hiramatsu @ 2017-11-04  4:31 UTC (permalink / raw)
  To: Russell King, Jon Medhurst
  Cc: Arnd Bergmann, Mark Brown, Ingo Molnar, linux-arm-kernel,
	linux-kernel, Wang Nan, Stephen Rothwell

Remove jprobe test case because jprobe is deprecated
feature. We must not use it.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 arch/arm/probes/kprobes/test-core.c |   57 -----------------------------------
 1 file changed, 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;
 static int test_func_instance;
 static int pre_handler_called;
 static int post_handler_called;
-static int jprobe_func_called;
 static int kretprobe_handler_called;
 static int tests_failed;
 
@@ -370,50 +369,6 @@ static int test_kprobe(long (*func)(long, long))
 	return 0;
 }
 
-static void __kprobes jprobe_func(long r0, long r1)
-{
-	jprobe_func_called = test_func_instance;
-	if (r0 == FUNC_ARG1 && r1 == FUNC_ARG2)
-		test_regs_ok = true;
-	jprobe_return();
-}
-
-static struct jprobe the_jprobe = {
-	.entry		= jprobe_func,
-};
-
-static int test_jprobe(long (*func)(long, long))
-{
-	int ret;
-
-	the_jprobe.kp.addr = (kprobe_opcode_t *)func;
-	ret = register_jprobe(&the_jprobe);
-	if (ret < 0) {
-		pr_err("FAIL: register_jprobe failed with %d\n", ret);
-		return ret;
-	}
-
-	ret = call_test_func(func, true);
-
-	unregister_jprobe(&the_jprobe);
-	the_jprobe.kp.flags = 0; /* Clear disable flag to allow reuse */
-
-	if (!ret)
-		return -EINVAL;
-	if (jprobe_func_called != test_func_instance) {
-		pr_err("FAIL: jprobe handler function not called\n");
-		return -EINVAL;
-	}
-	if (!call_test_func(func, false))
-		return -EINVAL;
-	if (jprobe_func_called == test_func_instance) {
-		pr_err("FAIL: probe called after unregistering\n");
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
 static int __kprobes
 kretprobe_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
 {
@@ -468,18 +423,6 @@ static int run_api_tests(long (*func)(long, long))
 	if (ret < 0)
 		return ret;
 
-	pr_info("    jprobe\n");
-	ret = test_jprobe(func);
-#if defined(CONFIG_THUMB2_KERNEL) && !defined(MODULE)
-	if (ret == -EINVAL) {
-		pr_err("FAIL: Known longtime bug with jprobe on Thumb kernels\n");
-		tests_failed = ret;
-		ret = 0;
-	}
-#endif
-	if (ret < 0)
-		return ret;
-
 	pr_info("    kretprobe\n");
 	ret = test_kretprobe(func);
 	if (ret < 0)

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [tip:perf/kprobes] arm/kprobes: Fix kretprobe test to check correct counter
  2017-11-04  4:30 ` [PATCH -next 1/2] arm: kprobes: Fix kretprobe test to check correct counter Masami Hiramatsu
@ 2017-11-07 11:15   ` tip-bot for Masami Hiramatsu
  0 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2017-11-07 11:15 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, linux, wangnan0, arnd, linux-kernel, sfr, mingo, broonie,
	torvalds, hpa, tixy, mhiramat, peterz

Commit-ID:  4650209b166789182657c8eb0612cecd5b54d591
Gitweb:     https://git.kernel.org/tip/4650209b166789182657c8eb0612cecd5b54d591
Author:     Masami Hiramatsu <mhiramat@kernel.org>
AuthorDate: Sat, 4 Nov 2017 13:30:52 +0900
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 7 Nov 2017 11:25:14 +0100

arm/kprobes: Fix kretprobe test to check correct counter

test_kretprobe() uses jprobe_func_called at the
last test, but it must check kretprobe_handler_called.

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/150976985182.2012.15495311380682779381.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/arm/probes/kprobes/test-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/probes/kprobes/test-core.c b/arch/arm/probes/kprobes/test-core.c
index 1c98a87..9c3ceba 100644
--- a/arch/arm/probes/kprobes/test-core.c
+++ b/arch/arm/probes/kprobes/test-core.c
@@ -451,7 +451,7 @@ static int test_kretprobe(long (*func)(long, long))
 	}
 	if (!call_test_func(func, false))
 		return -EINVAL;
-	if (jprobe_func_called == test_func_instance) {
+	if (kretprobe_handler_called == test_func_instance) {
 		pr_err("FAIL: kretprobe called after unregistering\n");
 		return -EINVAL;
 	}

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [tip:perf/kprobes] arm/kprobes: Remove jprobe test case
  2017-11-04  4:31 ` [PATCH -next 2/2] arm: kprobes: Remove jprobe test case Masami Hiramatsu
@ 2017-11-07 11:15   ` tip-bot for Masami Hiramatsu
  0 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2017-11-07 11:15 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, arnd, mhiramat, peterz, linux, torvalds, wangnan0, broonie,
	linux-kernel, tixy, tglx, hpa, sfr

Commit-ID:  a443026a48ad7a8b1b966b00fb5d7111b81a219b
Gitweb:     https://git.kernel.org/tip/a443026a48ad7a8b1b966b00fb5d7111b81a219b
Author:     Masami Hiramatsu <mhiramat@kernel.org>
AuthorDate: Sat, 4 Nov 2017 13:31:21 +0900
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 7 Nov 2017 11:25:14 +0100

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>
---
 arch/arm/probes/kprobes/test-core.c | 57 -------------------------------------
 1 file changed, 57 deletions(-)

diff --git a/arch/arm/probes/kprobes/test-core.c b/arch/arm/probes/kprobes/test-core.c
index 9c3ceba..9ed0129 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;
 static int test_func_instance;
 static int pre_handler_called;
 static int post_handler_called;
-static int jprobe_func_called;
 static int kretprobe_handler_called;
 static int tests_failed;
 
@@ -370,50 +369,6 @@ static int test_kprobe(long (*func)(long, long))
 	return 0;
 }
 
-static void __kprobes jprobe_func(long r0, long r1)
-{
-	jprobe_func_called = test_func_instance;
-	if (r0 == FUNC_ARG1 && r1 == FUNC_ARG2)
-		test_regs_ok = true;
-	jprobe_return();
-}
-
-static struct jprobe the_jprobe = {
-	.entry		= jprobe_func,
-};
-
-static int test_jprobe(long (*func)(long, long))
-{
-	int ret;
-
-	the_jprobe.kp.addr = (kprobe_opcode_t *)func;
-	ret = register_jprobe(&the_jprobe);
-	if (ret < 0) {
-		pr_err("FAIL: register_jprobe failed with %d\n", ret);
-		return ret;
-	}
-
-	ret = call_test_func(func, true);
-
-	unregister_jprobe(&the_jprobe);
-	the_jprobe.kp.flags = 0; /* Clear disable flag to allow reuse */
-
-	if (!ret)
-		return -EINVAL;
-	if (jprobe_func_called != test_func_instance) {
-		pr_err("FAIL: jprobe handler function not called\n");
-		return -EINVAL;
-	}
-	if (!call_test_func(func, false))
-		return -EINVAL;
-	if (jprobe_func_called == test_func_instance) {
-		pr_err("FAIL: probe called after unregistering\n");
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
 static int __kprobes
 kretprobe_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
 {
@@ -468,18 +423,6 @@ static int run_api_tests(long (*func)(long, long))
 	if (ret < 0)
 		return ret;
 
-	pr_info("    jprobe\n");
-	ret = test_jprobe(func);
-#if defined(CONFIG_THUMB2_KERNEL) && !defined(MODULE)
-	if (ret == -EINVAL) {
-		pr_err("FAIL: Known longtime bug with jprobe on Thumb kernels\n");
-		tests_failed = ret;
-		ret = 0;
-	}
-#endif
-	if (ret < 0)
-		return ret;
-
 	pr_info("    kretprobe\n");
 	ret = test_kretprobe(func);
 	if (ret < 0)

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-07 11:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-04  4:30 [PATCH -next 0/2] arm: kprobes: Remove jprobe test case Masami Hiramatsu
2017-11-04  4:30 ` [PATCH -next 1/2] arm: kprobes: Fix kretprobe test to check correct counter Masami Hiramatsu
2017-11-07 11:15   ` [tip:perf/kprobes] arm/kprobes: " tip-bot for Masami Hiramatsu
2017-11-04  4:31 ` [PATCH -next 2/2] arm: kprobes: Remove jprobe test case Masami Hiramatsu
2017-11-07 11:15   ` [tip:perf/kprobes] arm/kprobes: " tip-bot for Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).