lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1437108065.29389.6.camel@ellerman.id.au>
Date:	Fri, 17 Jul 2015 14:41:05 +1000
From:	Michael Ellerman <mpe@...erman.id.au>
To:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc:	linuxppc-dev@...abs.org, wad@...omium.org, keescook@...omium.org,
	linux-kernel@...r.kernel.org, luto@...capital.net,
	strosake@...ux.vnet.ibm.com, bogdan.purcareata@...escale.com
Subject: Re: [RFC PATCH 01/12] powerpc/kernel: Get pt_regs from r9 before
 calling do_syscall_trace_enter()

On Fri, 2015-07-17 at 08:40 +1000, Benjamin Herrenschmidt wrote:
> On Wed, 2015-07-15 at 17:37 +1000, Michael Ellerman wrote:
> > To call do_syscall_trace_enter() we need pt_regs in r3, but we don't need
> > to recalculate it based on r1, it's already in r9.
> > 
> > Signed-off-by: Michael Ellerman <mpe@...erman.id.au>
> 
> Is there any performance difference ?

No.

I'm not going to bother measuring it :)

> I find the addi a bit more robust in case the code gets moved around or
> the "previous" code gets changed to either not use r9 or clobber it,
> which would have the potential to
> introduce a subtle bug ...

Yeah true.

There is an "invariant" in that entry code that r9 contains pt_regs, you can
see for example the DTL code goes to pains to ensure it puts pt_regs back in r9
after it clobbers it. As does the current syscall_dotrace.

But looking closer I don't see where we actually use that (prior to this
patch).

So yeah I'll drop this and send a clean up to just get rid of all the r9
reloading.

cheers



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