[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aca9277a-da65-ab0b-f499-28da1da112e8@redhat.com>
Date: Thu, 8 Jul 2021 17:29:09 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Isaku Yamahata <isaku.yamahata@...il.com>
Cc: isaku.yamahata@...el.com, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H . Peter Anvin" <hpa@...or.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, erdemaktas@...gle.com,
Connor Kuehl <ckuehl@...hat.com>,
Sean Christopherson <seanjc@...gle.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Sean Christopherson <sean.j.christopherson@...el.com>,
kernel test robot <lkp@...el.com>,
Xiaoyao Li <xiaoyao.li@...el.com>
Subject: Re: [RFC PATCH v2 55/69] KVM: VMX: Add 'main.c' to wrap VMX and TDX
On 08/07/21 17:21, Isaku Yamahata wrote:
> On Tue, Jul 06, 2021 at 04:43:22PM +0200,
> Paolo Bonzini <pbonzini@...hat.com> wrote:
>
>> On 03/07/21 00:05, isaku.yamahata@...el.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
Powered by blists - more mailing lists