lkml.org 
[lkml]   [2021]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH v2 55/69] KVM: VMX: Add 'main.c' to wrap VMX and TDX
From
Date
On 08/07/21 17:21, Isaku Yamahata wrote:
> On Tue, Jul 06, 2021 at 04:43:22PM +0200,
> Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>> On 03/07/21 00:05, isaku.yamahata@intel.com wrote:
>>> +#include "vmx.c"
>>
>> What makes it particularly hard to have this as a separate .o file rather
>> than an #include?
>
> It's to let complier to optimize functionc call of "if (tdx) tdx_xxx() else vmx_xxx()",
> given x86_ops static call story.

As long as it's not an indirect call, not inlining tdx_xxx and vmx_xxx
is unlikely to give a lot of benefit.

What you could do, is use a static branch that bypasses the
"is_tdx_vcpu/vm" check if no TDX VM is running. A similar technique is
used to bypass the test for in-kernel APIC if all VM have it.

Paolo

\
 
 \ /
  Last update: 2021-07-08 17:30    [W:1.308 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site