summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
authorPatrick Mooney <pmooney@pfmooney.com>2020-08-21 04:52:30 +0000
committerPatrick Mooney <pmooney@oxide.computer>2020-09-02 20:24:18 +0000
commit096bb5cb663d8fa04eda9a4aceb4d82a9cbae42c (patch)
tree8e9ade8259a9d6f7bbc3f751b8b45d572f8bc0a9 /usr/src/cmd
parent2ad530425ac9cd3f429e64463a85f6f58703061c (diff)
downloadillumos-joyent-096bb5cb663d8fa04eda9a4aceb4d82a9cbae42c.tar.gz
13072 clarify VMCB interface in bhyve
Reviewed by: Robert Mustacchi <rm@fingolfin.org> Reviewed by: Mike Zeller <mike.zeller@joyent.com> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/bhyvectl/bhyvectl.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/usr/src/cmd/bhyvectl/bhyvectl.c b/usr/src/cmd/bhyvectl/bhyvectl.c
index e0041ede30..7f8847b184 100644
--- a/usr/src/cmd/bhyvectl/bhyvectl.c
+++ b/usr/src/cmd/bhyvectl/bhyvectl.c
@@ -580,6 +580,7 @@ vm_set_vmcs_field(struct vmctx *ctx, int vcpu, int field, uint64_t val)
}
#endif /* __FreeBSD__ */
+#ifdef __FreeBSD__
static int
vm_get_vmcb_field(struct vmctx *ctx, int vcpu, int off, int bytes,
uint64_t *ret_val)
@@ -595,6 +596,23 @@ vm_set_vmcb_field(struct vmctx *ctx, int vcpu, int off, int bytes,
return (vm_set_register(ctx, vcpu, VMCB_ACCESS(off, bytes), val));
}
+#else /* __FreeBSD__ */
+/* Arbitrary VMCB read/write is not allowed */
+static int
+vm_get_vmcb_field(struct vmctx *ctx, int vcpu, int off, int bytes,
+ uint64_t *ret_val)
+{
+ *ret_val = 0;
+ return (0);
+}
+
+static int
+vm_set_vmcb_field(struct vmctx *ctx, int vcpu, int off, int bytes,
+ uint64_t val)
+{
+ return (EINVAL);
+}
+#endif /* __FreeBSD__ */
enum {
VMNAME = 1000, /* avoid collision with return values from getopt */