From owner-svn-src-all@FreeBSD.ORG Wed Apr 1 20:36:08 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0C46A62; Wed, 1 Apr 2015 20:36:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC0AD74B; Wed, 1 Apr 2015 20:36:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t31Ka7dW089917; Wed, 1 Apr 2015 20:36:07 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t31Ka7p8089916; Wed, 1 Apr 2015 20:36:07 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201504012036.t31Ka7p8089916@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Wed, 1 Apr 2015 20:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280968 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 20:36:08 -0000 Author: tychon Date: Wed Apr 1 20:36:07 2015 New Revision: 280968 URL: https://svnweb.freebsd.org/changeset/base/280968 Log: Prior to aborting due to an instruction emulation error, it is always interesting to see what the guest's %rip and instruction bytes are. Reviewed by: grehan Modified: head/usr.sbin/bhyve/bhyverun.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Wed Apr 1 20:14:00 2015 (r280967) +++ head/usr.sbin/bhyve/bhyverun.c Wed Apr 1 20:36:07 2015 (r280968) @@ -495,22 +495,27 @@ vmexit_mtrap(struct vmctx *ctx, struct v static int vmexit_inst_emul(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) { - int err; + int err, i; + struct vie *vie; + stats.vmexit_inst_emul++; + vie = &vmexit->u.inst_emul.vie; err = emulate_mem(ctx, *pvcpu, vmexit->u.inst_emul.gpa, - &vmexit->u.inst_emul.vie, &vmexit->u.inst_emul.paging); + vie, &vmexit->u.inst_emul.paging); if (err) { - if (err == EINVAL) { - fprintf(stderr, - "Failed to emulate instruction at 0x%lx\n", - vmexit->rip); - } else if (err == ESRCH) { + if (err == ESRCH) { fprintf(stderr, "Unhandled memory access to 0x%lx\n", vmexit->u.inst_emul.gpa); } + fprintf(stderr, "Failed to emulate instruction ["); + for (i = 0; i < vie->num_valid; i++) { + fprintf(stderr, "0x%02x%s", vie->inst[i], + i != (vie->num_valid - 1) ? " " : ""); + } + fprintf(stderr, "] at 0x%lx\n", vmexit->rip); return (VMEXIT_ABORT); }