[PATCH] selftests/powerpc: add test to verify rfi flush across a system call

Michael Ellerman mpe at ellerman.id.au
Thu May 17 11:03:48 AEST 2018


"Naveen N. Rao" <naveen.n.rao at linux.vnet.ibm.com> writes:

> diff --git a/tools/testing/selftests/powerpc/utils.c b/tools/testing/selftests/powerpc/utils.c
> index d46916867a6f..c6b1d20ed3ba 100644
> --- a/tools/testing/selftests/powerpc/utils.c
> +++ b/tools/testing/selftests/powerpc/utils.c
> @@ -104,3 +111,149 @@ int pick_online_cpu(void)
>  	printf("No cpus in affinity mask?!\n");
>  	return -1;
>  }
...
> +
> +static void sigill_handler(int signr, siginfo_t *info, void *unused)
> +{
> +	static int warned = 0;
> +	ucontext_t *ctx = (ucontext_t *)unused;
> +	unsigned int *pc = (unsigned int *)ctx->uc_mcontext.gp_regs[PT_NIP];

The above doesn't work on 32-bit, and this code is sometimes built 32-bit.

For an example of how to handle 32 and 64-bit, see eg:

  tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c

cheers


More information about the Linuxppc-dev mailing list