aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm
diff options
context:
space:
mode:
authorHollis Blanchard <hollisb@us.ibm.com>2007-10-31 18:24:23 -0400
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:52:59 -0500
commit417bc3041f5e66df1ce7f03d8fc481c3b12f250a (patch)
tree6c09ddc5adadd3696aa78e6e3fc219a2e8e63bae /drivers/kvm
parent1c73ef66502311d9aff7fed7d7f970288329c6cb (diff)
KVM: Portability: Make exported debugfs data architecture-specific
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/kvm.h7
-rw-r--r--drivers/kvm/kvm_main.c25
-rw-r--r--drivers/kvm/x86.c22
3 files changed, 29 insertions, 25 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 22317d6f66ae..d030a82966f5 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -761,4 +761,11 @@ static inline u32 get_rdx_init_val(void)
761#define TSS_REDIRECTION_SIZE (256 / 8) 761#define TSS_REDIRECTION_SIZE (256 / 8)
762#define RMODE_TSS_SIZE (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1) 762#define RMODE_TSS_SIZE (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1)
763 763
764struct kvm_stats_debugfs_item {
765 const char *name;
766 int offset;
767 struct dentry *dentry;
768};
769extern struct kvm_stats_debugfs_item debugfs_entries[];
770
764#endif 771#endif
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index cac66d505f57..58a5f399ad85 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -63,31 +63,6 @@ EXPORT_SYMBOL_GPL(kvm_vcpu_cache);
63 63
64static __read_mostly struct preempt_ops kvm_preempt_ops; 64static __read_mostly struct preempt_ops kvm_preempt_ops;
65 65
66#define STAT_OFFSET(x) offsetof(struct kvm_vcpu, stat.x)
67
68static struct kvm_stats_debugfs_item {
69 const char *name;
70 int offset;
71 struct dentry *dentry;
72} debugfs_entries[] = {
73 { "pf_fixed", STAT_OFFSET(pf_fixed) },
74 { "pf_guest", STAT_OFFSET(pf_guest) },
75 { "tlb_flush", STAT_OFFSET(tlb_flush) },
76 { "invlpg", STAT_OFFSET(invlpg) },
77 { "exits", STAT_OFFSET(exits) },
78 { "io_exits", STAT_OFFSET(io_exits) },
79 { "mmio_exits", STAT_OFFSET(mmio_exits) },
80 { "signal_exits", STAT_OFFSET(signal_exits) },
81 { "irq_window", STAT_OFFSET(irq_window_exits) },
82 { "halt_exits", STAT_OFFSET(halt_exits) },
83 { "halt_wakeup", STAT_OFFSET(halt_wakeup) },
84 { "request_irq", STAT_OFFSET(request_irq_exits) },
85 { "irq_exits", STAT_OFFSET(irq_exits) },
86 { "light_exits", STAT_OFFSET(light_exits) },
87 { "efer_reload", STAT_OFFSET(efer_reload) },
88 { NULL }
89};
90
91static struct dentry *debugfs_dir; 66static struct dentry *debugfs_dir;
92 67
93static long kvm_vcpu_ioctl(struct file *file, unsigned int ioctl, 68static long kvm_vcpu_ioctl(struct file *file, unsigned int ioctl,
diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index f75e7d7d9ead..c1f10e58f4d2 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -40,6 +40,28 @@
40#define CR8_RESERVED_BITS (~(unsigned long)X86_CR8_TPR) 40#define CR8_RESERVED_BITS (~(unsigned long)X86_CR8_TPR)
41#define EFER_RESERVED_BITS 0xfffffffffffff2fe 41#define EFER_RESERVED_BITS 0xfffffffffffff2fe
42 42
43#define STAT_OFFSET(x) offsetof(struct kvm_vcpu, stat.x)
44
45struct kvm_stats_debugfs_item debugfs_entries[] = {
46 { "pf_fixed", STAT_OFFSET(pf_fixed) },
47 { "pf_guest", STAT_OFFSET(pf_guest) },
48 { "tlb_flush", STAT_OFFSET(tlb_flush) },
49 { "invlpg", STAT_OFFSET(invlpg) },
50 { "exits", STAT_OFFSET(exits) },
51 { "io_exits", STAT_OFFSET(io_exits) },
52 { "mmio_exits", STAT_OFFSET(mmio_exits) },
53 { "signal_exits", STAT_OFFSET(signal_exits) },
54 { "irq_window", STAT_OFFSET(irq_window_exits) },
55 { "halt_exits", STAT_OFFSET(halt_exits) },
56 { "halt_wakeup", STAT_OFFSET(halt_wakeup) },
57 { "request_irq", STAT_OFFSET(request_irq_exits) },
58 { "irq_exits", STAT_OFFSET(irq_exits) },
59 { "light_exits", STAT_OFFSET(light_exits) },
60 { "efer_reload", STAT_OFFSET(efer_reload) },
61 { NULL }
62};
63
64
43unsigned long segment_base(u16 selector) 65unsigned long segment_base(u16 selector)
44{ 66{
45 struct descriptor_table gdt; 67 struct descriptor_table gdt;