aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bhyve/amd64/bhyverun_machdep.c1
-rw-r--r--usr.sbin/bhyve/amd64/vmexit.c14
-rw-r--r--usr.sbin/bhyve/bhyve_config.55
-rw-r--r--usr.sbin/trim/Makefile2
4 files changed, 16 insertions, 6 deletions
diff --git a/usr.sbin/bhyve/amd64/bhyverun_machdep.c b/usr.sbin/bhyve/amd64/bhyverun_machdep.c
index d51ad3a5fc05..85af124b5536 100644
--- a/usr.sbin/bhyve/amd64/bhyverun_machdep.c
+++ b/usr.sbin/bhyve/amd64/bhyverun_machdep.c
@@ -63,6 +63,7 @@ bhyve_init_config(void)
set_config_bool("acpi_tables_in_memory", true);
set_config_value("memory.size", "256M");
set_config_bool("x86.strictmsr", true);
+ set_config_bool("x86.verbosemsr", false);
set_config_value("lpc.fwcfg", "bhyve");
}
diff --git a/usr.sbin/bhyve/amd64/vmexit.c b/usr.sbin/bhyve/amd64/vmexit.c
index e0b9aec2d17a..944f5de34645 100644
--- a/usr.sbin/bhyve/amd64/vmexit.c
+++ b/usr.sbin/bhyve/amd64/vmexit.c
@@ -107,8 +107,11 @@ vmexit_rdmsr(struct vmctx *ctx __unused, struct vcpu *vcpu,
val = 0;
error = emulate_rdmsr(vcpu, vme->u.msr.code, &val);
if (error != 0) {
- EPRINTLN("rdmsr to register %#x on vcpu %d",
- vme->u.msr.code, vcpu_id(vcpu));
+ if (get_config_bool("x86.strictmsr") ||
+ get_config_bool("x86.verbosemsr")) {
+ EPRINTLN("rdmsr to register %#x on vcpu %d",
+ vme->u.msr.code, vcpu_id(vcpu));
+ }
if (get_config_bool("x86.strictmsr")) {
vm_inject_gp(vcpu);
return (VMEXIT_CONTINUE);
@@ -137,8 +140,11 @@ vmexit_wrmsr(struct vmctx *ctx __unused, struct vcpu *vcpu,
error = emulate_wrmsr(vcpu, vme->u.msr.code, vme->u.msr.wval);
if (error != 0) {
- EPRINTLN("wrmsr to register %#x(%#lx) on vcpu %d",
- vme->u.msr.code, vme->u.msr.wval, vcpu_id(vcpu));
+ if (get_config_bool("x86.strictmsr") ||
+ get_config_bool("x86.verbosemsr")) {
+ EPRINTLN("wrmsr to register %#x(%#lx) on vcpu %d",
+ vme->u.msr.code, vme->u.msr.wval, vcpu_id(vcpu));
+ }
if (get_config_bool("x86.strictmsr")) {
vm_inject_gp(vcpu);
return (VMEXIT_CONTINUE);
diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5
index 3f9d9130787b..3dd24ca5fe69 100644
--- a/usr.sbin/bhyve/bhyve_config.5
+++ b/usr.sbin/bhyve/bhyve_config.5
@@ -240,6 +240,11 @@ By default, writes are ignored and reads return all bits set.
Inject a general protection fault if a guest accesses a Model Specific
Register (MSR) that is not emulated.
If this is false, writes are ignored and reads return zero.
+.It Va x86.verbosemsr Ta bool Ta false Ta
+Enable verbose MSR print out. When this option is true,
+messages related to reading from (rdmsr) and writing to (wrmsr)
+MSRs on virtual CPUs will be printed out. This can be useful for
+debugging purposes.
.It Va x86.vmexit_on_hlt Ta bool Ta false Ta
Force a VM exit when a guest CPU executes the
.Dv HLT
diff --git a/usr.sbin/trim/Makefile b/usr.sbin/trim/Makefile
index 1329c7f79690..6cf96b703094 100644
--- a/usr.sbin/trim/Makefile
+++ b/usr.sbin/trim/Makefile
@@ -1,5 +1,3 @@
-.include <src.opts.mk>
-
PROG= trim
MAN= trim.8
LIBADD= util