1 /* $OpenBSD: arm64_vm.c,v 1.3 2024/09/21 04:12:18 mlarkin 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 #include "vmm.h" 21 22 void 23 create_memory_map(struct vm_create_params *vcp) 24 { 25 fatalx("%s: unimplemented", __func__); 26 /* NOTREACHED */ 27 } 28 29 int 30 load_firmware(struct vmd_vm *vm, struct vcpu_reg_state *vrs) 31 { 32 fatalx("%s: unimplemented", __func__); 33 /* NOTREACHED */ 34 return (-1); 35 } 36 37 void 38 init_emulated_hw(struct vmop_create_params *vcp, int child_cdrom, 39 int child_disks[][VM_MAX_BASE_PER_DISK], int *child_taps) 40 { 41 fatalx("%s: unimplemented", __func__); 42 /* NOTREACHED */ 43 } 44 45 void 46 restore_emulated_hw(struct vm_create_params *vcp, int fd, int *child_taps, 47 int child_disks[][VM_MAX_BASE_PER_DISK], int child_cdrom) 48 { 49 fatalx("%s: unimplemented", __func__); 50 /* NOTREACHED */ 51 } 52 53 void 54 pause_vm_md(struct vmd_vm *vm) 55 { 56 fatalx("%s: unimplemented", __func__); 57 /* NOTREACHED */ 58 } 59 60 void 61 unpause_vm_md(struct vmd_vm *vm) 62 { 63 fatalx("%s: unimplemented", __func__); 64 /* NOTREACHED */ 65 } 66 67 int 68 dump_devs(int fd) 69 { 70 fatalx("%s: unimplemented", __func__); 71 /* NOTREACHED */ 72 return (-1); 73 } 74 75 int 76 dump_send_header(int fd) 77 { 78 fatalx("%s: unimplemented", __func__); 79 /* NOTREACHED */ 80 return (-1); 81 } 82 83 void * 84 hvaddr_mem(paddr_t gpa, size_t len) 85 { fatalx("%s: unimplemented", __func__); 86 /* NOTREACHED */ 87 return (NULL); 88 } 89 90 int 91 write_mem(paddr_t dst, const void *buf, size_t len) 92 { 93 fatalx("%s: unimplemented", __func__); 94 /* NOTREACHED */ 95 return (-1); 96 } 97 98 int 99 read_mem(paddr_t src, void *buf, size_t len) 100 { 101 fatalx("%s: unimplemented", __func__); 102 /* NOTREACHED */ 103 return (-1); 104 } 105 106 int 107 intr_pending(struct vmd_vm *vm) 108 { 109 fatalx("%s: unimplemented", __func__); 110 /* NOTREACHED */ 111 return (-1); 112 } 113 114 void 115 intr_toggle_el(struct vmd_vm *vm, int irq, int val) 116 { 117 fatalx("%s: unimplemented", __func__); 118 /* NOTREACHED */ 119 } 120 121 int 122 intr_ack(struct vmd_vm *vm) 123 { 124 fatalx("%s: unimplemented", __func__); 125 /* NOTREACHED */ 126 return (-1); 127 } 128 129 void 130 vcpu_assert_irq(uint32_t vm_id, uint32_t vcpu_id, int irq) 131 { 132 fatalx("%s: unimplemented", __func__); 133 } 134 135 void 136 vcpu_deassert_irq(uint32_t vm_id, uint32_t vcpu_id, int irq) 137 { 138 fatalx("%s: unimplemented", __func__); 139 } 140 141 int 142 vmd_check_vmh(struct vm_dump_header *vmh) 143 { 144 fatalx("%s: unimplemented", __func__); 145 /* NOTREACHED */ 146 return (-1); 147 } 148 149 int 150 vcpu_exit(struct vm_run_params *vrp) 151 { 152 fatalx("%s: unimplemented", __func__); 153 /* NOTREACHED */ 154 return (-1); 155 } 156 157 uint8_t 158 vcpu_exit_pci(struct vm_run_params *vrp) 159 { 160 fatalx("%s: unimplemented", __func__); 161 /* NOTREACHED */ 162 return (0xff); 163 } 164 165 void 166 set_return_data(struct vm_exit *vei, uint32_t data) 167 { 168 fatalx("%s: unimplemented", __func__); 169 /* NOTREACHED */ 170 return; 171 } 172 173 void 174 get_input_data(struct vm_exit *vei, uint32_t *data) 175 { 176 fatalx("%s: unimplemented", __func__); 177 /* NOTREACHED */ 178 return; 179 } 180 181 int 182 sev_init(struct vmd_vm *vm) 183 { 184 fatalx("%s: unimplemented", __func__); 185 /* NOTREACHED */ 186 return (-1); 187 } 188 189 int 190 sev_shutdown(struct vmd_vm *vm) 191 { 192 fatalx("%s: unimplemented", __func__); 193 /* NOTREACHED */ 194 return (-1); 195 } 196 197 int 198 sev_activate(struct vmd_vm *vm, int vcpu_id) 199 { 200 fatalx("%s: unimplemented", __func__); 201 /* NOTREACHED */ 202 return (-1); 203 } 204 205 int 206 sev_encrypt_memory(struct vmd_vm *vm) 207 { 208 fatalx("%s: unimplemented", __func__); 209 /* NOTREACHED */ 210 return (-1); 211 } 212