Skip to content

Commit

Permalink
KVM: Portability: Stop including x86-specific headers in kvm_main.c
Browse files Browse the repository at this point in the history
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Hollis Blanchard authored and Avi Kivity committed Jan 30, 2008
1 parent e217402 commit e01a1b5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
1 change: 1 addition & 0 deletions drivers/kvm/i8259.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/
#include <linux/mm.h>
#include "irq.h"
#include "kvm.h"

/*
* set irq level. If an edge is detected, then the IRR is set to 1
Expand Down
7 changes: 6 additions & 1 deletion drivers/kvm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@
#ifndef __IRQ_H
#define __IRQ_H

#include "kvm.h"
#include <linux/mm_types.h>
#include <linux/hrtimer.h>
#include <asm/kvm.h>
#include "iodev.h"

struct kvm;
struct kvm_vcpu;

typedef void irq_request_func(void *opaque, int level);

struct kvm_kpic_state {
Expand Down
9 changes: 4 additions & 5 deletions drivers/kvm/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 { \
Expand Down Expand Up @@ -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
3 changes: 0 additions & 3 deletions drivers/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/

#include "kvm.h"
#include "x86.h"
#include "irq.h"
#include "iodev.h"

#include <linux/kvm.h>
Expand Down Expand Up @@ -46,7 +44,6 @@
#include <asm/processor.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/desc.h>
#include <asm/pgtable.h>

MODULE_AUTHOR("Qumranet");
Expand Down
8 changes: 8 additions & 0 deletions drivers/kvm/x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
#define KVM_X86_H

#include "kvm.h"
#include "irq.h"

#include <linux/types.h>
#include <linux/mm.h>

#include <linux/kvm.h>
#include <linux/kvm_para.h>

#include <asm/desc.h>

#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)
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit e01a1b5

Please sign in to comment.