4 * Copyright (C) 2006-2008 Qumranet Technologies
6 * Licensed under the terms of the GNU GPL version 2 or higher.
9 #include "config-host.h"
19 #include "qemu-common.h"
27 #include <sys/utsname.h>
28 #include <sys/syscall.h>
35 extern void perror(const char *s
);
37 kvm_context_t kvm_context
;
41 pthread_mutex_t qemu_mutex
= PTHREAD_MUTEX_INITIALIZER
;
42 pthread_cond_t qemu_vcpu_cond
= PTHREAD_COND_INITIALIZER
;
43 pthread_cond_t qemu_system_cond
= PTHREAD_COND_INITIALIZER
;
44 pthread_cond_t qemu_pause_cond
= PTHREAD_COND_INITIALIZER
;
45 pthread_cond_t qemu_work_cond
= PTHREAD_COND_INITIALIZER
;
46 __thread
struct vcpu_info
*vcpu
;
48 static int qemu_system_ready
;
50 #define SIG_IPI (SIGRTMIN+4)
52 struct qemu_kvm_work_item
{
53 struct qemu_kvm_work_item
*next
;
54 void (*func
)(void *data
);
68 struct qemu_kvm_work_item
*queued_work_first
, *queued_work_last
;
72 static int io_thread_fd
= -1;
73 static int io_thread_sigfd
= -1;
75 static int kvm_debug_stop_requested
;
77 static inline unsigned long kvm_get_thread_id(void)
79 return syscall(SYS_gettid
);
82 static void qemu_cond_wait(pthread_cond_t
*cond
)
84 CPUState
*env
= cpu_single_env
;
85 static const struct timespec ts
= {
90 pthread_cond_timedwait(cond
, &qemu_mutex
, &ts
);
94 CPUState
*qemu_kvm_cpu_env(int index
)
96 return vcpu_info
[index
].env
;
99 static void sig_ipi_handler(int n
)
103 static void on_vcpu(CPUState
*env
, void (*func
)(void *data
), void *data
)
105 struct vcpu_info
*vi
= &vcpu_info
[env
->cpu_index
];
106 struct qemu_kvm_work_item wi
;
115 if (!vi
->queued_work_first
)
116 vi
->queued_work_first
= &wi
;
118 vi
->queued_work_last
->next
= &wi
;
119 vi
->queued_work_last
= &wi
;
123 pthread_kill(vi
->thread
, SIG_IPI
);
125 qemu_cond_wait(&qemu_work_cond
);
128 static void inject_interrupt(void *data
)
130 cpu_interrupt(vcpu
->env
, (int)data
);
133 void kvm_inject_interrupt(CPUState
*env
, int mask
)
135 on_vcpu(env
, inject_interrupt
, (void *)mask
);
138 void kvm_update_interrupt_request(CPUState
*env
)
145 if (vcpu
&& env
!= vcpu
->env
&& !vcpu_info
[env
->cpu_index
].signalled
)
149 vcpu_info
[env
->cpu_index
].signalled
= 1;
150 if (vcpu_info
[env
->cpu_index
].thread
)
151 pthread_kill(vcpu_info
[env
->cpu_index
].thread
, SIG_IPI
);
156 void kvm_update_after_sipi(CPUState
*env
)
158 vcpu_info
[env
->cpu_index
].sipi_needed
= 1;
159 kvm_update_interrupt_request(env
);
162 void kvm_apic_init(CPUState
*env
)
164 if (env
->cpu_index
!= 0)
165 vcpu_info
[env
->cpu_index
].init
= 1;
166 kvm_update_interrupt_request(env
);
171 static int try_push_interrupts(void *opaque
)
173 return kvm_arch_try_push_interrupts(opaque
);
176 static int try_push_nmi(void *opaque
)
178 return kvm_arch_try_push_nmi(opaque
);
181 static void post_kvm_run(void *opaque
, int vcpu
)
184 pthread_mutex_lock(&qemu_mutex
);
185 kvm_arch_post_kvm_run(opaque
, vcpu
);
188 static int pre_kvm_run(void *opaque
, int vcpu
)
190 CPUState
*env
= qemu_kvm_cpu_env(vcpu
);
192 kvm_arch_pre_kvm_run(opaque
, vcpu
);
194 if (env
->interrupt_request
& CPU_INTERRUPT_EXIT
)
196 pthread_mutex_unlock(&qemu_mutex
);
200 static void kvm_do_load_registers(void *_env
)
202 CPUState
*env
= _env
;
204 kvm_arch_load_regs(env
);
207 void kvm_load_registers(CPUState
*env
)
209 if (kvm_enabled() && qemu_system_ready
)
210 on_vcpu(env
, kvm_do_load_registers
, env
);
213 static void kvm_do_save_registers(void *_env
)
215 CPUState
*env
= _env
;
217 kvm_arch_save_regs(env
);
220 void kvm_save_registers(CPUState
*env
)
223 on_vcpu(env
, kvm_do_save_registers
, env
);
226 int kvm_cpu_exec(CPUState
*env
)
230 r
= kvm_run(kvm_context
, env
->cpu_index
);
232 printf("kvm_run returned %d\n", r
);
239 extern int vm_running
;
241 static int has_work(CPUState
*env
)
243 if (!vm_running
|| (env
&& vcpu_info
[env
->cpu_index
].stopped
))
247 return kvm_arch_has_work(env
);
250 static void flush_queued_work(CPUState
*env
)
252 struct vcpu_info
*vi
= &vcpu_info
[env
->cpu_index
];
253 struct qemu_kvm_work_item
*wi
;
255 if (!vi
->queued_work_first
)
258 while ((wi
= vi
->queued_work_first
)) {
259 vi
->queued_work_first
= wi
->next
;
263 vi
->queued_work_last
= NULL
;
264 pthread_cond_broadcast(&qemu_work_cond
);
267 static void kvm_main_loop_wait(CPUState
*env
, int timeout
)
274 pthread_mutex_unlock(&qemu_mutex
);
276 ts
.tv_sec
= timeout
/ 1000;
277 ts
.tv_nsec
= (timeout
% 1000) * 1000000;
278 sigemptyset(&waitset
);
279 sigaddset(&waitset
, SIG_IPI
);
281 r
= sigtimedwait(&waitset
, &siginfo
, &ts
);
284 pthread_mutex_lock(&qemu_mutex
);
286 if (r
== -1 && !(e
== EAGAIN
|| e
== EINTR
)) {
287 printf("sigtimedwait: %s\n", strerror(e
));
291 cpu_single_env
= env
;
292 flush_queued_work(env
);
294 if (vcpu_info
[env
->cpu_index
].stop
) {
295 vcpu_info
[env
->cpu_index
].stop
= 0;
296 vcpu_info
[env
->cpu_index
].stopped
= 1;
297 pthread_cond_signal(&qemu_pause_cond
);
300 vcpu_info
[env
->cpu_index
].signalled
= 0;
303 static int all_threads_paused(void)
307 for (i
= 0; i
< smp_cpus
; ++i
)
308 if (vcpu_info
[i
].stop
)
313 static void pause_all_threads(void)
317 assert(!cpu_single_env
);
319 for (i
= 0; i
< smp_cpus
; ++i
) {
320 vcpu_info
[i
].stop
= 1;
321 pthread_kill(vcpu_info
[i
].thread
, SIG_IPI
);
323 while (!all_threads_paused())
324 qemu_cond_wait(&qemu_pause_cond
);
327 static void resume_all_threads(void)
331 assert(!cpu_single_env
);
333 for (i
= 0; i
< smp_cpus
; ++i
) {
334 vcpu_info
[i
].stop
= 0;
335 vcpu_info
[i
].stopped
= 0;
336 pthread_kill(vcpu_info
[i
].thread
, SIG_IPI
);
340 static void kvm_vm_state_change_handler(void *context
, int running
)
343 resume_all_threads();
348 static void update_regs_for_sipi(CPUState
*env
)
350 kvm_arch_update_regs_for_sipi(env
);
351 vcpu_info
[env
->cpu_index
].sipi_needed
= 0;
352 vcpu_info
[env
->cpu_index
].init
= 0;
355 static void update_regs_for_init(CPUState
*env
)
358 kvm_arch_load_regs(env
);
361 static void setup_kernel_sigmask(CPUState
*env
)
366 sigaddset(&set
, SIGUSR2
);
367 sigaddset(&set
, SIGIO
);
368 sigaddset(&set
, SIGALRM
);
369 sigprocmask(SIG_BLOCK
, &set
, NULL
);
371 sigprocmask(SIG_BLOCK
, NULL
, &set
);
372 sigdelset(&set
, SIG_IPI
);
374 kvm_set_signal_mask(kvm_context
, env
->cpu_index
, &set
);
377 void qemu_kvm_system_reset(void)
385 for (i
= 0; i
< smp_cpus
; ++i
)
386 kvm_arch_cpu_reset(vcpu_info
[i
].env
);
388 resume_all_threads();
391 static int kvm_main_loop_cpu(CPUState
*env
)
393 struct vcpu_info
*info
= &vcpu_info
[env
->cpu_index
];
395 setup_kernel_sigmask(env
);
397 pthread_mutex_lock(&qemu_mutex
);
398 if (kvm_irqchip_in_kernel(kvm_context
))
401 kvm_qemu_init_env(env
);
403 kvm_tpr_vcpu_start(env
);
406 cpu_single_env
= env
;
407 kvm_load_registers(env
);
410 while (!has_work(env
))
411 kvm_main_loop_wait(env
, 1000);
412 if (env
->interrupt_request
& (CPU_INTERRUPT_HARD
| CPU_INTERRUPT_NMI
))
414 if (!kvm_irqchip_in_kernel(kvm_context
) && info
->sipi_needed
)
415 update_regs_for_sipi(env
);
416 if (!kvm_irqchip_in_kernel(kvm_context
) && info
->init
)
417 update_regs_for_init(env
);
418 if (!env
->halted
&& !info
->init
)
420 env
->interrupt_request
&= ~CPU_INTERRUPT_EXIT
;
421 kvm_main_loop_wait(env
, 0);
423 pthread_mutex_unlock(&qemu_mutex
);
427 static void *ap_main_loop(void *_env
)
429 CPUState
*env
= _env
;
432 vcpu
= &vcpu_info
[env
->cpu_index
];
434 vcpu
->env
->thread_id
= kvm_get_thread_id();
435 sigfillset(&signals
);
436 sigprocmask(SIG_BLOCK
, &signals
, NULL
);
437 kvm_create_vcpu(kvm_context
, env
->cpu_index
);
438 kvm_qemu_init_env(env
);
440 /* signal VCPU creation */
441 pthread_mutex_lock(&qemu_mutex
);
443 pthread_cond_signal(&qemu_vcpu_cond
);
445 /* and wait for machine initialization */
446 while (!qemu_system_ready
)
447 qemu_cond_wait(&qemu_system_cond
);
448 pthread_mutex_unlock(&qemu_mutex
);
450 kvm_main_loop_cpu(env
);
454 void kvm_init_new_ap(int cpu
, CPUState
*env
)
456 pthread_create(&vcpu_info
[cpu
].thread
, NULL
, ap_main_loop
, env
);
458 while (vcpu_info
[cpu
].created
== 0)
459 qemu_cond_wait(&qemu_vcpu_cond
);
462 int kvm_init_ap(void)
467 qemu_add_vm_change_state_handler(kvm_vm_state_change_handler
, NULL
);
469 signal(SIG_IPI
, sig_ipi_handler
);
473 void qemu_kvm_notify_work(void)
479 if (io_thread_fd
== -1)
482 memcpy(buffer
, &value
, sizeof(value
));
487 len
= write(io_thread_fd
, buffer
+ offset
, 8 - offset
);
488 if (len
== -1 && errno
== EINTR
)
498 fprintf(stderr
, "failed to notify io thread\n");
501 /* If we have signalfd, we mask out the signals we want to handle and then
502 * use signalfd to listen for them. We rely on whatever the current signal
503 * handler is to dispatch the signals when we receive them.
506 static void sigfd_handler(void *opaque
)
508 int fd
= (unsigned long)opaque
;
509 struct qemu_signalfd_siginfo info
;
510 struct sigaction action
;
515 len
= read(fd
, &info
, sizeof(info
));
516 } while (len
== -1 && errno
== EINTR
);
518 if (len
== -1 && errno
== EAGAIN
)
521 if (len
!= sizeof(info
)) {
522 printf("read from sigfd returned %ld: %m\n", len
);
526 sigaction(info
.ssi_signo
, NULL
, &action
);
527 if (action
.sa_handler
)
528 action
.sa_handler(info
.ssi_signo
);
533 /* Used to break IO thread out of select */
534 static void io_thread_wakeup(void *opaque
)
536 int fd
= (unsigned long)opaque
;
543 len
= read(fd
, buffer
+ offset
, 8 - offset
);
544 if (len
== -1 && errno
== EINTR
)
554 int kvm_main_loop(void)
560 io_thread
= pthread_self();
561 qemu_system_ready
= 1;
563 if (qemu_eventfd(fds
) == -1) {
564 fprintf(stderr
, "failed to create eventfd\n");
568 qemu_set_fd_handler2(fds
[0], NULL
, io_thread_wakeup
, NULL
,
569 (void *)(unsigned long)fds
[0]);
571 io_thread_fd
= fds
[1];
574 sigaddset(&mask
, SIGIO
);
575 sigaddset(&mask
, SIGALRM
);
576 sigprocmask(SIG_BLOCK
, &mask
, NULL
);
578 sigfd
= qemu_signalfd(&mask
);
580 fprintf(stderr
, "failed to create signalfd\n");
584 fcntl(sigfd
, F_SETFL
, O_NONBLOCK
);
586 qemu_set_fd_handler2(sigfd
, NULL
, sigfd_handler
, NULL
,
587 (void *)(unsigned long)sigfd
);
589 pthread_cond_broadcast(&qemu_system_cond
);
591 io_thread_sigfd
= sigfd
;
592 cpu_single_env
= NULL
;
595 main_loop_wait(1000);
596 if (qemu_shutdown_requested())
598 else if (qemu_powerdown_requested())
599 qemu_system_powerdown();
600 else if (qemu_reset_requested())
601 qemu_kvm_system_reset();
602 else if (kvm_debug_stop_requested
) {
604 kvm_debug_stop_requested
= 0;
609 pthread_mutex_unlock(&qemu_mutex
);
614 static int kvm_debug(void *opaque
, int vcpu
)
616 kvm_debug_stop_requested
= 1;
617 vcpu_info
[vcpu
].stopped
= 1;
621 static int kvm_inb(void *opaque
, uint16_t addr
, uint8_t *data
)
623 *data
= cpu_inb(0, addr
);
627 static int kvm_inw(void *opaque
, uint16_t addr
, uint16_t *data
)
629 *data
= cpu_inw(0, addr
);
633 static int kvm_inl(void *opaque
, uint16_t addr
, uint32_t *data
)
635 *data
= cpu_inl(0, addr
);
639 #define PM_IO_BASE 0xb000
641 static int kvm_outb(void *opaque
, uint16_t addr
, uint8_t data
)
646 cpu_outb(0, 0xb3, 0);
653 x
= cpu_inw(0, PM_IO_BASE
+ 4);
655 cpu_outw(0, PM_IO_BASE
+ 4, x
);
662 x
= cpu_inw(0, PM_IO_BASE
+ 4);
664 cpu_outw(0, PM_IO_BASE
+ 4, x
);
672 cpu_outb(0, addr
, data
);
676 static int kvm_outw(void *opaque
, uint16_t addr
, uint16_t data
)
678 cpu_outw(0, addr
, data
);
682 static int kvm_outl(void *opaque
, uint16_t addr
, uint32_t data
)
684 cpu_outl(0, addr
, data
);
688 static int kvm_mmio_read(void *opaque
, uint64_t addr
, uint8_t *data
, int len
)
690 cpu_physical_memory_rw(addr
, data
, len
, 0);
694 static int kvm_mmio_write(void *opaque
, uint64_t addr
, uint8_t *data
, int len
)
696 cpu_physical_memory_rw(addr
, data
, len
, 1);
700 static int kvm_io_window(void *opaque
)
706 static int kvm_halt(void *opaque
, int vcpu
)
708 return kvm_arch_halt(opaque
, vcpu
);
711 static int kvm_shutdown(void *opaque
, int vcpu
)
713 /* stop the current vcpu from going back to guest mode */
714 vcpu_info
[cpu_single_env
->cpu_index
].stopped
= 1;
716 qemu_system_reset_request();
720 static struct kvm_callbacks qemu_kvm_ops
= {
728 .mmio_read
= kvm_mmio_read
,
729 .mmio_write
= kvm_mmio_write
,
731 .shutdown
= kvm_shutdown
,
732 .io_window
= kvm_io_window
,
733 .try_push_interrupts
= try_push_interrupts
,
734 .try_push_nmi
= try_push_nmi
,
735 .post_kvm_run
= post_kvm_run
,
736 .pre_kvm_run
= pre_kvm_run
,
738 .tpr_access
= handle_tpr_access
,
741 .powerpc_dcr_read
= handle_powerpc_dcr_read
,
742 .powerpc_dcr_write
= handle_powerpc_dcr_write
,
748 /* Try to initialize kvm */
749 kvm_context
= kvm_init(&qemu_kvm_ops
, cpu_single_env
);
753 pthread_mutex_lock(&qemu_mutex
);
758 int kvm_qemu_create_context(void)
762 kvm_disable_irqchip_creation(kvm_context
);
765 kvm_disable_pit_creation(kvm_context
);
767 if (kvm_create(kvm_context
, phys_ram_size
, (void**)&phys_ram_base
) < 0) {
771 r
= kvm_arch_qemu_create_context();
777 void kvm_qemu_destroy(void)
779 kvm_finalize(kvm_context
);
782 void kvm_cpu_register_physical_memory(target_phys_addr_t start_addr
,
784 unsigned long phys_offset
)
787 unsigned long area_flags
= phys_offset
& ~TARGET_PAGE_MASK
;
789 phys_offset
&= ~IO_MEM_ROM
;
791 if (area_flags
== IO_MEM_UNASSIGNED
) {
792 kvm_unregister_memory_area(kvm_context
, start_addr
, size
);
796 r
= kvm_is_containing_region(kvm_context
, start_addr
, size
);
800 if (area_flags
>= TLB_MMIO
)
803 r
= kvm_register_phys_mem(kvm_context
, start_addr
,
804 phys_ram_base
+ phys_offset
,
807 printf("kvm_cpu_register_physical_memory: failed\n");
813 void kvm_cpu_unregister_physical_memory(target_phys_addr_t start_addr
,
814 target_phys_addr_t size
,
815 unsigned long phys_offset
)
817 kvm_unregister_memory_area(kvm_context
, start_addr
, size
);
820 int kvm_setup_guest_memory(void *area
, unsigned long size
)
825 if (kvm_enabled() && !kvm_has_sync_mmu(kvm_context
))
826 ret
= madvise(area
, size
, MADV_DONTFORK
);
835 int kvm_qemu_check_extension(int ext
)
837 return kvm_check_extension(kvm_context
, ext
);
840 int kvm_qemu_init_env(CPUState
*cenv
)
842 return kvm_arch_qemu_init_env(cenv
);
845 struct kvm_guest_debug_data
{
846 struct kvm_debug_guest dbg
;
850 void kvm_invoke_guest_debug(void *data
)
852 struct kvm_guest_debug_data
*dbg_data
= data
;
854 dbg_data
->err
= kvm_guest_debug(kvm_context
, cpu_single_env
->cpu_index
,
858 int kvm_update_debugger(CPUState
*env
)
860 struct kvm_guest_debug_data data
;
863 memset(data
.dbg
.breakpoints
, 0, sizeof(data
.dbg
.breakpoints
));
865 data
.dbg
.enabled
= 0;
866 if (env
->nb_breakpoints
|| env
->singlestep_enabled
) {
867 data
.dbg
.enabled
= 1;
868 for (i
= 0; i
< 4 && i
< env
->nb_breakpoints
; ++i
) {
869 data
.dbg
.breakpoints
[i
].enabled
= 1;
870 data
.dbg
.breakpoints
[i
].address
= env
->breakpoints
[i
];
872 data
.dbg
.singlestep
= env
->singlestep_enabled
;
874 on_vcpu(env
, kvm_invoke_guest_debug
, &data
);
880 * dirty pages logging
882 /* FIXME: use unsigned long pointer instead of unsigned char */
883 unsigned char *kvm_dirty_bitmap
= NULL
;
884 int kvm_physical_memory_set_dirty_tracking(int enable
)
892 if (!kvm_dirty_bitmap
) {
893 unsigned bitmap_size
= BITMAP_SIZE(phys_ram_size
);
894 kvm_dirty_bitmap
= qemu_malloc(bitmap_size
);
895 if (kvm_dirty_bitmap
== NULL
) {
896 perror("Failed to allocate dirty pages bitmap");
900 r
= kvm_dirty_pages_log_enable_all(kvm_context
);
905 if (kvm_dirty_bitmap
) {
906 r
= kvm_dirty_pages_log_reset(kvm_context
);
907 qemu_free(kvm_dirty_bitmap
);
908 kvm_dirty_bitmap
= NULL
;
914 /* get kvm's dirty pages bitmap and update qemu's */
915 int kvm_get_dirty_pages_log_range(unsigned long start_addr
,
916 unsigned char *bitmap
,
918 unsigned long mem_size
)
920 unsigned int i
, j
, n
=0;
922 unsigned page_number
, addr
, addr1
;
923 unsigned int len
= ((mem_size
/TARGET_PAGE_SIZE
) + 7) / 8;
926 * bitmap-traveling is faster than memory-traveling (for addr...)
927 * especially when most of the memory is not dirty.
929 for (i
=0; i
<len
; i
++) {
934 page_number
= i
* 8 + j
;
935 addr1
= page_number
* TARGET_PAGE_SIZE
;
936 addr
= offset
+ addr1
;
937 cpu_physical_memory_set_dirty(addr
);
943 int kvm_get_dirty_bitmap_cb(unsigned long start
, unsigned long len
,
944 void *bitmap
, void *opaque
)
946 return kvm_get_dirty_pages_log_range(start
, bitmap
, start
, len
);
950 * get kvm's dirty pages bitmap and update qemu's
951 * we only care about physical ram, which resides in slots 0 and 3
953 int kvm_update_dirty_pages_log(void)
958 r
= kvm_get_dirty_pages_range(kvm_context
, 0, phys_ram_size
,
959 kvm_dirty_bitmap
, NULL
,
960 kvm_get_dirty_bitmap_cb
);
964 void kvm_qemu_log_memory(target_phys_addr_t start
, target_phys_addr_t size
,
968 kvm_dirty_pages_log_enable_slot(kvm_context
, start
, size
);
970 kvm_dirty_pages_log_disable_slot(kvm_context
, start
, size
);
973 int kvm_get_phys_ram_page_bitmap(unsigned char *bitmap
)
975 unsigned int bsize
= BITMAP_SIZE(phys_ram_size
);
976 unsigned int brsize
= BITMAP_SIZE(ram_size
);
977 unsigned int extra_pages
= (phys_ram_size
- ram_size
) / TARGET_PAGE_SIZE
;
978 unsigned int extra_bytes
= (extra_pages
+7)/8;
979 unsigned int hole_start
= BITMAP_SIZE(0xa0000);
980 unsigned int hole_end
= BITMAP_SIZE(0xc0000);
982 memset(bitmap
, 0xFF, brsize
+ extra_bytes
);
983 memset(bitmap
+ hole_start
, 0, hole_end
- hole_start
);
984 memset(bitmap
+ brsize
+ extra_bytes
, 0, bsize
- brsize
- extra_bytes
);
989 #ifdef KVM_CAP_IRQCHIP
991 int kvm_set_irq(int irq
, int level
)
993 return kvm_set_irq_level(kvm_context
, irq
, level
);
998 int qemu_kvm_get_dirty_pages(unsigned long phys_addr
, void *buf
)
1000 return kvm_get_dirty_pages(kvm_context
, phys_addr
, buf
);
1003 void *kvm_cpu_create_phys_mem(target_phys_addr_t start_addr
,
1004 unsigned long size
, int log
, int writable
)
1006 return kvm_create_phys_mem(kvm_context
, start_addr
, size
, log
, writable
);
1009 void kvm_cpu_destroy_phys_mem(target_phys_addr_t start_addr
,
1012 kvm_destroy_phys_mem(kvm_context
, start_addr
, size
);
1015 void kvm_mutex_unlock(void)
1017 assert(!cpu_single_env
);
1018 pthread_mutex_unlock(&qemu_mutex
);
1021 void kvm_mutex_lock(void)
1023 pthread_mutex_lock(&qemu_mutex
);
1024 cpu_single_env
= NULL
;
1027 int qemu_kvm_register_coalesced_mmio(target_phys_addr_t addr
, unsigned int size
)
1029 return kvm_register_coalesced_mmio(kvm_context
, addr
, size
);
1032 int qemu_kvm_unregister_coalesced_mmio(target_phys_addr_t addr
,
1035 return kvm_unregister_coalesced_mmio(kvm_context
, addr
, size
);