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. void kvm_flush_coalesced_mmio_buffer(void)
  34. {
  35. }
  36. void kvm_cpu_synchronize_state(CPUState *cpu)
  37. {
  38. }
  39. void kvm_cpu_synchronize_post_reset(CPUState *cpu)
  40. {
  41. }
  42. void kvm_cpu_synchronize_post_init(CPUState *cpu)
  43. {
  44. }
  45. int kvm_cpu_exec(CPUState *cpu)
  46. {
  47. abort();
  48. }
  49. int kvm_has_sync_mmu(void)
  50. {
  51. return 0;
  52. }
  53. int kvm_has_many_ioeventfds(void)
  54. {
  55. return 0;
  56. }
  57. int kvm_has_pit_state2(void)
  58. {
  59. return 0;
  60. }
  61. void kvm_setup_guest_memory(void *start, size_t size)
  62. {
  63. }
  64. int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap)
  65. {
  66. return -ENOSYS;
  67. }
  68. int kvm_insert_breakpoint(CPUState *cpu, target_ulong addr,
  69. target_ulong len, int type)
  70. {
  71. return -EINVAL;
  72. }
  73. int kvm_remove_breakpoint(CPUState *cpu, target_ulong addr,
  74. target_ulong len, int type)
  75. {
  76. return -EINVAL;
  77. }
  78. void kvm_remove_all_breakpoints(CPUState *cpu)
  79. {
  80. }
  81. #ifndef _WIN32
  82. int kvm_set_signal_mask(CPUState *cpu, const sigset_t *sigset)
  83. {
  84. abort();
  85. }
  86. #endif
  87. int kvm_on_sigbus_vcpu(CPUState *cpu, int code, void *addr)
  88. {
  89. return 1;
  90. }
  91. int kvm_on_sigbus(int code, void *addr)
  92. {
  93. return 1;
  94. }
  95. #ifndef CONFIG_USER_ONLY
  96. int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg)
  97. {
  98. return -ENOSYS;
  99. }
  100. void kvm_init_irq_routing(KVMState *s)
  101. {
  102. }
  103. void kvm_irqchip_release_virq(KVMState *s, int virq)
  104. {
  105. }
  106. int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg)
  107. {
  108. return -ENOSYS;
  109. }
  110. int kvm_irqchip_add_adapter_route(KVMState *s, AdapterInfo *adapter)
  111. {
  112. return -ENOSYS;
  113. }
  114. int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n,
  115. EventNotifier *rn, int virq)
  116. {
  117. return -ENOSYS;
  118. }
  119. int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, int virq)
  120. {
  121. return -ENOSYS;
  122. }
  123. bool kvm_has_free_slot(MachineState *ms)
  124. {
  125. return false;
  126. }
  127. #endif