blob: 8a5959e3535f401482d866de6c8487e40138ea15 [file] [log] [blame]
Avi Kivity3f0852e2009-12-20 14:42:19 +02001#ifndef __KVM_COALESCED_MMIO_H__
2#define __KVM_COALESCED_MMIO_H__
3
Laurent Vivier5f94c172008-05-30 16:05:54 +02004/*
5 * KVM coalesced MMIO
6 *
7 * Copyright (c) 2008 Bull S.A.S.
8 *
9 * Author: Laurent Vivier <Laurent.Vivier@bull.net>
10 *
11 */
12
Avi Kivity980da6c2009-12-20 15:13:43 +020013#ifdef CONFIG_KVM_MMIO
14
Laurent Vivier5f94c172008-05-30 16:05:54 +020015#define KVM_COALESCED_MMIO_ZONE_MAX 100
16
17struct kvm_coalesced_mmio_dev {
18 struct kvm_io_device dev;
19 struct kvm *kvm;
Marcelo Tosatti64a22682009-06-04 15:08:22 -030020 spinlock_t lock;
Laurent Vivier5f94c172008-05-30 16:05:54 +020021 int nb_zones;
22 struct kvm_coalesced_mmio_zone zone[KVM_COALESCED_MMIO_ZONE_MAX];
23};
24
25int kvm_coalesced_mmio_init(struct kvm *kvm);
Avi Kivity980da6c2009-12-20 15:13:43 +020026void kvm_coalesced_mmio_free(struct kvm *kvm);
Laurent Vivier5f94c172008-05-30 16:05:54 +020027int kvm_vm_ioctl_register_coalesced_mmio(struct kvm *kvm,
28 struct kvm_coalesced_mmio_zone *zone);
29int kvm_vm_ioctl_unregister_coalesced_mmio(struct kvm *kvm,
30 struct kvm_coalesced_mmio_zone *zone);
Avi Kivity3f0852e2009-12-20 14:42:19 +020031
Avi Kivity980da6c2009-12-20 15:13:43 +020032#else
33
34static inline int kvm_coalesced_mmio_init(struct kvm *kvm) { return 0; }
35static inline void kvm_coalesced_mmio_free(struct kvm *kvm) { }
36
37#endif
38
Avi Kivity3f0852e2009-12-20 14:42:19 +020039#endif