diff options
author | Mark Johnston <markj@FreeBSD.org> | 2024-05-01 12:33:23 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2024-05-01 12:33:23 +0000 |
commit | c1b37d909e59829ec1234fb9dbdcc8e545b37585 (patch) | |
tree | 6be97dff3d894572f81bd572bcdcc046f8887f57 | |
parent | 1c4ee7dfb8affed302171232b0f612e6bcba3c10 (diff) | |
download | src-c1b37d909e59829ec1234fb9dbdcc8e545b37585.tar.gz src-c1b37d909e59829ec1234fb9dbdcc8e545b37585.zip |
bhyvectl: Add arm64 bits and hook it up to the build
For now this implementation doesn't provide any machine dependent
functionality on arm64, but it's enough to be able to reset and destroy
VMs.
Reviewed by: jhb
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D44932
-rw-r--r-- | usr.sbin/Makefile.aarch64 | 1 | ||||
-rw-r--r-- | usr.sbin/bhyvectl/aarch64/Makefile.inc | 1 | ||||
-rw-r--r-- | usr.sbin/bhyvectl/aarch64/bhyvectl_machdep.c | 82 |
3 files changed, 84 insertions, 0 deletions
diff --git a/usr.sbin/Makefile.aarch64 b/usr.sbin/Makefile.aarch64 index 6302b6a78ef7..32612c1621ac 100644 --- a/usr.sbin/Makefile.aarch64 +++ b/usr.sbin/Makefile.aarch64 @@ -3,4 +3,5 @@ SUBDIR+= acpi .endif .if ${MK_BHYVE} != "no" SUBDIR+= bhyve +SUBDIR+= bhyvectl .endif diff --git a/usr.sbin/bhyvectl/aarch64/Makefile.inc b/usr.sbin/bhyvectl/aarch64/Makefile.inc new file mode 100644 index 000000000000..047e8d6c70bc --- /dev/null +++ b/usr.sbin/bhyvectl/aarch64/Makefile.inc @@ -0,0 +1 @@ +SRCS+= bhyvectl_machdep.c diff --git a/usr.sbin/bhyvectl/aarch64/bhyvectl_machdep.c b/usr.sbin/bhyvectl/aarch64/bhyvectl_machdep.c new file mode 100644 index 000000000000..fc0541203de8 --- /dev/null +++ b/usr.sbin/bhyvectl/aarch64/bhyvectl_machdep.c @@ -0,0 +1,82 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Mark Johnston <markj@FreeBSD.org> + * + * This software was developed by the University of Cambridge Computer + * Laboratory (Department of Computer Science and Technology) under Innovate + * UK project 105694, "Digital Security by Design (DSbD) Technology Platform + * Prototype". + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <sys/types.h> + +#include <err.h> +#include <fcntl.h> +#include <getopt.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include <vmmapi.h> + +#include "bhyvectl.h" + +void +bhyvectl_dump_vm_run_exitcode(struct vm_exit *vmexit __unused, + int vcpu __unused) +{ +} + +struct option * +bhyvectl_opts(const struct option *options, size_t count) +{ + struct option *all_opts; + + all_opts = calloc(count + 1, sizeof(struct option)); + if (all_opts == NULL) + err(1, "calloc"); + memcpy(all_opts, options, count * sizeof(struct option)); + return (all_opts); +} + +void +bhyvectl_handle_opt(const struct option *opts __unused, int opt __unused) +{ +} + +const char * +bhyvectl_opt_desc(int opt __unused) +{ + /* No arm64-specific options yet. */ + return ("???"); +} + +void +bhyvectl_md_main(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, + int vcpuid __unused, bool get_all __unused) +{ +} |