Date: Wed, 15 Apr 2020 02:34:44 +0000 (UTC) From: Conrad Meyer <cem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359951 - head/usr.sbin/bhyve Message-ID: <202004150234.03F2YiHk026324@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cem Date: Wed Apr 15 02:34:44 2020 New Revision: 359951 URL: https://svnweb.freebsd.org/changeset/base/359951 Log: bhyve(8): Minor cosmetic niceties in instemul failure Print the failed instruction stream as a contiguous stream of hex. This is closer to something you could throw at a disassembler than 0xHH 0xHH 0xHH. Also, use the debug.h 'raw' stdio-aware printf helper to avoid the cascading line effect. Modified: head/usr.sbin/bhyve/bhyverun.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Wed Apr 15 02:00:17 2020 (r359950) +++ head/usr.sbin/bhyve/bhyverun.c Wed Apr 15 02:34:44 2020 (r359951) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include "bootrom.h" #include "inout.h" #include "dbgport.h" +#include "debug.h" #include "fwctl.h" #include "gdb.h" #include "ioapic.h" @@ -718,16 +719,14 @@ vmexit_inst_emul(struct vmctx *ctx, struct vm_exit *vm if (err) { if (err == ESRCH) { - fprintf(stderr, "Unhandled memory access to 0x%lx\n", + EPRINTLN("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); + fprintf(stderr, "Failed to emulate instruction sequence [ "); + for (i = 0; i < vie->num_valid; i++) + fprintf(stderr, "%02x", vie->inst[i]); + FPRINTLN(stderr, " ] at 0x%lx", vmexit->rip); return (VMEXIT_ABORT); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004150234.03F2YiHk026324>