[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: Tianyu Lan <ltykernel@xxxxxxxxx>
- From: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
- Date: Thu, 5 Aug 2021 16:23:41 +0200
- Cc: Dave Hansen <dave.hansen@xxxxxxxxx>, 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 14:24:36 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Aug 05, 2021 at 10:05:17PM +0800, Tianyu Lan wrote:
> static int __set_memory_enc_dec(unsigned long addr, int numpages, bool enc)
> {
> + return static_call(x86_set_memory_enc)(addr, numpages, enc);
> }
Hurpmh... So with a bit of 'luck' you get code-gen like:
__set_memory_enc_dec:
jmp __SCT_x86_set_memory_enc;
set_memory_encrypted:
mov $1, %rdx
jmp __set_memory_enc_dec
set_memory_decrypted:
mov $0, %rdx
jmp __set_memory_enc_dec
Which, to me, seems exceedingly daft. Best to make all 3 of those
inlines and use EXPORT_STATIC_CALL_TRAMP_GPL(x86_set_memory_enc) or
something.
This is assuming any of this is actually performance critical, based off
of this using static_call() to begin with.
|