Lines Matching +full:vm +full:- +full:map

1 /* SPDX-License-Identifier: GPL-2.0-only */
22 * structure kvm_util is using to maintain the state of a VM.
65 int vm_enable_cap(struct kvm_vm *vm, struct kvm_enable_cap *cap);
66 int vcpu_enable_cap(struct kvm_vm *vm, uint32_t vcpu_id,
68 void vm_enable_dirty_ring(struct kvm_vm *vm, uint32_t ring_size);
74 void kvm_vm_get_dirty_log(struct kvm_vm *vm, int slot, void *log);
75 void kvm_vm_clear_dirty_log(struct kvm_vm *vm, int slot, void *log,
78 int kvm_memcmp_hva_gva(void *hva, struct kvm_vm *vm, const vm_vaddr_t gva,
81 void kvm_vm_elf_load(struct kvm_vm *vm, const char *filename,
84 void vm_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent);
87 * VM VCPU Dump
90 * stream - Output FILE stream
91 * vm - Virtual Machine
92 * vcpuid - VCPU ID
93 * indent - Left margin indent amount
99 * Dumps the current state of the VCPU specified by @vcpuid, within the VM
100 * given by @vm, to the FILE stream given by @stream.
102 void vcpu_dump(FILE *stream, struct kvm_vm *vm, uint32_t vcpuid,
105 void vm_create_irqchip(struct kvm_vm *vm);
107 void vm_userspace_mem_region_add(struct kvm_vm *vm,
112 void vcpu_ioctl(struct kvm_vm *vm, uint32_t vcpuid, unsigned long ioctl,
114 int _vcpu_ioctl(struct kvm_vm *vm, uint32_t vcpuid, unsigned long ioctl,
116 void vm_ioctl(struct kvm_vm *vm, unsigned long ioctl, void *arg);
117 void vm_mem_region_set_flags(struct kvm_vm *vm, uint32_t slot, uint32_t flags);
118 void vm_mem_region_move(struct kvm_vm *vm, uint32_t slot, uint64_t new_gpa);
119 void vm_mem_region_delete(struct kvm_vm *vm, uint32_t slot);
120 void vm_vcpu_add(struct kvm_vm *vm, uint32_t vcpuid);
121 vm_vaddr_t vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, vm_vaddr_t vaddr_min,
123 void virt_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr,
125 void *addr_gpa2hva(struct kvm_vm *vm, vm_paddr_t gpa);
126 void *addr_gva2hva(struct kvm_vm *vm, vm_vaddr_t gva);
127 vm_paddr_t addr_hva2gpa(struct kvm_vm *vm, void *hva);
133 * vm - Virtual Machine
134 * gva - VM virtual address
139 * Equivalent VM physical address
141 * Returns the VM physical address of the translated VM virtual
144 vm_paddr_t addr_gva2gpa(struct kvm_vm *vm, vm_vaddr_t gva);
146 struct kvm_run *vcpu_state(struct kvm_vm *vm, uint32_t vcpuid);
147 void vcpu_run(struct kvm_vm *vm, uint32_t vcpuid);
148 int _vcpu_run(struct kvm_vm *vm, uint32_t vcpuid);
149 void vcpu_run_complete_io(struct kvm_vm *vm, uint32_t vcpuid);
150 void vcpu_set_guest_debug(struct kvm_vm *vm, uint32_t vcpuid,
152 void vcpu_set_mp_state(struct kvm_vm *vm, uint32_t vcpuid,
154 struct kvm_reg_list *vcpu_get_reg_list(struct kvm_vm *vm, uint32_t vcpuid);
155 void vcpu_regs_get(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_regs *regs);
156 void vcpu_regs_set(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_regs *regs);
159 * VM VCPU Args Set
162 * vm - Virtual Machine
163 * vcpuid - VCPU ID
164 * num - number of arguments
165 * ... - arguments, each of type uint64_t
176 void vcpu_args_set(struct kvm_vm *vm, uint32_t vcpuid, unsigned int num, ...);
178 void vcpu_sregs_get(struct kvm_vm *vm, uint32_t vcpuid,
180 void vcpu_sregs_set(struct kvm_vm *vm, uint32_t vcpuid,
182 int _vcpu_sregs_set(struct kvm_vm *vm, uint32_t vcpuid,
184 void vcpu_fpu_get(struct kvm_vm *vm, uint32_t vcpuid,
186 void vcpu_fpu_set(struct kvm_vm *vm, uint32_t vcpuid,
188 void vcpu_get_reg(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_one_reg *reg);
189 void vcpu_set_reg(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_one_reg *reg);
191 void vcpu_events_get(struct kvm_vm *vm, uint32_t vcpuid,
193 void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid,
197 void vcpu_nested_state_get(struct kvm_vm *vm, uint32_t vcpuid,
199 int vcpu_nested_state_set(struct kvm_vm *vm, uint32_t vcpuid,
205 void virt_pgd_alloc(struct kvm_vm *vm, uint32_t pgd_memslot);
208 * VM Virtual Page Map
211 * vm - Virtual Machine
212 * vaddr - VM Virtual Address
213 * paddr - VM Physical Address
214 * memslot - Memory region slot for new virtual translation tables
220 * Within @vm, creates a virtual translation for the page starting
223 void virt_pg_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr,
226 vm_paddr_t vm_phy_page_alloc(struct kvm_vm *vm, vm_paddr_t paddr_min,
228 vm_paddr_t vm_phy_pages_alloc(struct kvm_vm *vm, size_t num,
232 * Create a VM with reasonable defaults
235 * vcpuid - The id of the single VCPU to add to the VM.
236 * extra_mem_pages - The number of extra pages to add (this will
239 * guest_code - The vCPU's entry point
244 * Pointer to opaque structure that describes the created VM.
253 * vm - Virtual Machine
254 * vcpuid - The id of the VCPU to add to the VM.
255 * guest_code - The vCPU's entry point
257 void vm_vcpu_add_default(struct kvm_vm *vm, uint32_t vcpuid, void *guest_code);
259 bool vm_is_unrestricted_guest(struct kvm_vm *vm);
261 unsigned int vm_get_page_size(struct kvm_vm *vm);
262 unsigned int vm_get_page_shift(struct kvm_vm *vm);
263 unsigned int vm_get_max_gfn(struct kvm_vm *vm);
264 int vm_get_fd(struct kvm_vm *vm);
282 kvm_userspace_memory_region_find(struct kvm_vm *vm, uint64_t start,
288 int vm_create_device(struct kvm_vm *vm, struct kvm_create_device *cd);
290 #define sync_global_to_guest(vm, g) ({ \ argument
291 typeof(g) *_p = addr_gva2hva(vm, (vm_vaddr_t)&(g)); \
295 #define sync_global_from_guest(vm, g) ({ \ argument
296 typeof(g) *_p = addr_gva2hva(vm, (vm_vaddr_t)&(g)); \
300 void assert_on_unhandled_exception(struct kvm_vm *vm, uint32_t vcpuid);
317 void ucall_init(struct kvm_vm *vm, void *arg);
318 void ucall_uninit(struct kvm_vm *vm);
320 uint64_t get_ucall(struct kvm_vm *vm, uint32_t vcpu_id, struct ucall *uc);