diff options
author | neel <neel@FreeBSD.org> | 2015-04-30 21:00:47 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2015-04-30 21:00:47 +0000 |
commit | f57c0156d390ee2e998358bb565810bd95cc87bb (patch) | |
tree | c351f90abcbf1fadb949c5e8f8b759ac2377bfdc /sys/amd64/vmm/vmm.c | |
parent | a8aa6f11aef982f8430510c4a314136a2abcd692 (diff) | |
download | FreeBSD-src-f57c0156d390ee2e998358bb565810bd95cc87bb.zip FreeBSD-src-f57c0156d390ee2e998358bb565810bd95cc87bb.tar.gz |
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
Diffstat (limited to 'sys/amd64/vmm/vmm.c')
-rw-r--r-- | sys/amd64/vmm/vmm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 6bd5bce..bca9b98 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -1293,8 +1293,12 @@ vm_handle_inst_emul(struct vm *vm, int vcpuid, bool *retu) 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 |