Re: [PATCH] KVM: x86: allow KVM_REQ_GET_NESTED_STATE_PAGES outside guest mode for VMX

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

 



On 25/01/21 20:16, Sean Christopherson wrote:
  }
+static bool vmx_get_nested_state_pages(struct kvm_vcpu *vcpu)
+{
+	if (!nested_get_evmcs_page(vcpu))
+		return false;
+
+	if (is_guest_mode(vcpu) && !nested_get_vmcs12_pages(vcpu))
+		return false;
nested_get_evmcs_page() will get called twice in the common case of
is_guest_mode() == true.  I can't tell if that will ever be fatal, but it's
definitely weird.  Maybe this?

	if (!is_guest_mode(vcpu))
		return nested_get_evmcs_page(vcpu);

	return nested_get_vmcs12_pages(vcpu);


I wouldn't say there is a common case; however the idea was to remove the call to nested_get_evmcs_page from nested_get_vmcs12_pages, since that one is only needed after KVM_GET_NESTED_STATE and not during VMLAUNCH/VMRESUME.

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