[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YQv0bRBUq1N5+jgG@hirez.programming.kicks-ass.net>
Date: Thu, 5 Aug 2021 16:23:41 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Tianyu Lan <ltykernel@...il.com>
Cc: Dave Hansen <dave.hansen@...el.com>, kys@...rosoft.com,
haiyangz@...rosoft.com, sthemmin@...rosoft.com, wei.liu@...nel.org,
decui@...rosoft.com, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, x86@...nel.org, hpa@...or.com,
dave.hansen@...ux.intel.com, luto@...nel.org,
konrad.wilk@...cle.com, boris.ostrovsky@...cle.com,
jgross@...e.com, sstabellini@...nel.org, joro@...tes.org,
will@...nel.org, davem@...emloft.net, kuba@...nel.org,
jejb@...ux.ibm.com, martin.petersen@...cle.com, arnd@...db.de,
hch@....de, m.szyprowski@...sung.com, robin.murphy@....com,
Tianyu.Lan@...rosoft.com, rppt@...nel.org,
kirill.shutemov@...ux.intel.com, akpm@...ux-foundation.org,
brijesh.singh@....com, thomas.lendacky@....com, pgonda@...gle.com,
david@...hat.com, krish.sadhukhan@...cle.com, saravanand@...com,
aneesh.kumar@...ux.ibm.com, xen-devel@...ts.xenproject.org,
martin.b.radev@...il.com, ardb@...nel.org, rientjes@...gle.com,
tj@...nel.org, keescook@...omium.org,
michael.h.kelley@...rosoft.com, iommu@...ts.linux-foundation.org,
linux-arch@...r.kernel.org, linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
netdev@...r.kernel.org, vkuznets@...hat.com, parri.andrea@...il.com
Subject: Re: [PATCH V2 03/14] x86/set_memory: Add x86_set_memory_enc static
call support
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.
Powered by blists - more mailing lists