[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170620235858.GM17588@ram.oc3035372033.ibm.com>
Date: Tue, 20 Jun 2017 16:58:58 -0700
From: Ram Pai <linuxram@...ibm.com>
To: Anshuman Khandual <khandual@...ux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@...erman.id.au>,
linux-kernel@...r.kernel.org, dave.hansen@...el.com,
paulus@...ba.org, aneesh.kumar@...ux.vnet.ibm.com,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [RFC v2 10/12] powerpc: Read AMR only if pkey-violation caused
the exception.
On Tue, Jun 20, 2017 at 12:16:40PM +0530, Anshuman Khandual wrote:
> On 06/19/2017 11:29 PM, Ram Pai wrote:
> > On Mon, Jun 19, 2017 at 09:06:13PM +1000, Michael Ellerman wrote:
> >> Ram Pai <linuxram@...ibm.com> writes:
> >>
> >>> Signed-off-by: Ram Pai <linuxram@...ibm.com>
> >>> ---
> >>> arch/powerpc/kernel/exceptions-64s.S | 16 ++++++++++------
> >>> 1 file changed, 10 insertions(+), 6 deletions(-)
> >>>
> >>> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
> >>> index 8db9ef8..a4de1b4 100644
> >>> --- a/arch/powerpc/kernel/exceptions-64s.S
> >>> +++ b/arch/powerpc/kernel/exceptions-64s.S
> >>> @@ -493,13 +493,15 @@ EXC_COMMON_BEGIN(data_access_common)
> >>> ld r12,_MSR(r1)
> >>> ld r3,PACA_EXGEN+EX_DAR(r13)
> >>> lwz r4,PACA_EXGEN+EX_DSISR(r13)
> >>> + std r3,_DAR(r1)
> >>> + std r4,_DSISR(r1)
> >>> #ifdef CONFIG_PPC64_MEMORY_PROTECTION_KEYS
> >>> + andis. r0,r4,DSISR_KEYFAULT@h /* save AMR only if its a key fault */
> >>> + beq+ 1f
> >>
> >> This seems to be incremental on top of one of your other patches.
> >>
> >> But I don't see why, can you please just squash this into whatever patch
> >> adds this code in the first place.
> >
> > It was an optimization added later. But yes it can be squashed into an
> > earlier patch.
>
> Could you please explain what is the optimization this achieves ?
Don't want to read the AMR if it is not a key protection fault. This is a hot-hot-path.
A few cycles saved can accumulate into signficant savings overall.
RP
Powered by blists - more mailing lists