From owner-svn-src-all@freebsd.org Wed Apr 15 02:34:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A0EC2A8771; Wed, 15 Apr 2020 02:34:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4925zT0lfdz47kl; Wed, 15 Apr 2020 02:34:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14F8EFD19; Wed, 15 Apr 2020 02:34:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03F2YiU0026325; Wed, 15 Apr 2020 02:34:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03F2YiHk026324; Wed, 15 Apr 2020 02:34:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202004150234.03F2YiHk026324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 15 Apr 2020 02:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359951 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 359951 X-SVN-Commit-Repository: base 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.29 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, 15 Apr 2020 02:34:45 -0000 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); }