Gleb Natapov wrote on 2013-01-23: > On Wed, Jan 23, 2013 at 12:45:39AM +0000, Zhang, Yang Z wrote: >>> We are getting close so please test with userspace irq chip too. >> Thanks for your suggestion to test with userspace irqchip. I found some >> issues and will modify the logic: As we known, APICv deponds on TPR >> shadow. But TPR shadow is per VM(it will > be disabled when VM uses userspace irq chip), this means APICv also is per VM. > But in current implementation, we use the global variable enable_apicv_reg to > check whether APICv is used by target vcpu. This is wrong. Instead, it should to > read VMCS to see whether the bit is set or not. >> > No, the apicv and TPR shadow are global for all VMs with irq chip in > kernel and VMs without irq chip in kernel skip APIC that code entirely. > If there is generic code that should behave differently with or without > in-kernel irq chip make the check for the condition there. Yes, check irqchip_in_kernel is enough. No need to check the bits in vmcs. Like this: static int vmx_vcpu_has_apicv(struct kvm *kvm) { return enable_apicv_reg_vid && irqchip_in_kernel(kvm); } Best regards, Yang -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html