diff options
author | Hollis Blanchard <hollisb@us.ibm.com> | 2007-12-03 16:30:25 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:53:17 -0500 |
commit | e01a1b570f66ad318239517adbcc2cbe368d0a46 (patch) | |
tree | 2400a276ef5db5087319a9ab92b3917243071db0 /drivers/kvm | |
parent | e2174021cfa535dbcaef02dc6f2897019c30731d (diff) |
KVM: Portability: Stop including x86-specific headers in kvm_main.c
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm')
-rw-r--r-- | drivers/kvm/i8259.c | 1 | ||||
-rw-r--r-- | drivers/kvm/irq.h | 7 | ||||
-rw-r--r-- | drivers/kvm/kvm.h | 9 | ||||
-rw-r--r-- | drivers/kvm/kvm_main.c | 3 | ||||
-rw-r--r-- | 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 f0dc2eeadf0b..b3cad632f3d5 100644 --- a/drivers/kvm/i8259.c +++ b/drivers/kvm/i8259.c | |||
@@ -27,6 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
29 | #include "irq.h" | 29 | #include "irq.h" |
30 | #include "kvm.h" | ||
30 | 31 | ||
31 | /* | 32 | /* |
32 | * set irq level. If an edge is detected, then the IRR is set to 1 | 33 | * 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 803b9c7db57b..730a87c173e5 100644 --- a/drivers/kvm/irq.h +++ b/drivers/kvm/irq.h | |||
@@ -22,9 +22,14 @@ | |||
22 | #ifndef __IRQ_H | 22 | #ifndef __IRQ_H |
23 | #define __IRQ_H | 23 | #define __IRQ_H |
24 | 24 | ||
25 | #include "kvm.h" | 25 | #include <linux/mm_types.h> |
26 | #include <linux/hrtimer.h> | ||
27 | #include <asm/kvm.h> | ||
26 | #include "iodev.h" | 28 | #include "iodev.h" |
27 | 29 | ||
30 | struct kvm; | ||
31 | struct kvm_vcpu; | ||
32 | |||
28 | typedef void irq_request_func(void *opaque, int level); | 33 | typedef void irq_request_func(void *opaque, int level); |
29 | 34 | ||
30 | struct kvm_kpic_state { | 35 | struct kvm_kpic_state { |
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index a1b7d1c00bde..0d3555bf5333 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -288,11 +288,6 @@ static inline int irqchip_in_kernel(struct kvm *kvm) | |||
288 | return pic_irqchip(kvm) != NULL; | 288 | return pic_irqchip(kvm) != NULL; |
289 | } | 289 | } |
290 | 290 | ||
291 | struct descriptor_table { | ||
292 | u16 limit; | ||
293 | unsigned long base; | ||
294 | } __attribute__((packed)); | ||
295 | |||
296 | /* The guest did something we don't support. */ | 291 | /* The guest did something we don't support. */ |
297 | #define pr_unimpl(vcpu, fmt, ...) \ | 292 | #define pr_unimpl(vcpu, fmt, ...) \ |
298 | do { \ | 293 | do { \ |
@@ -457,4 +452,8 @@ struct kvm_stats_debugfs_item { | |||
457 | }; | 452 | }; |
458 | extern struct kvm_stats_debugfs_item debugfs_entries[]; | 453 | extern struct kvm_stats_debugfs_item debugfs_entries[]; |
459 | 454 | ||
455 | #if defined(CONFIG_X86) | ||
456 | #include "x86.h" | ||
457 | #endif | ||
458 | |||
460 | #endif | 459 | #endif |
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 14b376ead3da..0f11046b94fa 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -16,8 +16,6 @@ | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include "kvm.h" | 18 | #include "kvm.h" |
19 | #include "x86.h" | ||
20 | #include "irq.h" | ||
21 | #include "iodev.h" | 19 | #include "iodev.h" |
22 | 20 | ||
23 | #include <linux/kvm.h> | 21 | #include <linux/kvm.h> |
@@ -46,7 +44,6 @@ | |||
46 | #include <asm/processor.h> | 44 | #include <asm/processor.h> |
47 | #include <asm/io.h> | 45 | #include <asm/io.h> |
48 | #include <asm/uaccess.h> | 46 | #include <asm/uaccess.h> |
49 | #include <asm/desc.h> | ||
50 | #include <asm/pgtable.h> | 47 | #include <asm/pgtable.h> |
51 | 48 | ||
52 | MODULE_AUTHOR("Qumranet"); | 49 | MODULE_AUTHOR("Qumranet"); |
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h index 78ab1e108d8b..4b7acc76bb34 100644 --- a/drivers/kvm/x86.h +++ b/drivers/kvm/x86.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #define KVM_X86_H | 12 | #define KVM_X86_H |
13 | 13 | ||
14 | #include "kvm.h" | 14 | #include "kvm.h" |
15 | #include "irq.h" | ||
15 | 16 | ||
16 | #include <linux/types.h> | 17 | #include <linux/types.h> |
17 | #include <linux/mm.h> | 18 | #include <linux/mm.h> |
@@ -19,6 +20,8 @@ | |||
19 | #include <linux/kvm.h> | 20 | #include <linux/kvm.h> |
20 | #include <linux/kvm_para.h> | 21 | #include <linux/kvm_para.h> |
21 | 22 | ||
23 | #include <asm/desc.h> | ||
24 | |||
22 | #define CR3_PAE_RESERVED_BITS ((X86_CR3_PWT | X86_CR3_PCD) - 1) | 25 | #define CR3_PAE_RESERVED_BITS ((X86_CR3_PWT | X86_CR3_PCD) - 1) |
23 | #define CR3_NONPAE_RESERVED_BITS ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD)) | 26 | #define CR3_NONPAE_RESERVED_BITS ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD)) |
24 | #define CR3_L_MODE_RESERVED_BITS (CR3_NONPAE_RESERVED_BITS|0xFFFFFF0000000000ULL) | 27 | #define CR3_L_MODE_RESERVED_BITS (CR3_NONPAE_RESERVED_BITS|0xFFFFFF0000000000ULL) |
@@ -156,6 +159,11 @@ struct kvm_vcpu { | |||
156 | struct x86_emulate_ctxt emulate_ctxt; | 159 | struct x86_emulate_ctxt emulate_ctxt; |
157 | }; | 160 | }; |
158 | 161 | ||
162 | struct descriptor_table { | ||
163 | u16 limit; | ||
164 | unsigned long base; | ||
165 | } __attribute__((packed)); | ||
166 | |||
159 | struct kvm_x86_ops { | 167 | struct kvm_x86_ops { |
160 | int (*cpu_has_kvm_support)(void); /* __init */ | 168 | int (*cpu_has_kvm_support)(void); /* __init */ |
161 | int (*disabled_by_bios)(void); /* __init */ | 169 | int (*disabled_by_bios)(void); /* __init */ |