lkml.org 
[lkml]   [2024]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v19 043/130] KVM: TDX: create/free TDX vcpu structure
    On Thu, Mar 21, 2024 at 09:30:12AM +0800,
    Chao Gao <chao.gao@intel.com> wrote:

    > >+int tdx_vcpu_create(struct kvm_vcpu *vcpu)
    > >+{
    > >+ struct kvm_tdx *kvm_tdx = to_kvm_tdx(vcpu->kvm);
    > >+
    > >+ WARN_ON_ONCE(vcpu->arch.cpuid_entries);
    > >+ WARN_ON_ONCE(vcpu->arch.cpuid_nent);
    > >+
    > >+ /* TDX only supports x2APIC, which requires an in-kernel local APIC. */
    >
    > Cannot QEMU emulate x2APIC? In my understanding, the reason is TDX module always
    > enables APICv for TDs. So, KVM cannot intercept every access to APIC and forward
    > them to QEMU for emulation.

    You're right. Let me update it as follows.

    /*
    * TDX module always enables APICv for TDs. So, KVM cannot intercept every
    * access to APIC and forward them to user space VMM.
    */



    > >+ if (!vcpu->arch.apic)
    >
    > will "if (!irqchip_in_kernel(vcpu->kvm))" work? looks this is the custome for such
    > a check.


    It should work because kvm_arch_vcpu_create(). Will update it.
    --
    Isaku Yamahata <isaku.yamahata@intel.com>

    \
     
     \ /
      Last update: 2024-05-27 15:58    [W:2.314 / U:0.492 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site