linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] perf: tests: Disable breakpoint tests on ARM (32-bit)
@ 2018-12-03 19:11 Florian Fainelli
  2018-12-04 14:06 ` Will Deacon
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Florian Fainelli @ 2018-12-03 19:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: will.deacon, Florian Fainelli, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim

breakpoint tests on the ARM 32-bit kernel are broken in several ways.

The breakpoint length requested does not necessarily match whether the
function address has the Thumb bit (bit 0) set or not, and this does
matter to the ARM kernel hw_breakpoint infrastructure. See [1] for
background.

[1]: https://lkml.org/lkml/2018/11/15/205

As Will indicated, the overflow handling would require single-stepping
which is not supported at the moment. Just disable those tests for the
ARM 32-bit platforms and update the comment above to explain these
limitations.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v3:

- directly incorporate Will's comment, Will can you add your
  Signed-off-by?

Changes in v2:

- incorporate Will's feedback about comment

 tools/perf/tests/bp_signal.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c
index a467615c5a0e..910e25e64188 100644
--- a/tools/perf/tests/bp_signal.c
+++ b/tools/perf/tests/bp_signal.c
@@ -291,12 +291,20 @@ int test__bp_signal(struct test *test __maybe_unused, int subtest __maybe_unused
 
 bool test__bp_signal_is_supported(void)
 {
-/*
- * The powerpc so far does not have support to even create
- * instruction breakpoint using the perf event interface.
- * Once it's there we can release this.
- */
-#if defined(__powerpc__) || defined(__s390x__)
+	/*
+	 * PowerPC and S390 do not support creation of instruction
+	 * breakpoints using the perf_event interface.
+	 *
+	 * ARM requires explicit rounding down of the instruction
+	 * pointer in Thumb mode, and then requires the single-step
+	 * to be handled explicitly in the overflow handler to avoid
+	 * stepping into the SIGIO handler and getting stuck on the
+	 * breakpointed instruction.
+	 *
+	 * Just disable the test for these architectures until these
+	 * issues are resolved.
+	 */
+#if defined(__powerpc__) || defined(__s390x__) || defined(__arm__)
 	return false;
 #else
 	return true;
-- 
2.17.1


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

* Re: [PATCH v3] perf: tests: Disable breakpoint tests on ARM (32-bit)
  2018-12-03 19:11 [PATCH v3] perf: tests: Disable breakpoint tests on ARM (32-bit) Florian Fainelli
@ 2018-12-04 14:06 ` Will Deacon
  2018-12-04 14:12   ` Arnaldo Carvalho de Melo
  2018-12-14 20:39 ` [tip:perf/core] perf tests ARM: Disable breakpoint tests 32-bit tip-bot for Florian Fainelli
  2018-12-18 14:06 ` tip-bot for Florian Fainelli
  2 siblings, 1 reply; 5+ messages in thread
From: Will Deacon @ 2018-12-04 14:06 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: linux-kernel, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim

On Mon, Dec 03, 2018 at 11:11:36AM -0800, Florian Fainelli wrote:
> breakpoint tests on the ARM 32-bit kernel are broken in several ways.
> 
> The breakpoint length requested does not necessarily match whether the
> function address has the Thumb bit (bit 0) set or not, and this does
> matter to the ARM kernel hw_breakpoint infrastructure. See [1] for
> background.
> 
> [1]: https://lkml.org/lkml/2018/11/15/205
> 
> As Will indicated, the overflow handling would require single-stepping
> which is not supported at the moment. Just disable those tests for the
> ARM 32-bit platforms and update the comment above to explain these
> limitations.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> Changes in v3:
> 
> - directly incorporate Will's comment, Will can you add your
>   Signed-off-by?

Of course:

Co-developed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>

Will

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

* Re: [PATCH v3] perf: tests: Disable breakpoint tests on ARM (32-bit)
  2018-12-04 14:06 ` Will Deacon
