2
0

kvm-stub.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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/osdep.h"
  13. #include "qemu-common.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_resamplefds_allowed;
  25. bool kvm_msi_via_irqfd_allowed;
  26. bool kvm_gsi_routing_allowed;
  27. bool kvm_gsi_direct_mapping;
  28. bool kvm_allowed;
  29. bool kvm_readonly_mem_allowed;
  30. bool kvm_ioeventfd_any_length_allowed;
  31. bool kvm_msi_use_devid;
  32. int kvm_destroy_vcpu(CPUState *cpu)
  33. {
  34. return -ENOSYS;
  35. }
  36. int kvm_init_vcpu(CPUState *cpu)
  37. {
  38. return -ENOSYS;
  39. }
  40. void kvm_flush_coalesced_mmio_buffer(void)
  41. {
  42. }
  43. void kvm_cpu_synchronize_state(CPUState *cpu)
  44. {
  45. }
  46. void kvm_cpu_synchronize_post_reset(CPUState *cpu)
  47. {
  48. }
  49. void kvm_cpu_synchronize_post_init(CPUState *cpu)
  50. {
  51. }
  52. int kvm_cpu_exec(CPUState *cpu)
  53. {
  54. abort();
  55. }
  56. int kvm_has_sync_mmu(void)
  57. {
  58. return 0;
  59. }
  60. int kvm_has_many_ioeventfds(void)
  61. {
  62. return 0;
  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. int kvm_on_sigbus_vcpu(CPUState *cpu, int code, void *addr)
  82. {
  83. return 1;
  84. }
  85. int kvm_on_sigbus(int code, void *addr)
  86. {
  87. return 1;
  88. }
  89. #ifndef CONFIG_USER_ONLY
  90. int kvm_irqchip_add_msi_route(KVMState *s, int vector, PCIDevice *dev)
  91. {
  92. return -ENOSYS;
  93. }
  94. void kvm_init_irq_routing(KVMState *s)
  95. {
  96. }
  97. void kvm_irqchip_release_virq(KVMState *s, int virq)
  98. {
  99. }
  100. int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg,
  101. PCIDevice *dev)
  102. {
  103. return -ENOSYS;
  104. }
  105. void kvm_irqchip_commit_routes(KVMState *s)
  106. {
  107. }
  108. int kvm_irqchip_add_adapter_route(KVMState *s, AdapterInfo *adapter)
  109. {
  110. return -ENOSYS;
  111. }
  112. int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
  113. EventNotifier *rn, int virq)
  114. {
  115. return -ENOSYS;
  116. }
  117. int kvm_irqchip_remove_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
  118. int virq)
  119. {
  120. return -ENOSYS;
  121. }
  122. bool kvm_has_free_slot(MachineState *ms)
  123. {
  124. return false;
  125. }
  126. void kvm_init_cpu_signals(CPUState *cpu)
  127. {
  128. abort();
  129. }
  130. #endif