[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1612150120400.6743@tp.orcam.me.uk>
Date: Thu, 15 Dec 2016 11:51:54 +0000
From: "Maciej W. Rozycki" <macro@...tec.com>
To: Matt Redfearn <matt.redfearn@...tec.com>
CC: Ralf Baechle <ralf@...ux-mips.org>, <linux-mips@...ux-mips.org>,
"Jason A . Donenfeld" <Jason@...c4.com>,
Thomas Gleixner <tglx@...utronix.de>,
<linux-kernel@...r.kernel.org>,
James Hogan <james.hogan@...tec.com>,
Paul Burton <paul.burton@...tec.com>
Subject: Re: [PATCH v2 3/5] MIPS: Only change $28 to thread_info if coming
from user mode
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
Powered by blists - more mailing lists