svn commit: r282284 - head/sys/amd64/vmm

Neel Natu neel at FreeBSD.org
Thu Apr 30 21:00:48 UTC 2015


Author: neel
Date: Thu Apr 30 21:00:47 2015
New Revision: 282284
URL: https://svnweb.freebsd.org/changeset/base/282284

Log:
  When an instruction cannot be decoded just return to userspace so bhyve(8)
  can dump the instruction bytes.
  
  Requested by:	grehan
  MFC after:	1 week

Modified:
  head/sys/amd64/vmm/vmm.c

Modified: head/sys/amd64/vmm/vmm.c
==============================================================================
--- head/sys/amd64/vmm/vmm.c	Thu Apr 30 20:50:42 2015	(r282283)
+++ head/sys/amd64/vmm/vmm.c	Thu Apr 30 21:00:47 2015	(r282284)
@@ -1293,8 +1293,12 @@ vm_handle_inst_emul(struct vm *vm, int v
 	else if (error != 0)
 		panic("%s: vmm_fetch_instruction error %d", __func__, error);
 
-	if (vmm_decode_instruction(vm, vcpuid, gla, cpu_mode, cs_d, vie) != 0)
-		return (EFAULT);
+	if (vmm_decode_instruction(vm, vcpuid, gla, cpu_mode, cs_d, vie) != 0) {
+		VCPU_CTR1(vm, vcpuid, "Error decoding instruction at %#lx",
+		    vme->rip + cs_base);
+		*retu = true;	    /* dump instruction bytes in userspace */
+		return (0);
+	}
 
 	/*
 	 * If the instruction length was not specified then update it now


More information about the svn-src-head mailing list