All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] selftests/powerpc: Abort load_unaligned_zeropad on unhandled SEGV
@ 2016-11-03  4:41 Michael Ellerman
  2016-11-03  4:41 ` [PATCH 2/2] selftests/powerpc: Fail load_unaligned_zeropad on miscompare Michael Ellerman
  2016-11-14 12:17 ` [1/2] selftests/powerpc: Abort load_unaligned_zeropad on unhandled SEGV Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Ellerman @ 2016-11-03  4:41 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: anton

If the load unaligned zeropad test takes a SEGV which can't be handled,
we increment segv_error, print the offending NIP and then return without
taking any further action. In almost all cases this means we'll just
take the SEGV again, and loop eternally spamming the console.

Instead just abort(), it's a fatal error in the test. The test harness
will notice that the child died and print a nice message for us.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c b/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c
index 6cae06117b55..cf7a4a114a90 100644
--- a/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c
+++ b/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c
@@ -73,7 +73,6 @@ extern char __stop___ex_table[];
 #error implement UCONTEXT_NIA
 #endif
 
-static int segv_error;
 
 static void segv_handler(int signr, siginfo_t *info, void *ptr)
 {
@@ -95,7 +94,7 @@ static void segv_handler(int signr, siginfo_t *info, void *ptr)
 	}
 
 	printf("No exception table match for NIA %lx ADDR %lx\n", *ip, addr);
-	segv_error++;
+	abort();
 }
 
 static void setup_segv_handler(void)
@@ -145,8 +144,6 @@ static int test_body(void)
 	for (i = 0; i < page_size; i++)
 		FAIL_IF(do_one_test(mem_region+i, i));
 
-	FAIL_IF(segv_error);
-
 	return 0;
 }
 
-- 
2.7.4

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

* [PATCH 2/2] selftests/powerpc: Fail load_unaligned_zeropad on miscompare
  2016-11-03  4:41 [PATCH 1/2] selftests/powerpc: Abort load_unaligned_zeropad on unhandled SEGV Michael Ellerman
@ 2016-11-03  4:41 ` Michael Ellerman
  2016-11-14 12:17   ` [2/2] " Michael Ellerman
  2016-11-14 12:17 ` [1/2] selftests/powerpc: Abort load_unaligned_zeropad on unhandled SEGV Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2016-11-03  4:41 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: anton

If the result returned by load_unaligned_zeropad() doesn't match what we
expect we should fail the test!

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c b/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c
index cf7a4a114a90..cd7af4e1b65a 100644
--- a/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c
+++ b/tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c
@@ -118,8 +118,10 @@ static int do_one_test(char *p, int page_offset)
 
 	got = load_unaligned_zeropad(p);
 
-	if (should != got)
+	if (should != got) {
 		printf("offset %u load_unaligned_zeropad returned 0x%lx, should be 0x%lx\n", page_offset, got, should);
+		return 1;
+	}
 
 	return 0;
 }
-- 
2.7.4

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

* Re: [1/2] selftests/powerpc: Abort load_unaligned_zeropad on unhandled SEGV
  2016-11-03  4:41 [PATCH 1/2] selftests/powerpc: Abort load_unaligned_zeropad on unhandled SEGV Michael Ellerman
  2016-11-03  4:41 ` [PATCH 2/2] selftests/powerpc: Fail load_unaligned_zeropad on miscompare Michael Ellerman
@ 2016-11-14 12:17 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: anton

On Thu, 2016-03-11 at 04:41:00 UTC, Michael Ellerman wrote:
> If the load unaligned zeropad test takes a SEGV which can't be handled,
> we increment segv_error, print the offending NIP and then return without
> taking any further action. In almost all cases this means we'll just
> take the SEGV again, and loop eternally spamming the console.
> 
> Instead just abort(), it's a fatal error in the test. The test harness
> will notice that the child died and print a nice message for us.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Applied to powerpc next.

https://git.kernel.org/powerpc/c/06236f4efb926aa433e2cb3e36e846

cheers

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

* Re: [2/2] selftests/powerpc: Fail load_unaligned_zeropad on miscompare
  2016-11-03  4:41 ` [PATCH 2/2] selftests/powerpc: Fail load_unaligned_zeropad on miscompare Michael Ellerman
@ 2016-11-14 12:17   ` Michael Ellerman
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2016-11-14 12:17 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: anton

On Thu, 2016-03-11 at 04:41:01 UTC, Michael Ellerman wrote:
> If the result returned by load_unaligned_zeropad() doesn't match what we
> expect we should fail the test!
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Applied to powerpc next.

https://git.kernel.org/powerpc/c/997e200182347d2cc7e37bc43eaafe

cheers

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

end of thread, other threads:[~2016-11-14 12:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-03  4:41 [PATCH 1/2] selftests/powerpc: Abort load_unaligned_zeropad on unhandled SEGV Michael Ellerman
2016-11-03  4:41 ` [PATCH 2/2] selftests/powerpc: Fail load_unaligned_zeropad on miscompare Michael Ellerman
2016-11-14 12:17   ` [2/2] " Michael Ellerman
2016-11-14 12:17 ` [1/2] selftests/powerpc: Abort load_unaligned_zeropad on unhandled SEGV Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.