On Thu, Apr 06, 2017 at 06:18:33PM +0000, Xu, Anthony wrote: > > > --- a/kvm-all.c > > > +++ b/kvm-all.c > > > @@ -2232,6 +2232,10 @@ int kvm_has_sync_mmu(void) > > > return kvm_check_extension(kvm_state, KVM_CAP_SYNC_MMU); > > > } > > > > > > +int kvm_has_vapic(void){ > > > + return !kvm_check_extension(kvm_state, KVM_CAP_VAPIC); > > > +} > > > + > > > > Is that function shouldn't return true if KVM is providing VAPIC > > capability? > > > > It should, but it doesn't. see below KVM kernel code segment, > it returns false if KVM provides VAPIC.
I think we shouldn't read it like that. It seems that KVM is always returning the VAPIC capability except when the CPU is providing a special acceleration [0]. I would say you can't really refer yourself at this bit to enable or not kvmapic in QEMU. Does that make sense? [0] https://git.kernel.org/pub/scm/virt/kvm/kvm.git/commit/?id=774ead3ad9bcbc05ef6aaebb9bdf8b4c3126923b > Thanks for your comments, > > Will resend the patch. > > > Anthony > > > > arch/x86/kvm/x86.c > > case KVM_CAP_VAPIC: > r = !kvm_x86_ops->cpu_has_accelerated_tpr(); > break; >