lkml.org 
[lkml]   [2021]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] KVM: x86: allow KVM_REQ_GET_NESTED_STATE_PAGES outside guest mode for VMX
From
Date
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

\
 
 \ /
  Last update: 2021-01-25 21:45    [W:0.056 / U:1.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site