提交 73c31bd9 编写于 作者: P Paolo Bonzini 提交者: Greg Kroah-Hartman

KVM: nVMX: handle page fault in vmread

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.

Cc: stable@vger.kernel.org
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6e60900c
...@@ -8757,6 +8757,7 @@ static int handle_vmread(struct kvm_vcpu *vcpu) ...@@ -8757,6 +8757,7 @@ static int handle_vmread(struct kvm_vcpu *vcpu)
u32 vmx_instruction_info = vmcs_read32(VMX_INSTRUCTION_INFO); u32 vmx_instruction_info = vmcs_read32(VMX_INSTRUCTION_INFO);
gva_t gva = 0; gva_t gva = 0;
struct vmcs12 *vmcs12; struct vmcs12 *vmcs12;
struct x86_exception e;
if (!nested_vmx_check_permission(vcpu)) if (!nested_vmx_check_permission(vcpu))
return 1; return 1;
...@@ -8798,8 +8799,10 @@ static int handle_vmread(struct kvm_vcpu *vcpu) ...@@ -8798,8 +8799,10 @@ static int handle_vmread(struct kvm_vcpu *vcpu)
vmx_instruction_info, true, &gva)) vmx_instruction_info, true, &gva))
return 1; return 1;
/* _system ok, nested_vmx_check_permission has verified cpl=0 */ /* _system ok, nested_vmx_check_permission has verified cpl=0 */
kvm_write_guest_virt_system(vcpu, gva, &field_value, if (kvm_write_guest_virt_system(vcpu, gva, &field_value,
(is_long_mode(vcpu) ? 8 : 4), NULL); (is_long_mode(vcpu) ? 8 : 4),
NULL))
kvm_inject_page_fault(vcpu, &e);
} }
nested_vmx_succeed(vcpu); nested_vmx_succeed(vcpu);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册