blob: 36f84264ed257efa422fc6618dc93cdbf0d1ddb6 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Avi Kivity3f0852e2009-12-20 14:42:19 +02002#ifndef __KVM_COALESCED_MMIO_H__
3#define __KVM_COALESCED_MMIO_H__
4
Laurent Vivier5f94c172008-05-30 16:05:54 +02005/*
6 * KVM coalesced MMIO
7 *
8 * Copyright (c) 2008 Bull S.A.S.
9 *
10 * Author: Laurent Vivier <Laurent.Vivier@bull.net>
11 *
12 */
13
Avi Kivity980da6c2009-12-20 15:13:43 +020014#ifdef CONFIG_KVM_MMIO
15
Sasha Levin2b3c246a2011-07-20 20:59:00 +030016#include <linux/list.h>
Laurent Vivier5f94c172008-05-30 16:05:54 +020017
18struct kvm_coalesced_mmio_dev {
Sasha Levin2b3c246a2011-07-20 20:59:00 +030019 struct list_head list;
Laurent Vivier5f94c172008-05-30 16:05:54 +020020 struct kvm_io_device dev;
21 struct kvm *kvm;
Sasha Levin2b3c246a2011-07-20 20:59:00 +030022 struct kvm_coalesced_mmio_zone zone;
Laurent Vivier5f94c172008-05-30 16:05:54 +020023};
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,
Wei Yang81523aa2015-09-11 14:12:53 +080028 struct kvm_coalesced_mmio_zone *zone);
Laurent Vivier5f94c172008-05-30 16:05:54 +020029int kvm_vm_ioctl_unregister_coalesced_mmio(struct kvm *kvm,
Wei Yang81523aa2015-09-11 14:12:53 +080030 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