From e01a1b570f66ad318239517adbcc2cbe368d0a46 Mon Sep 17 00:00:00 2001 From: Hollis Blanchard Date: Mon, 3 Dec 2007 15:30:25 -0600 Subject: [PATCH] KVM: Portability: Stop including x86-specific headers in kvm_main.c Signed-off-by: Hollis Blanchard Signed-off-by: Avi Kivity --- drivers/kvm/i8259.c | 1 + drivers/kvm/irq.h | 7 ++++++- drivers/kvm/kvm.h | 9 ++++----- drivers/kvm/kvm_main.c | 3 --- drivers/kvm/x86.h | 8 ++++++++ 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/drivers/kvm/i8259.c b/drivers/kvm/i8259.c index f0dc2eeadf0..b3cad632f3d 100644 --- a/drivers/kvm/i8259.c +++ b/drivers/kvm/i8259.c @@ -27,6 +27,7 @@ */ #include #include "irq.h" +#include "kvm.h" /* * set irq level. If an edge is detected, then the IRR is set to 1 diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h index 803b9c7db57..730a87c173e 100644 --- a/drivers/kvm/irq.h +++ b/drivers/kvm/irq.h @@ -22,9 +22,14 @@ #ifndef __IRQ_H #define __IRQ_H -#include "kvm.h" +#include +#include +#include #include "iodev.h" +struct kvm; +struct kvm_vcpu; + typedef void irq_request_func(void *opaque, int level); struct kvm_kpic_state { diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index a1b7d1c00bd..0d3555bf533 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -288,11 +288,6 @@ static inline int irqchip_in_kernel(struct kvm *kvm) return pic_irqchip(kvm) != NULL; } -struct descriptor_table { - u16 limit; - unsigned long base; -} __attribute__((packed)); - /* The guest did something we don't support. */ #define pr_unimpl(vcpu, fmt, ...) \ do { \ @@ -457,4 +452,8 @@ struct kvm_stats_debugfs_item { }; extern struct kvm_stats_debugfs_item debugfs_entries[]; +#if defined(CONFIG_X86) +#include "x86.h" +#endif + #endif diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 14b376ead3d..0f11046b94f 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -16,8 +16,6 @@ */ #include "kvm.h" -#include "x86.h" -#include "irq.h" #include "iodev.h" #include @@ -46,7 +44,6 @@ #include #include #include -#include #include MODULE_AUTHOR("Qumranet"); diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h index 78ab1e108d8..4b7acc76bb3 100644 --- a/drivers/kvm/x86.h +++ b/drivers/kvm/x86.h @@ -12,6 +12,7 @@ #define KVM_X86_H #include "kvm.h" +#include "irq.h" #include #include @@ -19,6 +20,8 @@ #include #include +#include + #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_L_MODE_RESERVED_BITS (CR3_NONPAE_RESERVED_BITS|0xFFFFFF0000000000ULL) @@ -156,6 +159,11 @@ struct kvm_vcpu { struct x86_emulate_ctxt emulate_ctxt; }; +struct descriptor_table { + u16 limit; + unsigned long base; +} __attribute__((packed)); + struct kvm_x86_ops { int (*cpu_has_kvm_support)(void); /* __init */ int (*disabled_by_bios)(void); /* __init */ -- 2.41.0