[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V2 03/14] x86/set_memory: Add x86_set_memory_enc static call support
- To: Dave Hansen <dave.hansen@xxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>
- From: Tianyu Lan <ltykernel@xxxxxxxxx>
- Date: Thu, 5 Aug 2021 23:51:43 +0800
- Cc: kys@xxxxxxxxxxxxx, haiyangz@xxxxxxxxxxxxx, sthemmin@xxxxxxxxxxxxx, wei.liu@xxxxxxxxxx, decui@xxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, x86@xxxxxxxxxx, hpa@xxxxxxxxx, dave.hansen@xxxxxxxxxxxxxxx, luto@xxxxxxxxxx, konrad.wilk@xxxxxxxxxx, boris.ostrovsky@xxxxxxxxxx, jgross@xxxxxxxx, sstabellini@xxxxxxxxxx, joro@xxxxxxxxxx, will@xxxxxxxxxx, davem@xxxxxxxxxxxxx, kuba@xxxxxxxxxx, jejb@xxxxxxxxxxxxx, martin.petersen@xxxxxxxxxx, arnd@xxxxxxxx, hch@xxxxxx, m.szyprowski@xxxxxxxxxxx, robin.murphy@xxxxxxx, Tianyu.Lan@xxxxxxxxxxxxx, rppt@xxxxxxxxxx, kirill.shutemov@xxxxxxxxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, brijesh.singh@xxxxxxx, thomas.lendacky@xxxxxxx, pgonda@xxxxxxxxxx, david@xxxxxxxxxx, krish.sadhukhan@xxxxxxxxxx, saravanand@xxxxxx, aneesh.kumar@xxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, martin.b.radev@xxxxxxxxx, ardb@xxxxxxxxxx, rientjes@xxxxxxxxxx, tj@xxxxxxxxxx, keescook@xxxxxxxxxxxx, michael.h.kelley@xxxxxxxxxxxxx, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-hyperv@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, vkuznets@xxxxxxxxxx, parri.andrea@xxxxxxxxx
- Delivery-date: Thu, 05 Aug 2021 15:52:13 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 8/5/2021 10:29 PM, Dave Hansen wrote:
On 8/5/21 7:23 AM, Peter Zijlstra wrote:
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.
|