Lines Matching +full:attribute +full:- +full:sets
8 * See the COPYING file in the top-level directory.
14 #include "qemu/main-loop.h"
15 #include "qemu/error-report.h"
21 #include "system/address-spaces.h"
22 #include "xen-emu.h"
27 #include "hw/i386/apic-msidef.h"
44 #include "xen-compat.h"
64 *len = TARGET_PAGE_SIZE - (gva & ~TARGET_PAGE_MASK); in kvm_gva_to_gpa()
84 return -EFAULT; in kvm_gva_rw()
93 sz -= len; in kvm_gva_rw()
125 return -ENOSYS; in kvm_xen_init()
131 .u.xen_version = s->xen_version, in kvm_xen_init()
141 strerror(-ret)); in kvm_xen_init()
146 if (s->xen_caps) { in kvm_xen_init()
152 * of vCPU0 to deassert the IRQ when ->evtchn_upcall_pending is cleared. in kvm_xen_init()
156 * it nicely in the kernel: check vcpu_info[0]->evtchn_upcall_pending at in kvm_xen_init()
159 * But the in-kernel irqchip is deprecated, so we're unlikely to add in kvm_xen_init()
173 error_report("kvm: Xen support requires kernel-irqchip=split"); in kvm_xen_init()
174 return -EINVAL; in kvm_xen_init()
177 s->xen_caps = xen_caps; in kvm_xen_init()
192 CPUX86State *env = &cpu->env; in kvm_xen_init_vcpu()
206 .u.vcpu_id = cs->cpu_index, in kvm_xen_init_vcpu()
210 error_report("kvm: Failed to set Xen vCPU ID attribute: %s", in kvm_xen_init_vcpu()
211 strerror(-err)); in kvm_xen_init_vcpu()
216 env->xen_vcpu_info_gpa = INVALID_GPA; in kvm_xen_init_vcpu()
217 env->xen_vcpu_info_default_gpa = INVALID_GPA; in kvm_xen_init_vcpu()
218 env->xen_vcpu_time_info_gpa = INVALID_GPA; in kvm_xen_init_vcpu()
219 env->xen_vcpu_runstate_gpa = INVALID_GPA; in kvm_xen_init_vcpu()
221 qemu_mutex_init(&env->xen_timers_lock); in kvm_xen_init_vcpu()
222 env->xen_singleshot_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, in kvm_xen_init_vcpu()
225 if (!env->xen_singleshot_timer) { in kvm_xen_init_vcpu()
226 return -ENOMEM; in kvm_xen_init_vcpu()
228 env->xen_singleshot_timer->opaque = cs; in kvm_xen_init_vcpu()
230 env->xen_periodic_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, in kvm_xen_init_vcpu()
233 if (!env->xen_periodic_timer) { in kvm_xen_init_vcpu()
234 return -ENOMEM; in kvm_xen_init_vcpu()
236 env->xen_periodic_timer->opaque = cs; in kvm_xen_init_vcpu()
243 return kvm_state->xen_caps; in kvm_xen_get_caps()
281 exit->u.hcall.result = err; in kvm_xen_hcall_xen_version()
292 trace_kvm_xen_set_vcpu_attr(cs->cpu_index, type, gpa); in kvm_xen_set_vcpu_attr()
299 uint8_t vector = X86_CPU(cs)->env.xen_vcpu_callback_vector; in kvm_xen_set_vcpu_callback_vector()
305 trace_kvm_xen_set_vcpu_callback(cs->cpu_index, vector); in kvm_xen_set_vcpu_callback_vector()
313 CPUX86State *env = &cpu->env; in do_set_vcpu_callback_vector()
315 env->xen_vcpu_callback_vector = data.host_int; in do_set_vcpu_callback_vector()
325 CPUX86State *env = &cpu->env; in set_vcpu_info()
337 if (mrs.mr && mrs.mr->ram_block && in set_vcpu_info()
339 vcpu_info_hva = qemu_map_ram_ptr(mrs.mr->ram_block, in set_vcpu_info()
347 ret = -EINVAL; in set_vcpu_info()
351 if (env->xen_vcpu_info_mr) { in set_vcpu_info()
352 memory_region_unref(env->xen_vcpu_info_mr); in set_vcpu_info()
354 env->xen_vcpu_info_hva = vcpu_info_hva; in set_vcpu_info()
355 env->xen_vcpu_info_mr = mrs.mr; in set_vcpu_info()
362 CPUX86State *env = &cpu->env; in do_set_vcpu_info_default_gpa()
364 env->xen_vcpu_info_default_gpa = data.host_ulong; in do_set_vcpu_info_default_gpa()
367 if (env->xen_vcpu_info_gpa == INVALID_GPA) { in do_set_vcpu_info_default_gpa()
368 set_vcpu_info(cs, env->xen_vcpu_info_default_gpa); in do_set_vcpu_info_default_gpa()
375 CPUX86State *env = &cpu->env; in do_set_vcpu_info_gpa()
377 env->xen_vcpu_info_gpa = data.host_ulong; in do_set_vcpu_info_gpa()
379 set_vcpu_info(cs, env->xen_vcpu_info_gpa); in do_set_vcpu_info_gpa()
389 return X86_CPU(cs)->env.xen_vcpu_info_hva; in kvm_xen_get_vcpu_info_hva()
394 CPUX86State *env = &X86_CPU(cs)->env; in kvm_xen_maybe_deassert_callback()
395 struct vcpu_info *vi = env->xen_vcpu_info_hva; in kvm_xen_maybe_deassert_callback()
401 if (!vi->evtchn_upcall_pending) { in kvm_xen_maybe_deassert_callback()
408 if (!vi->evtchn_upcall_pending) { in kvm_xen_maybe_deassert_callback()
409 X86_CPU(cs)->env.xen_callback_asserted = false; in kvm_xen_maybe_deassert_callback()
421 X86_CPU(cs)->env.xen_callback_asserted = true; in kvm_xen_set_callback_asserted()
429 return cs && !!X86_CPU(cs)->env.xen_vcpu_callback_vector; in kvm_xen_has_vcpu_callback_vector()
441 vector = X86_CPU(cs)->env.xen_vcpu_callback_vector; in kvm_xen_inject_vcpu_callback_vector()
444 * The per-vCPU callback vector injected via lapic. Just in kvm_xen_inject_vcpu_callback_vector()
449 (X86_CPU(cs)->apic_id << MSI_ADDR_DEST_ID_SHIFT), in kvm_xen_inject_vcpu_callback_vector()
479 CPUX86State *env = &cpu->env; in kvm_xen_set_vcpu_timer()
483 .u.timer.port = env->xen_virq[VIRQ_TIMER], in kvm_xen_set_vcpu_timer()
485 .u.timer.expires_ns = env->xen_singleshot_timer_ns, in kvm_xen_set_vcpu_timer()
493 QEMU_LOCK_GUARD(&X86_CPU(cs)->env.xen_timers_lock); in do_set_vcpu_timer_virq()
502 return -ENOENT; in kvm_xen_set_vcpu_virq()
509 return -EINVAL; in kvm_xen_set_vcpu_virq()
512 if (port && X86_CPU(cs)->env.xen_virq[virq]) { in kvm_xen_set_vcpu_virq()
513 return -EEXIST; in kvm_xen_set_vcpu_virq()
516 X86_CPU(cs)->env.xen_virq[virq] = port; in kvm_xen_set_vcpu_virq()
527 CPUX86State *env = &cpu->env; in do_set_vcpu_time_info_gpa()
529 env->xen_vcpu_time_info_gpa = data.host_ulong; in do_set_vcpu_time_info_gpa()
532 env->xen_vcpu_time_info_gpa); in do_set_vcpu_time_info_gpa()
538 CPUX86State *env = &cpu->env; in do_set_vcpu_runstate_gpa()
540 env->xen_vcpu_runstate_gpa = data.host_ulong; in do_set_vcpu_runstate_gpa()
543 env->xen_vcpu_runstate_gpa); in do_set_vcpu_runstate_gpa()
549 CPUX86State *env = &cpu->env; in do_vcpu_soft_reset()
551 env->xen_vcpu_info_gpa = INVALID_GPA; in do_vcpu_soft_reset()
552 env->xen_vcpu_info_default_gpa = INVALID_GPA; in do_vcpu_soft_reset()
553 env->xen_vcpu_time_info_gpa = INVALID_GPA; in do_vcpu_soft_reset()
554 env->xen_vcpu_runstate_gpa = INVALID_GPA; in do_vcpu_soft_reset()
555 env->xen_vcpu_callback_vector = 0; in do_vcpu_soft_reset()
556 memset(env->xen_virq, 0, sizeof(env->xen_virq)); in do_vcpu_soft_reset()
566 QEMU_LOCK_GUARD(&X86_CPU(cs)->env.xen_timers_lock); in do_vcpu_soft_reset()
567 env->xen_singleshot_timer_ns = 0; in do_vcpu_soft_reset()
586 * KVM-specific. in xen_set_shared_info()
612 return -EINVAL; in add_to_physmap_one()
621 return -ENOTSUP; in add_to_physmap_one()
625 return -EPERM; in add_to_physmap_one()
628 return -EINVAL; in add_to_physmap_one()
638 if (hypercall_compat32(exit->u.hcall.longmode)) { in do_add_to_physmap()
643 return -EFAULT; in do_add_to_physmap()
652 return -EFAULT; in do_add_to_physmap()
657 return -ESRCH; in do_add_to_physmap()
671 if (hypercall_compat32(exit->u.hcall.longmode)) { in do_add_to_physmap_batch()
676 return -EFAULT; in do_add_to_physmap_batch()
688 return -EFAULT; in do_add_to_physmap_batch()
697 return -ESRCH; in do_add_to_physmap_batch()
702 return -EINVAL; in do_add_to_physmap_batch()
705 while (xatpb.size--) { in do_add_to_physmap_batch()
710 /* For 32-bit compat this only copies the low 32 bits of each */ in do_add_to_physmap_batch()
713 return -EFAULT; in do_add_to_physmap_batch()
721 return -EFAULT; in do_add_to_physmap_batch()
746 exit->u.hcall.result = err; in kvm_xen_hcall_memory_op()
761 err = -EFAULT; in handle_set_param()
766 err = -ESRCH; in handle_set_param()
775 xen_set_long_mode(exit->u.hcall.longmode); in handle_set_param()
782 exit->u.hcall.result = err; in handle_set_param()
797 err = -EFAULT; in handle_get_param()
802 err = -ESRCH; in handle_get_param()
816 err = -EINVAL; in handle_get_param()
822 err = -EINVAL; in handle_get_param()
830 err = -EFAULT; in handle_get_param()
833 exit->u.hcall.result = err; in handle_get_param()
847 return -EFAULT; in kvm_xen_hcall_evtchn_upcall_vector()
851 return -EINVAL; in kvm_xen_hcall_evtchn_upcall_vector()
856 return -EINVAL; in kvm_xen_hcall_evtchn_upcall_vector()
867 int ret = -ENOSYS; in kvm_xen_hcall_hvm_op()
874 ret = -ENOSYS; in kvm_xen_hcall_hvm_op()
887 exit->u.hcall.result = ret; in kvm_xen_hcall_hvm_op()
902 return -ENOENT; in vcpuop_register_vcpu_info()
906 return -EFAULT; in vcpuop_register_vcpu_info()
909 if (rvi.offset > TARGET_PAGE_SIZE - sizeof(struct vcpu_info)) { in vcpuop_register_vcpu_info()
910 return -EINVAL; in vcpuop_register_vcpu_info()
930 return -ENOENT; in vcpuop_register_vcpu_time_info()
934 return -EFAULT; in vcpuop_register_vcpu_time_info()
942 * it will offer a new vCPU attribute for that, and we'll use it instead. in vcpuop_register_vcpu_time_info()
946 return -EFAULT; in vcpuop_register_vcpu_time_info()
966 return -ENOENT; in vcpuop_register_runstate_info()
970 return -EFAULT; in vcpuop_register_runstate_info()
975 return -EFAULT; in vcpuop_register_runstate_info()
1000 CPUX86State *env = &X86_CPU(cpu)->env; in xen_vcpu_singleshot_timer_event()
1001 uint16_t port = env->xen_virq[VIRQ_TIMER]; in xen_vcpu_singleshot_timer_event()
1007 qemu_mutex_lock(&env->xen_timers_lock); in xen_vcpu_singleshot_timer_event()
1008 env->xen_singleshot_timer_ns = 0; in xen_vcpu_singleshot_timer_event()
1009 qemu_mutex_unlock(&env->xen_timers_lock); in xen_vcpu_singleshot_timer_event()
1015 CPUX86State *env = &X86_CPU(cpu)->env; in xen_vcpu_periodic_timer_event()
1016 uint16_t port = env->xen_virq[VIRQ_TIMER]; in xen_vcpu_periodic_timer_event()
1023 qemu_mutex_lock(&env->xen_timers_lock); in xen_vcpu_periodic_timer_event()
1026 timer_mod_ns(env->xen_periodic_timer, in xen_vcpu_periodic_timer_event()
1027 qemu_now + env->xen_periodic_timer_period); in xen_vcpu_periodic_timer_event()
1029 qemu_mutex_unlock(&env->xen_timers_lock); in xen_vcpu_periodic_timer_event()
1034 CPUX86State *tenv = &X86_CPU(target)->env; in do_set_periodic_timer()
1037 timer_del(tenv->xen_periodic_timer); in do_set_periodic_timer()
1039 qemu_mutex_lock(&tenv->xen_timers_lock); in do_set_periodic_timer()
1042 timer_mod_ns(tenv->xen_periodic_timer, qemu_now + period_ns); in do_set_periodic_timer()
1043 tenv->xen_periodic_timer_period = period_ns; in do_set_periodic_timer()
1045 qemu_mutex_unlock(&tenv->xen_timers_lock); in do_set_periodic_timer()
1062 return -EFAULT; in vcpuop_set_periodic_timer()
1066 return -EINVAL; in vcpuop_set_periodic_timer()
1074 CPUX86State *tenv = &X86_CPU(target)->env; in vcpuop_stop_periodic_timer()
1076 qemu_mutex_lock(&tenv->xen_timers_lock); in vcpuop_stop_periodic_timer()
1078 timer_del(tenv->xen_periodic_timer); in vcpuop_stop_periodic_timer()
1079 tenv->xen_periodic_timer_period = 0; in vcpuop_stop_periodic_timer()
1081 qemu_mutex_unlock(&tenv->xen_timers_lock); in vcpuop_stop_periodic_timer()
1092 CPUX86State *env = &X86_CPU(cs)->env; in do_set_singleshot_timer()
1095 int64_t delta = timeout_abs - now; in do_set_singleshot_timer()
1104 * sets the timeout 100ms in the future (not *too* soon, since if in do_set_singleshot_timer()
1112 timer_mod_ns(env->xen_singleshot_timer, qemu_now + delta); in do_set_singleshot_timer()
1113 env->xen_singleshot_timer_ns = now + delta; in do_set_singleshot_timer()
1122 * The struct is a uint64_t followed by a uint32_t. On 32-bit that in vcpuop_set_singleshot_timer()
1123 * makes it 12 bytes. On 64-bit it gets padded to 16. The parts in vcpuop_set_singleshot_timer()
1126 * to copy the full 16 bytes from 64-bit guests, and return -EFAULT in vcpuop_set_singleshot_timer()
1134 return -EFAULT; in vcpuop_set_singleshot_timer()
1137 QEMU_LOCK_GUARD(&X86_CPU(cs)->env.xen_timers_lock); in vcpuop_set_singleshot_timer()
1149 CPUX86State *env = &X86_CPU(cs)->env; in vcpuop_stop_singleshot_timer()
1151 qemu_mutex_lock(&env->xen_timers_lock); in vcpuop_stop_singleshot_timer()
1153 timer_del(env->xen_singleshot_timer); in vcpuop_stop_singleshot_timer()
1154 env->xen_singleshot_timer_ns = 0; in vcpuop_stop_singleshot_timer()
1156 qemu_mutex_unlock(&env->xen_timers_lock); in vcpuop_stop_singleshot_timer()
1168 QEMU_LOCK_GUARD(&X86_CPU(cpu)->env.xen_timers_lock); in kvm_xen_hcall_set_timer_op()
1171 exit->u.hcall.result = err; in kvm_xen_hcall_set_timer_op()
1179 CPUState *dest = cs->cpu_index == vcpu_id ? cs : qemu_get_cpu(vcpu_id); in kvm_xen_hcall_vcpu_op()
1183 err = -ENOENT; in kvm_xen_hcall_vcpu_op()
1198 if (cs->cpu_index == vcpu_id) { in kvm_xen_hcall_vcpu_op()
1201 err = -EINVAL; in kvm_xen_hcall_vcpu_op()
1206 if (cs->cpu_index == vcpu_id) { in kvm_xen_hcall_vcpu_op()
1209 err = -EINVAL; in kvm_xen_hcall_vcpu_op()
1225 exit->u.hcall.result = err; in kvm_xen_hcall_vcpu_op()
1233 int err = -ENOSYS; in kvm_xen_hcall_evtchn_op()
1240 err = -ENOSYS; in kvm_xen_hcall_evtchn_op()
1248 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1254 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1263 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1275 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1287 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1293 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1302 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1308 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1317 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1323 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1332 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1344 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1350 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1359 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1366 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1375 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1387 err = -EFAULT; in kvm_xen_hcall_evtchn_op()
1398 exit->u.hcall.result = err; in kvm_xen_hcall_evtchn_op()
1462 return -EFAULT; in schedop_shutdown()
1486 ret = -EINVAL; in schedop_shutdown()
1497 int err = -ENOSYS; in kvm_xen_hcall_sched_op()
1521 exit->u.hcall.result = err; in kvm_xen_hcall_sched_op()
1537 err = -EFAULT; in kvm_xen_hcall_gnttab_op()
1543 err = -EFAULT; in kvm_xen_hcall_gnttab_op()
1552 err = -EFAULT; in kvm_xen_hcall_gnttab_op()
1558 err = -EFAULT; in kvm_xen_hcall_gnttab_op()
1567 err = -EFAULT; in kvm_xen_hcall_gnttab_op()
1573 err = -EFAULT; in kvm_xen_hcall_gnttab_op()
1585 /* Xen explicitly returns -ENOSYS to HVM guests for all others */ in kvm_xen_hcall_gnttab_op()
1586 err = -ENOSYS; in kvm_xen_hcall_gnttab_op()
1590 exit->u.hcall.result = err; in kvm_xen_hcall_gnttab_op()
1604 if (hypercall_compat32(exit->u.hcall.longmode)) { in kvm_xen_hcall_physdev_op()
1608 return -EFAULT; in kvm_xen_hcall_physdev_op()
1614 * it 64-bit aligned in the 64-bit version. in kvm_xen_hcall_physdev_op()
1619 memmove(&map.table_base, &map32->table_base, sizeof(map.table_base)); in kvm_xen_hcall_physdev_op()
1622 err = -EFAULT; in kvm_xen_hcall_physdev_op()
1633 err = -EFAULT; in kvm_xen_hcall_physdev_op()
1642 err = -EFAULT; in kvm_xen_hcall_physdev_op()
1648 err = -EFAULT; in kvm_xen_hcall_physdev_op()
1657 err = -EFAULT; in kvm_xen_hcall_physdev_op()
1663 err = -EFAULT; in kvm_xen_hcall_physdev_op()
1672 err = -EFAULT; in kvm_xen_hcall_physdev_op()
1678 err = -EFAULT; in kvm_xen_hcall_physdev_op()
1687 err = -EFAULT; in kvm_xen_hcall_physdev_op()
1693 err = -EFAULT; in kvm_xen_hcall_physdev_op()
1698 err = -ENOSYS; in kvm_xen_hcall_physdev_op()
1705 exit->u.hcall.result = err; in kvm_xen_hcall_physdev_op()
1711 uint16_t code = exit->u.hcall.input; in do_kvm_xen_handle_exit()
1713 if (exit->u.hcall.cpl > 0) { in do_kvm_xen_handle_exit()
1714 exit->u.hcall.result = -EPERM; in do_kvm_xen_handle_exit()
1720 if (exit->u.hcall.longmode) { in do_kvm_xen_handle_exit()
1722 exit->u.hcall.params[0]); in do_kvm_xen_handle_exit()
1724 /* In 32-bit mode, the 64-bit timer value is in two args. */ in do_kvm_xen_handle_exit()
1725 uint64_t val = ((uint64_t)exit->u.hcall.params[1]) << 32 | in do_kvm_xen_handle_exit()
1726 (uint32_t)exit->u.hcall.params[0]; in do_kvm_xen_handle_exit()
1730 return kvm_xen_hcall_gnttab_op(exit, cpu, exit->u.hcall.params[0], in do_kvm_xen_handle_exit()
1731 exit->u.hcall.params[1], in do_kvm_xen_handle_exit()
1732 exit->u.hcall.params[2]); in do_kvm_xen_handle_exit()
1734 return kvm_xen_hcall_sched_op(exit, cpu, exit->u.hcall.params[0], in do_kvm_xen_handle_exit()
1735 exit->u.hcall.params[1]); in do_kvm_xen_handle_exit()
1737 return kvm_xen_hcall_evtchn_op(exit, cpu, exit->u.hcall.params[0], in do_kvm_xen_handle_exit()
1738 exit->u.hcall.params[1]); in do_kvm_xen_handle_exit()
1741 exit->u.hcall.params[0], in do_kvm_xen_handle_exit()
1742 exit->u.hcall.params[1], in do_kvm_xen_handle_exit()
1743 exit->u.hcall.params[2]); in do_kvm_xen_handle_exit()
1745 return kvm_xen_hcall_hvm_op(exit, cpu, exit->u.hcall.params[0], in do_kvm_xen_handle_exit()
1746 exit->u.hcall.params[1]); in do_kvm_xen_handle_exit()
1748 return kvm_xen_hcall_memory_op(exit, cpu, exit->u.hcall.params[0], in do_kvm_xen_handle_exit()
1749 exit->u.hcall.params[1]); in do_kvm_xen_handle_exit()
1751 return kvm_xen_hcall_physdev_op(exit, cpu, exit->u.hcall.params[0], in do_kvm_xen_handle_exit()
1752 exit->u.hcall.params[1]); in do_kvm_xen_handle_exit()
1754 return kvm_xen_hcall_xen_version(exit, cpu, exit->u.hcall.params[0], in do_kvm_xen_handle_exit()
1755 exit->u.hcall.params[1]); in do_kvm_xen_handle_exit()
1763 if (exit->type != KVM_EXIT_XEN_HCALL) { in kvm_xen_handle_exit()
1764 return -1; in kvm_xen_handle_exit()
1773 if (exit->u.hcall.longmode != xen_is_long_mode()) { in kvm_xen_handle_exit()
1780 * -ENOSYS. This case is for hypercalls which are unexpected. in kvm_xen_handle_exit()
1782 exit->u.hcall.result = -ENOSYS; in kvm_xen_handle_exit()
1785 (uint64_t)exit->u.hcall.input, in kvm_xen_handle_exit()
1786 (uint64_t)exit->u.hcall.params[0], in kvm_xen_handle_exit()
1787 (uint64_t)exit->u.hcall.params[1], in kvm_xen_handle_exit()
1788 (uint64_t)exit->u.hcall.params[2]); in kvm_xen_handle_exit()
1791 trace_kvm_xen_hypercall(CPU(cpu)->cpu_index, exit->u.hcall.cpl, in kvm_xen_handle_exit()
1792 exit->u.hcall.input, exit->u.hcall.params[0], in kvm_xen_handle_exit()
1793 exit->u.hcall.params[1], exit->u.hcall.params[2], in kvm_xen_handle_exit()
1794 exit->u.hcall.result); in kvm_xen_handle_exit()
1801 return s->xen_gnttab_max_frames; in kvm_xen_get_gnttab_max_frames()
1807 return s->xen_evtchn_max_pirq; in kvm_xen_get_evtchn_max_pirq()
1813 CPUX86State *env = &cpu->env; in kvm_put_xen_state()
1817 gpa = env->xen_vcpu_info_gpa; in kvm_put_xen_state()
1819 gpa = env->xen_vcpu_info_default_gpa; in kvm_put_xen_state()
1829 gpa = env->xen_vcpu_time_info_gpa; in kvm_put_xen_state()
1838 gpa = env->xen_vcpu_runstate_gpa; in kvm_put_xen_state()
1847 if (env->xen_periodic_timer_period) { in kvm_put_xen_state()
1848 ret = do_set_periodic_timer(cs, env->xen_periodic_timer_period); in kvm_put_xen_state()
1859 QEMU_LOCK_GUARD(&env->xen_timers_lock); in kvm_put_xen_state()
1860 if (env->xen_singleshot_timer_ns) { in kvm_put_xen_state()
1861 ret = do_set_singleshot_timer(cs, env->xen_singleshot_timer_ns, in kvm_put_xen_state()
1870 if (env->xen_vcpu_callback_vector) { in kvm_put_xen_state()
1877 if (env->xen_virq[VIRQ_TIMER]) { in kvm_put_xen_state()
1879 RUN_ON_CPU_HOST_INT(env->xen_virq[VIRQ_TIMER])); in kvm_put_xen_state()
1887 CPUX86State *env = &cpu->env; in kvm_get_xen_state()
1897 gpa = env->xen_vcpu_info_gpa; in kvm_get_xen_state()
1899 gpa = env->xen_vcpu_info_default_gpa; in kvm_get_xen_state()
1920 if (env->xen_virq[VIRQ_TIMER]) { in kvm_get_xen_state()
1931 * There is an unavoidable race condition if a different vCPU sets a in kvm_get_xen_state()
1936 QEMU_LOCK_GUARD(&X86_CPU(cs)->env.xen_timers_lock); in kvm_get_xen_state()
1937 env->xen_singleshot_timer_ns = va.u.timer.expires_ns; in kvm_get_xen_state()