Re: [PATCH] kvm: x86: get vmcs12 pages before checking pending interrupts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux