Re: [PATCH V2 03/14] x86/set_memory: Add x86_set_memory_enc static call support

From
Tianyu Lan <hidden>
Date
2021-08-05 15:52:05
Also in
linux-arch, linux-iommu, linux-scsi, lkml, netdev, xen-devel
Reply to
Dave Hansen, 2021-08-05
On 8/5/2021 10:29 PM, Dave Hansen wrote:
On 8/5/21 7:23 AM, Peter Zijlstra wrote:
quoted
This is assuming any of this is actually performance critical, based off
of this using static_call() to begin with.
This code is not performance critical.

I think I sent folks off on a wild goose chase when I asked that we make
an effort to optimize code that does:

	if (some_hyperv_check())
		foo();

	if (some_amd_feature_check())
		bar();

with checks that will actually compile away when Hyper-V or
some_amd_feature() is disabled.  That's less about performance and just
about good hygiene.  I *wanted* to see
cpu_feature_enabled(X86_FEATURE...) checks.

Someone suggested using static calls, and off we went...

Could we please just use cpu_feature_enabled()?
Yes, cpu_feature_enabled() works. The target is just to run platform code after platform check. I will update this in the next version.
Thread (23 messages) 23 messages, 3 authors, last reply 2021-08-05
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help