[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1516279269.4937.125.camel@infradead.org>
Date: Thu, 18 Jan 2018 13:41:09 +0100
From: David Woodhouse <dwmw2@...radead.org>
To: Andi Kleen <andi@...stfloor.org>, tglx@...utronix.de
Cc: linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
torvalds@...ux-foundation.org, arjan@...ux.intel.com,
dave.hansen@...el.com, Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH] x86/retpoline: Optimize inline assembler for
vmexit_fill_RSB
On Wed, 2018-01-17 at 14:53 -0800, Andi Kleen wrote:
> From: Andi Kleen <ak@...ux.intel.com>
>
> I was looking at the generated assembler for the C fill RSB
> inline asm operations, and noticed several issues:
>
> - The C code sets up the loop register, which
> is then immediately overwritten in __FILL_RETURN_BUFFER
> with the same value again.
>
> - The C code also passes in the iteration count
> in another register, which is not used at all.
>
> Remove these two unnecessary operations. Just rely on
> the single constant passed to the macro for the iterations.
>
> This eliminates several instructions and avoids unnecessarily
> clobbering a register.
>
> Signed-off-by: Andi Kleen <ak@...ux.intel.com>
We still clobber the register, but you're right it's now filled in the
__FILL_RETURN_BUFFER macro itself. It was a previous iteration which
had the loop count passed in.
Acked-by: David Woodhouse <dwmw@...zon.co.uk>
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (5213 bytes)
Powered by blists - more mailing lists