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

Rashmica rashmicy at gmail.com
Wed Dec 2 10:31:00 AEDT 2015


As far as I'm aware, the kernel used to crash when forking inside a 
transaction (see powerpc/tm: Fix crash when forking inside a 
transaction). So this is to check that the transaction aborts rather 
than your whole kernel crashing.

On 01/12/15 19:11, Anshuman Khandual wrote:
> 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 ?
>



More information about the Linuxppc-dev mailing list