lkml.org 
[lkml]   [2020]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 3/3] x86/delay: Introduce TPAUSE delay
On Tue, Apr 14, 2020 at 06:00:21PM +0000, Luck, Tony wrote:
> >> +static inline void __tpause(u32 ecx, u32 edx, u32 eax)
> >> +{
> >> + /* "tpause %ecx, %edx, %eax;" */
> >> + asm volatile(".byte 0x66, 0x0f, 0xae, 0xf1\t\n"
> >> + :
> >> + : "c"(ecx), "d"(edx), "a"(eax));
> >> +}
> >
> > Can we please get a comment stating from what binutils version this
> > opcode has a mnemonic? That way, when we raise the minimum binutils
> > version we can easily grep and find such things.
>
> Or maybe use arch/x86/Kconfig.assembler to set up a CONFIG_AS_TPAUSE?
>
> Then the code can read something like (syntax may need fixing)
>
> #ifdef CONFIG_AS_TPAUSE
> asm volatile("tpause %ecx\n", : : "c"(ecx), "d"(edx), "a"(eax));
> #else
> asm volatile(".byte hex gibberish ...
> #endif

Then we still need a comment to know when we can kill that...

\
 
 \ /
  Last update: 2020-04-14 20:08    [W:0.493 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site