Skip to content

Commit f7eea63

Browse files
committed
KVM: nVMX: handle page fault in vmread
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: [email protected] Signed-off-by: Paolo Bonzini <[email protected]>
1 parent a7f8961 commit f7eea63

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/x86/kvm/vmx/nested.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4540,6 +4540,7 @@ static int handle_vmread(struct kvm_vcpu *vcpu)
45404540
int len;
45414541
gva_t gva = 0;
45424542
struct vmcs12 *vmcs12;
4543+
struct x86_exception e;
45434544
short offset;
45444545

45454546
if (!nested_vmx_check_permission(vcpu))
@@ -4588,7 +4589,8 @@ static int handle_vmread(struct kvm_vcpu *vcpu)
45884589
vmx_instruction_info, true, len, &gva))
45894590
return 1;
45904591
/* _system ok, nested_vmx_check_permission has verified cpl=0 */
4591-
kvm_write_guest_virt_system(vcpu, gva, &field_value, len, NULL);
4592+
if (kvm_write_guest_virt_system(vcpu, gva, &field_value, len, &e))
4593+
kvm_inject_page_fault(vcpu, &e);
45924594
}
45934595

45944596
return nested_vmx_succeed(vcpu);

0 commit comments

Comments
 (0)