From 2992381f30211b3b950ed06343e3ef6642935b50 Mon Sep 17 00:00:00 2001 From: mlarkin Date: Tue, 30 May 2017 12:48:01 +0000 Subject: [PATCH] print more useful information when an error is returned from uvm_fault when processing NPT/EPT violations --- sys/arch/amd64/amd64/vmm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c index f44321c6415..0daf85e1a3f 100644 --- a/sys/arch/amd64/amd64/vmm.c +++ b/sys/arch/amd64/amd64/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.147 2017/05/30 04:45:38 mlarkin Exp $ */ +/* $OpenBSD: vmm.c,v 1.148 2017/05/30 12:48:01 mlarkin Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -4323,7 +4323,8 @@ svm_fault_page(struct vcpu *vcpu, paddr_t gpa) ret = uvm_fault(vcpu->vc_parent->vm_map, gpa, fault_type, PROT_READ | PROT_WRITE | PROT_EXEC); if (ret) - printf("svm_fault_page: uvm_fault returns %d\n", ret); + printf("%s: uvm_fault returns %d, GPA=0x%llx, rip=0x%llx\n", + __func__, ret, (uint64_t)gpa, vcpu->vc_gueststate.vg_rip); return (ret); } @@ -4380,7 +4381,8 @@ vmx_fault_page(struct vcpu *vcpu, paddr_t gpa) PROT_READ | PROT_WRITE | PROT_EXEC); if (ret) - printf("%s: uvm_fault returns %d\n", __func__, ret); + printf("%s: uvm_fault returns %d, GPA=0x%llx, rip=0x%llx\n", + __func__, ret, (uint64_t)gpa, vcpu->vc_gueststate.vg_rip); return (ret); } -- 2.20.1