@ 2018-12-04 14:12   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-12-04 14:12 UTC (permalink / raw)
  To: Will Deacon
  Cc: Florian Fainelli, linux-kernel, Peter Zijlstra, Ingo Molnar,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim

Em Tue, Dec 04, 2018 at 02:06:16PM +0000, Will Deacon escreveu:
> On Mon, Dec 03, 2018 at 11:11:36AM -0800, Florian Fainelli wrote:
> > breakpoint tests on the ARM 32-bit kernel are broken in several ways.
> > 
> > The breakpoint length requested does not necessarily match whether the
> > function address has the Thumb bit (bit 0) set or not, and this does
> > matter to the ARM kernel hw_breakpoint infrastructure. See [1] for
> > background.
> > 
> > [1]: https://lkml.org/lkml/2018/11/15/205
> > 
> > As Will indicated, the overflow handling would require single-stepping
> > which is not supported at the moment. Just disable those tests for the
> > ARM 32-bit platforms and update the comment above to explain these
> > limitations.
> > 
> > Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> > ---
> > Changes in v3:
> > 
> > - directly incorporate Will's comment, Will can you add your
> >   Signed-off-by?
> 
> Of course:
> 
> Co-developed-by: Will Deacon <will.deacon@arm.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>

Thanks, added those and applied the patch.

- Arnaldo

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

* [tip:perf/core] perf tests ARM: Disable breakpoint tests 32-bit
  2018-12-03 19:11 [PATCH v3] perf: tests: Disable breakpoint tests on ARM (32-bit) Florian Fainelli
  2018-12-04 14:06 ` Will Deacon
@ 2018-12-14 20:39 ` tip-bot for Florian Fainelli
  2018-12-18 14:06 ` tip-bot for Florian Fainelli
  2 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Florian Fainelli @ 2018-12-14 20:39 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: f.fainelli, linux-kernel, hpa, alexander.shishkin, tglx,
	namhyung, mingo, acme, will.deacon, peterz, jolsa

Commit-ID:  b4ab1b4fa1995ceb1b7ba9d1b51a5124d28c5f0f
Gitweb:     https://git.kernel.org/tip/b4ab1b4fa1995ceb1b7ba9d1b51a5124d28c5f0f
Author:     Florian Fainelli <f.fainelli@gmail.com>
AuthorDate: Mon, 3 Dec 2018 11:11:36 -0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 6 Dec 2018 14:12:21 -0300

perf tests ARM: Disable breakpoint tests 32-bit

The breakpoint tests on the ARM 32-bit kernel are broken in several
ways.

The breakpoint length requested does not necessarily match whether the
function address has the Thumb bit (bit 0) set or not, and this does
matter to the ARM kernel hw_breakpoint infrastructure. See [1] for
background.

[1]: https://lkml.org/lkml/2018/11/15/205

As Will indicated, the overflow handling would require single-stepping
which is not supported at the moment. Just disable those tests for the
ARM 32-bit platforms and update the comment above to explain these
limitations.

Co-developed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20181203191138.2419-1-f.fainelli@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/bp_signal.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c
index a467615c5a0e..910e25e64188 100644
--- a/tools/perf/tests/bp_signal.c
+++ b/tools/perf/tests/bp_signal.c
@@ -291,12 +291,20 @@ int test__bp_signal(struct test *test __maybe_unused, int subtest __maybe_unused
 
 bool test__bp_signal_is_supported(void)
 {
-/*
- * The powerpc so far does not have support to even create
- * instruction breakpoint using the perf event interface.
- * Once it's there we can release this.
- */
-#if defined(__powerpc__) || defined(__s390x__)
+	/*
+	 * PowerPC and S390 do not support creation of instruction
+	 * breakpoints using the perf_event interface.
+	 *
+	 * ARM requires explicit rounding down of the instruction
+	 * pointer in Thumb mode, and then requires the single-step
+	 * to be handled explicitly in the overflow handler to avoid
+	 * stepping into the SIGIO handler and getting stuck on the
+	 * breakpointed instruction.
+	 *
+	 * Just disable the test for these architectures until these
+	 * issues are resolved.
+	 */
+#if defined(__powerpc__) || defined(__s390x__) || defined(__arm__)
 	return false;
 #else
 	return true;

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

* [tip:perf/core] perf tests ARM: Disable breakpoint tests 32-bit
  2018-12-03 19:11 [PATCH v3] perf: tests: Disable breakpoint tests on ARM (32-bit) Florian Fainelli
  2018-12-04 14:06 ` Will Deacon
  2018-12-14 20:39 ` [tip:perf/core] perf tests ARM: Disable breakpoint tests 32-bit tip-bot for Florian Fainelli
@ 2018-12-18 14:06 ` tip-bot for Florian Fainelli
  2 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Florian Fainelli @ 2018-12-18 14:06 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: jolsa, namhyung, will.deacon, mingo, f.fainelli, tglx, acme,
	alexander.shishkin, hpa, linux-kernel, peterz

