summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-07-29 11:35:17 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-07-29 11:35:17 +0000
commitb190045b10d9c575d415b9c6e7f13dc6d0303000 (patch)
treecccf1c7f67fa99cd6dc1bf90fd8380e4e7c9a39f /usr/src/cmd
parentfd851958ac43e040125201c92bdfbe0cd5e4ad03 (diff)
parent5c1597bcad8dabd41c0a919fb8acfabd8054e924 (diff)
downloadillumos-joyent-release-20200730.tar.gz
[illumos-gate merge]release-20200730
commit 5c1597bcad8dabd41c0a919fb8acfabd8054e924 12992 loader: logo-illumos.4th needs to have mode resets commit abe1e6b305e672d0eedeb6b52003acac658c8371 12982 ambiguous instructions require an explicit suffix commit c3ae3afa3e57b39e29577c4b791adbe511bb7e3f 12916 bhyve should be able to limit vmx capabilities 12917 bhyve should always use Unrestricted Guest commit 22e68029451fec16a660c22ed1304b05ed67f43d 12973 add support for PCI-E rge cards
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/bhyve/bhyverun.c10
-rw-r--r--usr/src/cmd/bhyve/spinup_ap.c16
2 files changed, 26 insertions, 0 deletions
diff --git a/usr/src/cmd/bhyve/bhyverun.c b/usr/src/cmd/bhyve/bhyverun.c
index b8a993784a..e3c56bdbd0 100644
--- a/usr/src/cmd/bhyve/bhyverun.c
+++ b/usr/src/cmd/bhyve/bhyverun.c
@@ -39,6 +39,7 @@
*
* Copyright 2015 Pluribus Networks Inc.
* Copyright 2018 Joyent, Inc.
+ * Copyright 2020 Oxide Computer Company
*/
#include <sys/cdefs.h>
@@ -952,6 +953,7 @@ vm_loop(struct vmctx *ctx, int vcpu, uint64_t startrip)
static int
num_vcpus_allowed(struct vmctx *ctx)
{
+#ifdef __FreeBSD__
int tmp, error;
error = vm_get_capability(ctx, BSP, VM_CAP_UNRESTRICTED_GUEST, &tmp);
@@ -964,6 +966,10 @@ num_vcpus_allowed(struct vmctx *ctx)
return (VM_MAXCPU);
else
return (1);
+#else
+ /* Unrestricted Guest is always enabled on illumos */
+ return (VM_MAXCPU);
+#endif /* __FreeBSD__ */
}
void
@@ -1340,11 +1346,15 @@ main(int argc, char *argv[])
vga_init(1);
if (lpc_bootrom()) {
+#ifdef __FreeBSD__
if (vm_set_capability(ctx, BSP, VM_CAP_UNRESTRICTED_GUEST, 1)) {
fprintf(stderr, "ROM boot failed: unrestricted guest "
"capability not available\n");
exit(4);
}
+#else
+ /* Unrestricted Guest is always enabled on illumos */
+#endif
error = vcpu_reset(ctx, BSP);
assert(error == 0);
}
diff --git a/usr/src/cmd/bhyve/spinup_ap.c b/usr/src/cmd/bhyve/spinup_ap.c
index ecdd05694c..80caafe78e 100644
--- a/usr/src/cmd/bhyve/spinup_ap.c
+++ b/usr/src/cmd/bhyve/spinup_ap.c
@@ -27,6 +27,18 @@
*
* $FreeBSD$
*/
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * Copyright 2020 Oxide Computer Company
+ */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -89,6 +101,7 @@ spinup_ap(struct vmctx *ctx, int vcpu, int newcpu, uint64_t rip)
fbsdrun_set_capabilities(ctx, newcpu);
+#ifdef __FreeBSD__
/*
* Enable the 'unrestricted guest' mode for 'newcpu'.
*
@@ -97,6 +110,9 @@ spinup_ap(struct vmctx *ctx, int vcpu, int newcpu, uint64_t rip)
*/
error = vm_set_capability(ctx, newcpu, VM_CAP_UNRESTRICTED_GUEST, 1);
assert(error == 0);
+#else
+ /* Unrestricted Guest is always enabled on illumos */
+#endif
spinup_ap_realmode(ctx, newcpu, &rip);