Subject: Re: [PATCH 2/3] selftests/powerpc: Add test for forking inside transaction

From: Anshuman Khandual <[email-masked]>
Date: Tue, 01 Dec 2015 13:41:43 +0530

On 12/01/2015 10:38 AM, Rashmica Gupta wrote:
> +int test_fork(void)
> +{
> +	SKIP_IF(!have_htm());
> +
> +	asm __volatile__(
> +		"tbegin.;"
> +		"blt    1f; "
> +		"li     0, 2;"  /* fork syscall */
> +		"sc  ;"
> +		"tend.;"
> +		"1: ;"
> +		: : : "memory", "r0");
> +	/* If we reach here, we've passed.  Otherwise we've probably crashed
> +	 * the kernel */

The transaction inside the parent process will abort. What
is expected inside the child process ? Why should the kernel
crash ?