Commit-ID:  24f967337f6d6bce931425769c0f5ff5cf2d212e
Gitweb:     https://git.kernel.org/tip/24f967337f6d6bce931425769c0f5ff5cf2d212e
Author:     Florian Fainelli <f.fainelli@gmail.com>
AuthorDate: Mon, 3 Dec 2018 11:11:36 -0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 17 Dec 2018 14:56:27 -0300

perf tests ARM: Disable breakpoint tests 32-bit

The breakpoint tests on the ARM 32-bit kernel are broken in several
ways.

The breakpoint length requested does not necessarily match whether the
function address has the Thumb bit (bit 0) set or not, and this does
matter to the ARM kernel hw_breakpoint infrastructure. See [1] for
background.

[1]: https://lkml.org/lkml/2018/11/15/205

As Will indicated, the overflow handling would require single-stepping
which is not supported at the moment. Just disable those tests for the
ARM 32-bit platforms and update the comment above to explain these
limitations.

Co-developed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20181203191138.2419-1-f.fainelli@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/bp_signal.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c
index a467615c5a0e..910e25e64188 100644
--- a/tools/perf/tests/bp_signal.c
+++ b/tools/perf/tests/bp_signal.c
@@ -291,12 +291,20 @@ int test__bp_signal(struct test *test __maybe_unused, int subtest __maybe_unused
 
 bool test__bp_signal_is_supported(void)
 {
-/*
- * The powerpc so far does not have support to even create
- * instruction breakpoint using the perf event interface.
- * Once it's there we can release this.
- */
-#if defined(__powerpc__) || defined(__s390x__)
+	/*
+	 * PowerPC and S390 do not support creation of instruction
+	 * breakpoints using the perf_event interface.
+	 *
+	 * ARM requires explicit rounding down of the instruction
+	 * pointer in Thumb mode, and then requires the single-step
+	 * to be handled explicitly in the overflow handler to avoid
+	 * stepping into the SIGIO handler and getting stuck on the
+	 * breakpointed instruction.
+	 *
+	 * Just disable the test for these architectures until these
+	 * issues are resolved.
+	 */
+#if defined(__powerpc__) || defined(__s390x__) || defined(__arm__)
 	return false;
 #else
 	return true;

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

end of thread, other threads:[~2018-12-18 14:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-03 19:11 [PATCH v3] perf: tests: Disable breakpoint tests on ARM (32-bit) Florian Fainelli
2018-12-04 14:06 ` Will Deacon
2018-12-04 14:12   ` Arnaldo Carvalho de Melo
2018-12-14 20:39 ` [tip:perf/core] perf tests ARM: Disable breakpoint tests 32-bit tip-bot for Florian Fainelli
2018-12-18 14:06 ` tip-bot for Florian Fainelli

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).