Lines Matching refs:tcp
53 vcpu_find(struct tcb *const tcp, int fd) in vcpu_find() argument
55 for (struct vcpu_info *vcpu_info = tcp->vcpu_info_list; in vcpu_find()
65 vcpu_alloc(struct tcb *const tcp, int fd, int cpuid) in vcpu_alloc() argument
72 vcpu_info->next = tcp->vcpu_info_list; in vcpu_alloc()
73 tcp->vcpu_info_list = vcpu_info; in vcpu_alloc()
79 kvm_vcpu_info_free(struct tcb *tcp) in kvm_vcpu_info_free() argument
83 for (head = tcp->vcpu_info_list; head; head = next) { in kvm_vcpu_info_free()
88 tcp->vcpu_info_list = NULL; in kvm_vcpu_info_free()
92 vcpu_register(struct tcb *const tcp, int fd, int cpuid) in vcpu_register() argument
97 struct vcpu_info *vcpu_info = vcpu_find(tcp, fd); in vcpu_register()
100 vcpu_info = vcpu_alloc(tcp, fd, cpuid); in vcpu_register()
133 vcpu_get_info(struct tcb *const tcp, int fd) in vcpu_get_info() argument
135 struct vcpu_info *vcpu_info = vcpu_find(tcp, fd); in vcpu_get_info()
140 mmap_cache_rebuild_if_invalid(tcp, __func__); in vcpu_get_info()
148 map_info = mmap_cache_search(tcp, vcpu_info->mmap_addr); in vcpu_get_info()
170 if (getfdpath(tcp, fd, path, sizeof(path)) >= 0) in vcpu_get_info()
175 map_info = mmap_cache_search_custom(tcp, is_map_for_file, path); in vcpu_get_info()
182 vcpu_info = vcpu_alloc(tcp, fd, cpuid); in vcpu_get_info()
195 kvm_ioctl_create_vcpu(struct tcb *const tcp, const kernel_ulong_t arg) in kvm_ioctl_create_vcpu() argument
199 if (entering(tcp)) { in kvm_ioctl_create_vcpu()
203 } else if (!syserror(tcp)) { in kvm_ioctl_create_vcpu()
204 vcpu_register(tcp, tcp->u_rval, cpuid); in kvm_ioctl_create_vcpu()
213 kvm_ioctl_set_user_memory_region(struct tcb *const tcp, const kernel_ulong_t arg) in kvm_ioctl_set_user_memory_region() argument
218 if (umove_or_printaddr(tcp, arg, &u_memory_region)) in kvm_ioctl_set_user_memory_region()
235 kvm_ioctl_decode_regs(struct tcb *const tcp, const unsigned int code, in kvm_ioctl_decode_regs() argument
240 if (code == KVM_GET_REGS && entering(tcp)) in kvm_ioctl_decode_regs()
244 if (!umove_or_printaddr(tcp, arg, ®s)) in kvm_ioctl_decode_regs()
245 arch_print_kvm_regs(tcp, arg, ®s); in kvm_ioctl_decode_regs()
254 print_kvm_cpuid_entry(struct tcb *const tcp, in print_kvm_cpuid_entry() argument
272 kvm_ioctl_decode_cpuid2(struct tcb *const tcp, const unsigned int code, in kvm_ioctl_decode_cpuid2() argument
277 if (entering(tcp) && (code == KVM_GET_SUPPORTED_CPUID in kvm_ioctl_decode_cpuid2()
285 if (!umove_or_printaddr(tcp, arg, &cpuid)) { in kvm_ioctl_decode_cpuid2()
289 if (abbrev(tcp)) { in kvm_ioctl_decode_cpuid2()
297 print_array(tcp, arg + sizeof(cpuid), cpuid.nent, in kvm_ioctl_decode_cpuid2()
310 kvm_ioctl_decode_sregs(struct tcb *const tcp, const unsigned int code, in kvm_ioctl_decode_sregs() argument
315 if (code == KVM_GET_SREGS && entering(tcp)) in kvm_ioctl_decode_sregs()
319 if (!umove_or_printaddr(tcp, arg, &sregs)) in kvm_ioctl_decode_sregs()
320 arch_print_kvm_sregs(tcp, arg, &sregs); in kvm_ioctl_decode_sregs()
328 kvm_ioctl_decode_check_extension(struct tcb *const tcp, const unsigned int code, in kvm_ioctl_decode_check_extension() argument
338 kvm_ioctl_run_attach_auxstr(struct tcb *const tcp, in kvm_ioctl_run_attach_auxstr() argument
347 if (umove(tcp, info->mmap_addr, &vcpu_run_struct) < 0) in kvm_ioctl_run_attach_auxstr()
350 tcp->auxstr = xlat_idx(kvm_exit_reason, ARRAY_SIZE(kvm_exit_reason) - 1, in kvm_ioctl_run_attach_auxstr()
352 if (!tcp->auxstr) in kvm_ioctl_run_attach_auxstr()
353 tcp->auxstr = "KVM_EXIT_???"; in kvm_ioctl_run_attach_auxstr()
357 kvm_ioctl_decode_run(struct tcb *const tcp) in kvm_ioctl_decode_run() argument
360 if (entering(tcp)) in kvm_ioctl_decode_run()
365 if (syserror(tcp)) in kvm_ioctl_decode_run()
369 tcp->auxstr = NULL; in kvm_ioctl_decode_run()
370 int fd = tcp->u_arg[0]; in kvm_ioctl_decode_run()
371 struct vcpu_info *info = vcpu_get_info(tcp, fd); in kvm_ioctl_decode_run()
374 kvm_ioctl_run_attach_auxstr(tcp, info); in kvm_ioctl_decode_run()
375 if (tcp->auxstr) in kvm_ioctl_decode_run()
384 kvm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg) in kvm_ioctl() argument
388 return kvm_ioctl_create_vcpu(tcp, arg); in kvm_ioctl()
392 return kvm_ioctl_set_user_memory_region(tcp, arg); in kvm_ioctl()
398 return kvm_ioctl_decode_regs(tcp, code, arg); in kvm_ioctl()
404 return kvm_ioctl_decode_sregs(tcp, code, arg); in kvm_ioctl()
413 return kvm_ioctl_decode_cpuid2(tcp, code, arg); in kvm_ioctl()
417 return kvm_ioctl_decode_check_extension(tcp, code, arg); in kvm_ioctl()
423 return kvm_ioctl_decode_run(tcp); in kvm_ioctl()