xref: /openbmc/qemu/accel/stubs/kvm-stub.c (revision 40f23e4e)
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 
13 #include "qemu/osdep.h"
14 #include "sysemu/kvm.h"
15 
16 #ifndef CONFIG_USER_ONLY
17 #include "hw/pci/msi.h"
18 #endif
19 
20 KVMState *kvm_state;
21 bool kvm_kernel_irqchip;
22 bool kvm_async_interrupts_allowed;
23 bool kvm_eventfds_allowed;
24 bool kvm_irqfds_allowed;
25 bool kvm_resamplefds_allowed;
26 bool kvm_msi_via_irqfd_allowed;
27 bool kvm_gsi_routing_allowed;
28 bool kvm_gsi_direct_mapping;
29 bool kvm_allowed;
30 bool kvm_readonly_mem_allowed;
31 bool kvm_ioeventfd_any_length_allowed;
32 bool kvm_msi_use_devid;
33 
34 void kvm_flush_coalesced_mmio_buffer(void)
35 {
36 }
37 
38 void kvm_cpu_synchronize_state(CPUState *cpu)
39 {
40 }
41 
42 bool kvm_has_sync_mmu(void)
43 {
44     return false;
45 }
46 
47 int kvm_has_many_ioeventfds(void)
48 {
49     return 0;
50 }
51 
52 int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap)
53 {
54     return -ENOSYS;
55 }
56 
57 int kvm_insert_breakpoint(CPUState *cpu, target_ulong addr,
58                           target_ulong len, int type)
59 {
60     return -EINVAL;
61 }
62 
63 int kvm_remove_breakpoint(CPUState *cpu, target_ulong addr,
64                           target_ulong len, int type)
65 {
66     return -EINVAL;
67 }
68 
69 void kvm_remove_all_breakpoints(CPUState *cpu)
70 {
71 }
72 
73 int kvm_on_sigbus_vcpu(CPUState *cpu, int code, void *addr)
74 {
75     return 1;
76 }
77 
78 int kvm_on_sigbus(int code, void *addr)
79 {
80     return 1;
81 }
82 
83 #ifndef CONFIG_USER_ONLY
84 int kvm_irqchip_add_msi_route(KVMState *s, int vector, PCIDevice *dev)
85 {
86     return -ENOSYS;
87 }
88 
89 void kvm_init_irq_routing(KVMState *s)
90 {
91 }
92 
93 void kvm_irqchip_release_virq(KVMState *s, int virq)
94 {
95 }
96 
97 int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg,
98                                  PCIDevice *dev)
99 {
100     return -ENOSYS;
101 }
102 
103 void kvm_irqchip_commit_routes(KVMState *s)
104 {
105 }
106 
107 void kvm_irqchip_add_change_notifier(Notifier *n)
108 {
109 }
110 
111 void kvm_irqchip_remove_change_notifier(Notifier *n)
112 {
113 }
114 
115 void kvm_irqchip_change_notify(void)
116 {
117 }
118 
119 int kvm_irqchip_add_adapter_route(KVMState *s, AdapterInfo *adapter)
120 {
121     return -ENOSYS;
122 }
123 
124 int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
125                                        EventNotifier *rn, int virq)
126 {
127     return -ENOSYS;
128 }
129 
130 int kvm_irqchip_remove_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
131                                           int virq)
132 {
133     return -ENOSYS;
134 }
135 
136 bool kvm_has_free_slot(MachineState *ms)
137 {
138     return false;
139 }
140 
141 void kvm_init_cpu_signals(CPUState *cpu)
142 {
143     abort();
144 }
145 
146 bool kvm_arm_supports_user_irq(void)
147 {
148     return false;
149 }
150 #endif
151