kvm-stub.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*
  2. * QEMU KVM stub
  3. *
  4. * Copyright Red Hat, Inc. 2010
  5. *
  6. * Author: Paolo Bonzini <pbonzini@redhat.com>
  7. *
  8. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  9. * See the COPYING file in the top-level directory.
  10. *
  11. */
  12. #include "qemu-common.h"
  13. #include "hw/hw.h"
  14. #include "cpu.h"
  15. #include "sysemu/kvm.h"
  16. #ifndef CONFIG_USER_ONLY
  17. #include "hw/pci/msi.h"
  18. #endif
  19. KVMState *kvm_state;
  20. bool kvm_kernel_irqchip;
  21. bool kvm_async_interrupts_allowed;
  22. bool kvm_eventfds_allowed;
  23. bool kvm_irqfds_allowed;
  24. bool kvm_msi_via_irqfd_allowed;
  25. bool kvm_gsi_routing_allowed;
  26. bool kvm_gsi_direct_mapping;
  27. bool kvm_allowed;
  28. bool kvm_readonly_mem_allowed;
  29. int kvm_init_vcpu(CPUState *cpu)
  30. {
  31. return -ENOSYS;
  32. }
  33. int kvm_init(MachineClass *mc)
  34. {
  35. return -ENOSYS;
  36. }
  37. void kvm_flush_coalesced_mmio_buffer(void)
  38. {
  39. }
  40. void kvm_cpu_synchronize_state(CPUState *cpu)
  41. {
  42. }
  43. void kvm_cpu_synchronize_post_reset(CPUState *cpu)
  44. {
  45. }
  46. void kvm_cpu_synchronize_post_init(CPUState *cpu)
  47. {
  48. }
  49. int kvm_cpu_exec(CPUState *cpu)
  50. {
  51. abort();
  52. }
  53. int kvm_has_sync_mmu(void)
  54. {
  55. return 0;
  56. }
  57. int kvm_has_many_ioeventfds(void)
  58. {
  59. return 0;
  60. }
  61. int kvm_has_pit_state2(void)
  62. {
  63. return 0;
  64. }
  65. void kvm_setup_guest_memory(void *start, size_t size)
  66. {
  67. }
  68. int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap)
  69. {
  70. return -ENOSYS;
  71. }
  72. int kvm_insert_breakpoint(CPUState *cpu, target_ulong addr,
  73. target_ulong len, int type)
  74. {
  75. return -EINVAL;
  76. }
  77. int kvm_remove_breakpoint(CPUState *cpu, target_ulong addr,
  78. target_ulong len, int type)
  79. {
  80. return -EINVAL;
  81. }
  82. void kvm_remove_all_breakpoints(CPUState *cpu)
  83. {
  84. }
  85. #ifndef _WIN32
  86. int kvm_set_signal_mask(CPUState *cpu, const sigset_t *sigset)
  87. {
  88. abort();
  89. }
  90. #endif
  91. int kvm_on_sigbus_vcpu(CPUState *cpu, int code, void *addr)
  92. {
  93. return 1;
  94. }
  95. int kvm_on_sigbus(int code, void *addr)
  96. {
  97. return 1;
  98. }
  99. #ifndef CONFIG_USER_ONLY
  100. int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg)
  101. {
  102. return -ENOSYS;
  103. }
  104. void kvm_init_irq_routing(KVMState *s)
  105. {
  106. }
  107. void kvm_irqchip_release_virq(KVMState *s, int virq)
  108. {
  109. }
  110. int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg)
  111. {
  112. return -ENOSYS;
  113. }
  114. int kvm_irqchip_add_adapter_route(KVMState *s, AdapterInfo *adapter)
  115. {
  116. return -ENOSYS;
  117. }
  118. int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n,
  119. EventNotifier *rn, int virq)
  120. {
  121. return -ENOSYS;
  122. }
  123. int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, int virq)
  124. {
  125. return -ENOSYS;
  126. }
  127. #endif