On 06/05/20 01:22, Oliver Upton wrote: > vmx_guest_apic_has_interrupt implicitly depends on the virtual APIC > page being present + mapped into the kernel address space. Normally, > upon VMLAUNCH/VMRESUME, we get the vmcs12 pages directly. However, if a > live migration were to occur before reaching vcpu_block, the virtual > APIC will not be restored on the target host. > > Fix this by getting vmcs12 pages before inspecting the virtual APIC > page. Do you have a selftests testcase? > > + /* > + * We must first get the vmcs12 pages before checking for interrupts > + * (done in kvm_arch_vcpu_runnable) in case L1 is using > + * virtual-interrupt delivery. > + */ > + if (kvm_check_request(KVM_REQ_GET_VMCS12_PAGES, vcpu)) { > + if (unlikely(!kvm_x86_ops.nested_ops->get_vmcs12_pages(vcpu))) > + return 0; > + } > + The patch is a bit ad hoc, I'd rather move the whole "if (kvm_request_pending(vcpu))" from vcpu_enter_guest to vcpu_run (via a new function). Thanks, Paolo