]> err.no Git - linux-2.6/commitdiff
KVM: Add coalesced MMIO support (x86 part)
authorLaurent Vivier <Laurent.Vivier@bull.net>
Fri, 30 May 2008 14:05:55 +0000 (16:05 +0200)
committerAvi Kivity <avi@qumranet.com>
Sun, 20 Jul 2008 09:42:31 +0000 (12:42 +0300)
This patch enables coalesced MMIO for x86 architecture.
It defines KVM_MMIO_PAGE_OFFSET and KVM_CAP_COALESCED_MMIO.
It enables the compilation of coalesced_mmio.c.

Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/Makefile
arch/x86/kvm/x86.c
include/asm-x86/kvm_host.h

index c97d35c218dbe0ad4827776ff30c20e13d107852..d0e940bb6f401839681f79fee8367b1a27678b1a 100644 (file)
@@ -2,7 +2,8 @@
 # Makefile for Kernel-based Virtual Machine module
 #
 
-common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o)
+common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \
+                coalesced_mmio.o)
 ifeq ($(CONFIG_KVM_TRACE),y)
 common-objs += $(addprefix ../../../virt/kvm/, kvm_trace.o)
 endif
index ab3f5552d694500009dcfd8e6162c61c2e321ad3..d731d4fff1ae0f19f2ef59f86ceb7b6b45a78002 100644 (file)
@@ -885,6 +885,9 @@ int kvm_dev_ioctl_check_extension(long ext)
        case KVM_CAP_MP_STATE:
                r = 1;
                break;
+       case KVM_CAP_COALESCED_MMIO:
+               r = KVM_COALESCED_MMIO_PAGE_OFFSET;
+               break;
        case KVM_CAP_VAPIC:
                r = !kvm_x86_ops->cpu_has_accelerated_tpr();
                break;
index cd6a4bb8c8e8284588cbe7746babfc59a53d6cb5..c64d1242762b1939a07326d0fc5aa862033a1a2e 100644 (file)
@@ -27,6 +27,7 @@
 #define KVM_PRIVATE_MEM_SLOTS 4
 
 #define KVM_PIO_PAGE_OFFSET 1
+#define KVM_COALESCED_MMIO_PAGE_OFFSET 2
 
 #define CR3_PAE_RESERVED_BITS ((X86_CR3_PWT | X86_CR3_PCD) - 1)
 #define CR3_NONPAE_RESERVED_BITS ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD))