Re: [PATCH v2 3/5] MIPS: Only change $28 to thread_info if coming from user mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 13 Dec 2016, Matt Redfearn wrote:

> diff --git a/arch/mips/include/asm/stackframe.h b/arch/mips/include/asm/stackframe.h
> index eebf39549606..e13164daf9c2 100644
> --- a/arch/mips/include/asm/stackframe.h
> +++ b/arch/mips/include/asm/stackframe.h
> @@ -216,12 +216,20 @@
>  		LONG_S	$25, PT_R25(sp)
>  		LONG_S	$28, PT_R28(sp)
>  		LONG_S	$31, PT_R31(sp)
> +
> +		/* Set thread_info if we're coming from user mode */
> +		mfc0	k0, CP0_STATUS
> +		sll	k0, 3		/* extract cu0 bit */
> +		bltz	k0, 9f
> +		 nop
> +

 Have you actually verified the machine code generated as expected with 
such a change?  This supposedly delay-slot NOP can be dropped as this is 
`.set reorder' code, so GAS will have scheduled a NOP itself already, 
having found there is an SLL->BLTZ data dependency and consequently the 
two instructions cannot be swapped.  So now there'll be an extraneous NOP 
there, wasting code space and execution time.

  Maciej




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux