diff options
Diffstat (limited to 'arch/x86/kvm/debugfs.c')
-rw-r--r-- | arch/x86/kvm/debugfs.c | 46 |
1 files changed, 13 insertions, 33 deletions
diff --git a/arch/x86/kvm/debugfs.c b/arch/x86/kvm/debugfs.c index 329361b69d5e..018aebce33ff 100644 --- a/arch/x86/kvm/debugfs.c +++ b/arch/x86/kvm/debugfs.c | |||
@@ -8,11 +8,6 @@ | |||
8 | #include <linux/debugfs.h> | 8 | #include <linux/debugfs.h> |
9 | #include "lapic.h" | 9 | #include "lapic.h" |
10 | 10 | ||
11 | bool kvm_arch_has_vcpu_debugfs(void) | ||
12 | { | ||
13 | return true; | ||
14 | } | ||
15 | |||
16 | static int vcpu_get_timer_advance_ns(void *data, u64 *val) | 11 | static int vcpu_get_timer_advance_ns(void *data, u64 *val) |
17 | { | 12 | { |
18 | struct kvm_vcpu *vcpu = (struct kvm_vcpu *) data; | 13 | struct kvm_vcpu *vcpu = (struct kvm_vcpu *) data; |
@@ -48,37 +43,22 @@ static int vcpu_get_tsc_scaling_frac_bits(void *data, u64 *val) | |||
48 | 43 | ||
49 | DEFINE_SIMPLE_ATTRIBUTE(vcpu_tsc_scaling_frac_fops, vcpu_get_tsc_scaling_frac_bits, NULL, "%llu\n"); | 44 | DEFINE_SIMPLE_ATTRIBUTE(vcpu_tsc_scaling_frac_fops, vcpu_get_tsc_scaling_frac_bits, NULL, "%llu\n"); |
50 | 45 | ||
51 | int kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu) | 46 | void kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu) |
52 | { | 47 | { |
53 | struct dentry *ret; | 48 | debugfs_create_file("tsc-offset", 0444, vcpu->debugfs_dentry, vcpu, |
54 | 49 | &vcpu_tsc_offset_fops); | |
55 | ret = debugfs_create_file("tsc-offset", 0444, | ||
56 | vcpu->debugfs_dentry, | ||
57 | vcpu, &vcpu_tsc_offset_fops); | ||
58 | if (!ret) | ||
59 | return -ENOMEM; | ||
60 | 50 | ||
61 | if (lapic_in_kernel(vcpu)) { | 51 | if (lapic_in_kernel(vcpu)) |
62 | ret = debugfs_create_file("lapic_timer_advance_ns", 0444, | 52 | debugfs_create_file("lapic_timer_advance_ns", 0444, |
63 | vcpu->debugfs_dentry, | 53 | vcpu->debugfs_dentry, vcpu, |
64 | vcpu, &vcpu_timer_advance_ns_fops); | 54 | &vcpu_timer_advance_ns_fops); |
65 | if (!ret) | ||
66 | return -ENOMEM; | ||
67 | } | ||
68 | 55 | ||
69 | if (kvm_has_tsc_control) { | 56 | if (kvm_has_tsc_control) { |
70 | ret = debugfs_create_file("tsc-scaling-ratio", 0444, | 57 | debugfs_create_file("tsc-scaling-ratio", 0444, |
71 | vcpu->debugfs_dentry, | 58 | vcpu->debugfs_dentry, vcpu, |
72 | vcpu, &vcpu_tsc_scaling_fops); | 59 | &vcpu_tsc_scaling_fops); |
73 | if (!ret) | 60 | debugfs_create_file("tsc-scaling-ratio-frac-bits", 0444, |
74 | return -ENOMEM; | 61 | vcpu->debugfs_dentry, vcpu, |
75 | ret = debugfs_create_file("tsc-scaling-ratio-frac-bits", 0444, | 62 | &vcpu_tsc_scaling_frac_fops); |
76 | vcpu->debugfs_dentry, | ||
77 | vcpu, &vcpu_tsc_scaling_frac_fops); | ||
78 | if (!ret) | ||
79 | return -ENOMEM; | ||
80 | |||
81 | } | 63 | } |
82 | |||
83 | return 0; | ||
84 | } | 64 | } |