[PATCH 2/4] powerpc/64: remove support for kernel-mode syscalls

Nicholas Piggin npiggin at gmail.com
Tue Aug 27 20:20:27 AEST 2019


Christophe Leroy's on August 27, 2019 4:13 pm:
> 
> 
> Le 27/08/2019 à 05:30, Nicholas Piggin a écrit :
>> There is support for the kernel to execute the 'sc 0' instruction and
>> make a system call to itself. This is a relic that is unused in the
>> tree, therefore untested. It's also highly questionable for modules to
>> be doing this.
> 
> I like it.
> 
> I dropped support for that in PPC32 when I added fast-path syscalls.

Good, then we'll match again.

>> -	beq	2f			/* if from kernel mode */
>>   #ifdef CONFIG_PPC_FSL_BOOK3E
>>   START_BTB_FLUSH_SECTION
>>   	BTB_FLUSH(r10)
>>   END_BTB_FLUSH_SECTION
>>   #endif
>>   	ACCOUNT_CPU_USER_ENTRY(r13, r10, r11)
>> -2:	std	r2,GPR2(r1)

Btw. there is a hunk which restores this optimisation but it leaked
into a later patch, I'll move it back here.

>> @@ -122,14 +118,13 @@ END_BTB_FLUSH_SECTION
>>   
>>   #if defined(CONFIG_VIRT_CPU_ACCOUNTING_NATIVE) && defined(CONFIG_PPC_SPLPAR)
>>   BEGIN_FW_FTR_SECTION
>> -	beq	33f
>> -	/* if from user, see if there are any DTL entries to process */
>> +	/* see if there are any DTL entries to process */
>>   	ld	r10,PACALPPACAPTR(r13)	/* get ptr to VPA */
>>   	ld	r11,PACA_DTL_RIDX(r13)	/* get log read index */
>>   	addi	r10,r10,LPPACA_DTLIDX
>>   	LDX_BE	r10,0,r10		/* get log write index */
>> -	cmpd	cr1,r11,r10
>> -	beq+	cr1,33f
>> +	cmpd	r11,r10
>> +	beq+	33f
> 
> Any need to do this change ? Why not keep it as is ?

We don't need to keep cr0 alive with the MSR_PR compare, so I prefer
to keep the cr usage more compact, and I prefer to have cr0 for short
lived results and others for long running ones as a rule.

Thanks,
Nick


More information about the Linuxppc-dev mailing list