Commit edf88417 authored by Avi Kivity's avatar Avi Kivity

KVM: Move arch dependent files to new directory arch/x86/kvm/

This paves the way for multiple architecture support.  Note that while
ioapic.c could potentially be shared with ia64, it is also moved.
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent 9584bf2c
...@@ -1599,4 +1599,6 @@ source "security/Kconfig" ...@@ -1599,4 +1599,6 @@ source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "arch/x86/kvm/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
...@@ -7,6 +7,8 @@ else ...@@ -7,6 +7,8 @@ else
KBUILD_DEFCONFIG := $(ARCH)_defconfig KBUILD_DEFCONFIG := $(ARCH)_defconfig
endif endif
core-$(CONFIG_KVM) += arch/x86/kvm/
# BITS is used as extension for files which are available in a 32 bit # BITS is used as extension for files which are available in a 32 bit
# and a 64 bit version to simplify shared Makefiles. # and a 64 bit version to simplify shared Makefiles.
# e.g.: obj-y += foo_$(BITS).o # e.g.: obj-y += foo_$(BITS).o
......
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
# Makefile for Kernel-based Virtual Machine module # Makefile for Kernel-based Virtual Machine module
# #
kvm-objs := kvm_main.o x86.o mmu.o x86_emulate.o i8259.o irq.o lapic.o ioapic.o common-objs = $(addprefix ../../../drivers/kvm/, kvm_main.o)
EXTRA_CFLAGS += -I drivers/kvm
kvm-objs := $(common-objs) x86.o mmu.o x86_emulate.o i8259.o irq.o lapic.o \
ioapic.o
obj-$(CONFIG_KVM) += kvm.o obj-$(CONFIG_KVM) += kvm.o
kvm-intel-objs = vmx.o kvm-intel-objs = vmx.o
obj-$(CONFIG_KVM_INTEL) += kvm-intel.o obj-$(CONFIG_KVM_INTEL) += kvm-intel.o
......
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
*/ */
#include <linux/mm.h> #include <linux/mm.h>
#include "irq.h" #include "irq.h"
#include "kvm.h"
#include <linux/kvm_host.h>
/* /*
* set irq level. If an edge is detected, then the IRR is set to 1 * set irq level. If an edge is detected, then the IRR is set to 1
......
...@@ -26,9 +26,7 @@ ...@@ -26,9 +26,7 @@
* Based on Xen 3.1 code. * Based on Xen 3.1 code.
*/ */
#include "kvm.h" #include <linux/kvm_host.h>
#include "x86.h"
#include <linux/kvm.h> #include <linux/kvm.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/highmem.h> #include <linux/highmem.h>
......
...@@ -20,9 +20,8 @@ ...@@ -20,9 +20,8 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/kvm_host.h>
#include "kvm.h"
#include "x86.h"
#include "irq.h" #include "irq.h"
/* /*
......
...@@ -24,9 +24,8 @@ ...@@ -24,9 +24,8 @@
#include <linux/mm_types.h> #include <linux/mm_types.h>
#include <linux/hrtimer.h> #include <linux/hrtimer.h>
#include <asm/kvm.h> #include <linux/kvm_host.h>
#include "iodev.h" #include "iodev.h"
#include "kvm.h"
struct kvm; struct kvm;
struct kvm_vcpu; struct kvm_vcpu;
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/kvm_host.h>
#include <asm/msr.h> #include <asm/msr.h>
#include "svm.h" #include "svm.h"
#include "kvm.h"
static const u32 host_save_user_msrs[] = { static const u32 host_save_user_msrs[] = {
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
......
...@@ -17,9 +17,7 @@ ...@@ -17,9 +17,7 @@
* the COPYING file in the top-level directory. * the COPYING file in the top-level directory.
*/ */
#include "kvm.h" #include <linux/kvm_host.h>
#include "x86.h"
#include <linux/kvm.h> #include <linux/kvm.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/highmem.h> #include <linux/highmem.h>
......
...@@ -18,10 +18,9 @@ ...@@ -18,10 +18,9 @@
*/ */
#include "vmx.h" #include "vmx.h"
#include "kvm.h"
#include "x86.h"
#include "mmu.h" #include "mmu.h"
#include <linux/kvm_host.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/mm.h> #include <linux/mm.h>
......
#ifndef __KVM_X86_MMU_H #ifndef __KVM_X86_MMU_H
#define __KVM_X86_MMU_H #define __KVM_X86_MMU_H
#include "kvm.h" #include <linux/kvm_host.h>
static inline void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu) static inline void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu)
{ {
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
* the COPYING file in the top-level directory. * the COPYING file in the top-level directory.
* *
*/ */
#include "x86.h" #include <linux/kvm_host.h>
#include "kvm_svm.h" #include "kvm_svm.h"
#include "x86_emulate.h"
#include "irq.h" #include "irq.h"
#include "mmu.h" #include "mmu.h"
......
...@@ -15,14 +15,12 @@ ...@@ -15,14 +15,12 @@
* *
*/ */
#include "kvm.h"
#include "x86.h"
#include "x86_emulate.h"
#include "irq.h" #include "irq.h"
#include "vmx.h" #include "vmx.h"
#include "segment_descriptor.h" #include "segment_descriptor.h"
#include "mmu.h" #include "mmu.h"
#include <linux/kvm_host.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
......
...@@ -14,9 +14,7 @@ ...@@ -14,9 +14,7 @@
* *
*/ */
#include "kvm.h" #include <linux/kvm_host.h>
#include "x86.h"
#include "x86_emulate.h"
#include "segment_descriptor.h" #include "segment_descriptor.h"
#include "irq.h" #include "irq.h"
#include "mmu.h" #include "mmu.h"
......
...@@ -25,12 +25,11 @@ ...@@ -25,12 +25,11 @@
#include <public/xen.h> #include <public/xen.h>
#define DPRINTF(_f, _a ...) printf(_f , ## _a) #define DPRINTF(_f, _a ...) printf(_f , ## _a)
#else #else
#include "kvm.h" #include <linux/kvm_host.h>
#include "x86.h"
#define DPRINTF(x...) do {} while (0) #define DPRINTF(x...) do {} while (0)
#endif #endif
#include "x86_emulate.h"
#include <linux/module.h> #include <linux/module.h>
#include <asm/kvm_x86_emulate.h>
/* /*
* Opcode effective-address decode tables. * Opcode effective-address decode tables.
......
...@@ -90,8 +90,6 @@ source "drivers/dca/Kconfig" ...@@ -90,8 +90,6 @@ source "drivers/dca/Kconfig"
source "drivers/auxdisplay/Kconfig" source "drivers/auxdisplay/Kconfig"
source "drivers/kvm/Kconfig"
source "drivers/uio/Kconfig" source "drivers/uio/Kconfig"
source "drivers/virtio/Kconfig" source "drivers/virtio/Kconfig"
......
...@@ -47,7 +47,6 @@ obj-$(CONFIG_SPI) += spi/ ...@@ -47,7 +47,6 @@ obj-$(CONFIG_SPI) += spi/
obj-$(CONFIG_PCCARD) += pcmcia/ obj-$(CONFIG_PCCARD) += pcmcia/
obj-$(CONFIG_DIO) += dio/ obj-$(CONFIG_DIO) += dio/
obj-$(CONFIG_SBUS) += sbus/ obj-$(CONFIG_SBUS) += sbus/
obj-$(CONFIG_KVM) += kvm/
obj-$(CONFIG_ZORRO) += zorro/ obj-$(CONFIG_ZORRO) += zorro/
obj-$(CONFIG_MAC) += macintosh/ obj-$(CONFIG_MAC) += macintosh/
obj-$(CONFIG_ATA_OVER_ETH) += block/aoe/ obj-$(CONFIG_ATA_OVER_ETH) += block/aoe/
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#ifndef __KVM_IODEV_H__ #ifndef __KVM_IODEV_H__
#define __KVM_IODEV_H__ #define __KVM_IODEV_H__
#include "types.h" #include <linux/kvm_types.h>
struct kvm_io_device { struct kvm_io_device {
void (*read)(struct kvm_io_device *this, void (*read)(struct kvm_io_device *this,
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
* *
*/ */
#include "kvm.h"
#include "iodev.h" #include "iodev.h"
#include <linux/kvm_host.h>
#include <linux/kvm.h> #include <linux/kvm.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/errno.h> #include <linux/errno.h>
......
...@@ -8,19 +8,18 @@ ...@@ -8,19 +8,18 @@
* *
*/ */
#ifndef KVM_X86_H #ifndef ASM_KVM_HOST_H
#define KVM_X86_H #define ASM_KVM_HOST_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/kvm.h> #include <linux/kvm.h>
#include <linux/kvm_para.h> #include <linux/kvm_para.h>
#include <linux/kvm_types.h>
#include <asm/desc.h> #include <asm/desc.h>
#include "types.h"
#define CR3_PAE_RESERVED_BITS ((X86_CR3_PWT | X86_CR3_PCD) - 1) #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)) #define CR3_NONPAE_RESERVED_BITS ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD))
#define CR3_L_MODE_RESERVED_BITS (CR3_NONPAE_RESERVED_BITS|0xFFFFFF0000000000ULL) #define CR3_L_MODE_RESERVED_BITS (CR3_NONPAE_RESERVED_BITS|0xFFFFFF0000000000ULL)
...@@ -102,7 +101,7 @@ enum { ...@@ -102,7 +101,7 @@ enum {
VCPU_SREG_LDTR, VCPU_SREG_LDTR,
}; };
#include "x86_emulate.h" #include <asm/kvm_x86_emulate.h>
#define KVM_NR_MEM_OBJS 40 #define KVM_NR_MEM_OBJS 40
......
#ifndef __KVM_H #ifndef __KVM_HOST_H
#define __KVM_H #define __KVM_HOST_H
/* /*
* This work is licensed under the terms of the GNU GPL, version 2. See * This work is licensed under the terms of the GNU GPL, version 2. See
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
#include <linux/kvm.h> #include <linux/kvm.h>
#include <linux/kvm_para.h> #include <linux/kvm_para.h>
#include "types.h" #include <linux/kvm_types.h>
#include "x86.h" #include <asm/kvm_host.h>
#define KVM_MAX_VCPUS 4 #define KVM_MAX_VCPUS 4
#define KVM_MEMORY_SLOTS 8 #define KVM_MEMORY_SLOTS 8
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment