Re: [PATCH] kvm: nVMX: Set VM instruction error for VMPTRLD of unbacked page

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

 



Hi Konrad,

I don't expect any hypervisor to do this, but I'll see if I can put
together a unit test.

On Wed, May 30, 2018 at 11:19 AM, Konrad Rzeszutek Wilk
<konrad.wilk@xxxxxxxxxx> wrote:
> On Wed, May 30, 2018 at 11:10:50AM -0700, Jim Mattson wrote:
>> It is never correct for a VMX instruction to fail with "invalid VMCS"
>> if there is, in fact, a current VMCS. Reads from unbacked addresses
>> return all 1's, which means that an unbacked VMCS will not have the
>> correct VMCS revision ID.
>
> Yikes.
>
> Is there a particular Hypervisor that does this? Would it make sense
> to also have some kiund of test-cases?
>
>>
>> Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
>> ---
>>  arch/x86/kvm/vmx.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>> index e50beb76d846..705a5afe5374 100644
>> --- a/arch/x86/kvm/vmx.c
>> +++ b/arch/x86/kvm/vmx.c
>> @@ -8348,7 +8348,8 @@ static int handle_vmptrld(struct kvm_vcpu *vcpu)
>>               struct page *page;
>>               page = kvm_vcpu_gpa_to_page(vcpu, vmptr);
>>               if (is_error_page(page)) {
>> -                     nested_vmx_failInvalid(vcpu);
>> +                     nested_vmx_failValid(vcpu,
>> +                             VMXERR_VMPTRLD_INCORRECT_VMCS_REVISION_ID);
>>                       return kvm_skip_emulated_instruction(vcpu);
>>               }
>>               new_vmcs12 = kmap(page);
>> --
>> 2.17.0.921.gf22659ad46-goog
>>



[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