lkml.org 
[lkml]   [2021]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 03/11] x86/cpufeatures: Add TDX Guest CPU feature
On Wed, Oct 06, 2021 at 08:43:48AM -0700, Kuppuswamy, Sathyanarayanan wrote:
> Yes. But, Joerg Roedel in his review recommended using variable
> similar to sme_me_mask to avoid function call in Intel platform in
> cc_platform_has().

That would normally make sense if this were a fast path. But I don't see
that being one. Besides, the subsequent runs will be the function call +
a couple of instructions:

# arch/x86/kernel/tdx.c:22: if (tdx_guest >= 0)
movl tdx_guest(%rip), %eax # tdx_guest,
testl %eax, %eax #
jns .L11 #,

...

.L11:
# arch/x86/kernel/tdx.c:23: return tdx_guest;
setne %al #, <retval>
# arch/x86/kernel/tdx.c:35: }
ret

which is not the end of the world.

And it if it is really used in a fast path, then we can do a static
branch etc.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

\
 
 \ /
  Last update: 2021-10-06 18:21    [W:2.092 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site