xref: /openbsd/usr.sbin/vmd/arm64_vm.c (revision 4fb9ab68)
1 /*	$OpenBSD: arm64_vm.c,v 1.1 2024/07/10 10:41:19 dv Exp $	*/
2 /*
3  * Copyright (c) 2024 Dave Voutila <dv@openbsd.org>
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 #include <sys/types.h>
18 
19 #include "vmd.h"
20 
21 void
22 create_memory_map(struct vm_create_params *vcp)
23 {
24 	fatalx("%s: unimplemented", __func__);
25 	/* NOTREACHED */
26 }
27 
28 int
29 load_firmware(struct vmd_vm *vm, struct vcpu_reg_state *vrs)
30 {
31 	fatalx("%s: unimplemented", __func__);
32 	/* NOTREACHED */
33 	return (-1);
34 }
35 
36 void
37 init_emulated_hw(struct vmop_create_params *vcp, int child_cdrom,
38     int child_disks[][VM_MAX_BASE_PER_DISK], int *child_taps)
39 {
40 	fatalx("%s: unimplemented", __func__);
41 	/* NOTREACHED */
42 }
43 
44 void
45 restore_emulated_hw(struct vm_create_params *vcp, int fd, int *child_taps,
46     int child_disks[][VM_MAX_BASE_PER_DISK], int child_cdrom)
47 {
48 	fatalx("%s: unimplemented", __func__);
49 	/* NOTREACHED */
50 }
51 
52 void
53 pause_vm_md(struct vmd_vm *vm)
54 {
55 	fatalx("%s: unimplemented", __func__);
56 	/* NOTREACHED */
57 }
58 
59 void
60 unpause_vm_md(struct vmd_vm *vm)
61 {
62 	fatalx("%s: unimplemented", __func__);
63 	/* NOTREACHED */
64 }
65 
66 int
67 dump_devs(int fd)
68 {
69 	fatalx("%s: unimplemented", __func__);
70 	/* NOTREACHED */
71 	return (-1);
72 }
73 
74 int
75 dump_send_header(int fd)
76 {
77 	fatalx("%s: unimplemented", __func__);
78 	/* NOTREACHED */
79 	return (-1);
80 }
81 
82 void *
83 hvaddr_mem(paddr_t gpa, size_t len)
84 {	fatalx("%s: unimplemented", __func__);
85 	/* NOTREACHED */
86 	return (NULL);
87 }
88 
89 int
90 write_mem(paddr_t dst, const void *buf, size_t len)
91 {
92 	fatalx("%s: unimplemented", __func__);
93 	/* NOTREACHED */
94 	return (-1);
95 }
96 
97 int
98 read_mem(paddr_t src, void *buf, size_t len)
99 {
100 	fatalx("%s: unimplemented", __func__);
101 	/* NOTREACHED */
102 	return (-1);
103 }
104 
105 int
106 intr_pending(struct vmd_vm *vm)
107 {
108 	fatalx("%s: unimplemented", __func__);
109 	/* NOTREACHED */
110 	return (-1);
111 }
112 
113 void
114 intr_toggle_el(struct vmd_vm *vm, int irq, int val)
115 {
116 	fatalx("%s: unimplemented", __func__);
117 	/* NOTREACHED */
118 }
119 
120 int
121 intr_ack(struct vmd_vm *vm)
122 {
123 	fatalx("%s: unimplemented", __func__);
124 	/* NOTREACHED */
125 	return (-1);
126 }
127 
128 void
129 vcpu_assert_irq(uint32_t vm_id, uint32_t vcpu_id, int irq)
130 {
131 	fatalx("%s: unimplemented", __func__);
132 }
133 
134 void
135 vcpu_deassert_irq(uint32_t vm_id, uint32_t vcpu_id, int irq)
136 {
137 	fatalx("%s: unimplemented", __func__);
138 }
139 
140 int
141 vmd_check_vmh(struct vm_dump_header *vmh)
142 {
143 	fatalx("%s: unimplemented", __func__);
144 	/* NOTREACHED */
145 	return (-1);
146 }
147 
148 int
149 vcpu_exit(struct vm_run_params *vrp)
150 {
151 	fatalx("%s: unimplemented", __func__);
152 	/* NOTREACHED */
153 	return (-1);
154 }
155 
156 uint8_t
157 vcpu_exit_pci(struct vm_run_params *vrp)
158 {
159 	fatalx("%s: unimplemented", __func__);
160 	/* NOTREACHED */
161 	return (0xff);
162 }
163