svn commit: r359951 - head/usr.sbin/bhyve

Conrad Meyer cem at FreeBSD.org
Wed Apr 15 02:34:45 UTC 2020


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);
 	}
 


More information about the svn-src-all mailing list