lkml.org 
[lkml]   [2019]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 3.16 74/83] KVM: nVMX: handle page fault in vmread
    3.16.78-rc1 review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Paolo Bonzini <pbonzini@redhat.com>

    commit f7eea636c3d505fe6f1d1066234f1aaf7171b681 upstream.

    The implementation of vmread to memory is still incomplete, as it
    lacks the ability to do vmread to I/O memory just like vmptrst.

    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    [bwh: Backported to 3.16: adjust context]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    arch/x86/kvm/vmx.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    --- a/arch/x86/kvm/vmx.c
    +++ b/arch/x86/kvm/vmx.c
    @@ -6426,6 +6426,7 @@ static int handle_vmread(struct kvm_vcpu
    unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
    u32 vmx_instruction_info = vmcs_read32(VMX_INSTRUCTION_INFO);
    gva_t gva = 0;
    + struct x86_exception e;

    if (!nested_vmx_check_permission(vcpu) ||
    !nested_vmx_check_vmcs12(vcpu))
    @@ -6452,8 +6453,10 @@ static int handle_vmread(struct kvm_vcpu
    vmx_instruction_info, &gva))
    return 1;
    /* _system ok, as nested_vmx_check_permission verified cpl=0 */
    - kvm_write_guest_virt_system(vcpu, gva, &field_value,
    - (is_long_mode(vcpu) ? 8 : 4), NULL);
    + if (kvm_write_guest_virt_system(vcpu, gva, &field_value,
    + (is_long_mode(vcpu) ? 8 : 4),
    + &e))
    + kvm_inject_page_fault(vcpu, &e);
    }

    nested_vmx_succeed(vcpu);
    \
     
     \ /
      Last update: 2019-11-20 16:43    [W:4.613 / U:0.048 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site