#include <linux/kvm_host.h>
#include <linux/debugfs.h>
#include "lapic.h"
#include "mmu.h"
#include "mmu/mmu_internal.h"
Go to the source code of this file.
|
static int | vcpu_get_timer_advance_ns (void *data, u64 *val) |
|
| DEFINE_SIMPLE_ATTRIBUTE (vcpu_timer_advance_ns_fops, vcpu_get_timer_advance_ns, NULL, "%llu\n") |
|
static int | vcpu_get_guest_mode (void *data, u64 *val) |
|
| DEFINE_SIMPLE_ATTRIBUTE (vcpu_guest_mode_fops, vcpu_get_guest_mode, NULL, "%lld\n") |
|
static int | vcpu_get_tsc_offset (void *data, u64 *val) |
|
| DEFINE_SIMPLE_ATTRIBUTE (vcpu_tsc_offset_fops, vcpu_get_tsc_offset, NULL, "%lld\n") |
|
static int | vcpu_get_tsc_scaling_ratio (void *data, u64 *val) |
|
| DEFINE_SIMPLE_ATTRIBUTE (vcpu_tsc_scaling_fops, vcpu_get_tsc_scaling_ratio, NULL, "%llu\n") |
|
static int | vcpu_get_tsc_scaling_frac_bits (void *data, u64 *val) |
|
| DEFINE_SIMPLE_ATTRIBUTE (vcpu_tsc_scaling_frac_fops, vcpu_get_tsc_scaling_frac_bits, NULL, "%llu\n") |
|
void | kvm_arch_create_vcpu_debugfs (struct kvm_vcpu *vcpu, struct dentry *debugfs_dentry) |
|
static int | kvm_mmu_rmaps_stat_show (struct seq_file *m, void *v) |
|
static int | kvm_mmu_rmaps_stat_open (struct inode *inode, struct file *file) |
|
static int | kvm_mmu_rmaps_stat_release (struct inode *inode, struct file *file) |
|
int | kvm_arch_create_vm_debugfs (struct kvm *kvm) |
|
◆ pr_fmt
#define pr_fmt |
( |
|
fmt | ) |
KBUILD_MODNAME ": " fmt |
◆ RMAP_LOG_SIZE
◆ DEFINE_SIMPLE_ATTRIBUTE() [1/5]
◆ DEFINE_SIMPLE_ATTRIBUTE() [2/5]
◆ DEFINE_SIMPLE_ATTRIBUTE() [3/5]
◆ DEFINE_SIMPLE_ATTRIBUTE() [4/5]
◆ DEFINE_SIMPLE_ATTRIBUTE() [5/5]
◆ kvm_arch_create_vcpu_debugfs()
void kvm_arch_create_vcpu_debugfs |
( |
struct kvm_vcpu * |
vcpu, |
|
|
struct dentry * |
debugfs_dentry |
|
) |
| |
Definition at line 59 of file debugfs.c.
61 debugfs_create_file(
"guest_mode", 0444, debugfs_dentry, vcpu,
62 &vcpu_guest_mode_fops);
63 debugfs_create_file(
"tsc-offset", 0444, debugfs_dentry, vcpu,
64 &vcpu_tsc_offset_fops);
67 debugfs_create_file(
"lapic_timer_advance_ns", 0444,
69 &vcpu_timer_advance_ns_fops);
72 debugfs_create_file(
"tsc-scaling-ratio", 0444,
74 &vcpu_tsc_scaling_fops);
75 debugfs_create_file(
"tsc-scaling-ratio-frac-bits", 0444,
77 &vcpu_tsc_scaling_frac_fops);
static bool lapic_in_kernel(struct kvm_vcpu *vcpu)
◆ kvm_arch_create_vm_debugfs()
int kvm_arch_create_vm_debugfs |
( |
struct kvm * |
kvm | ) |
|
Definition at line 192 of file debugfs.c.
194 debugfs_create_file(
"mmu_rmaps_stat", 0644, kvm->debugfs_dentry, kvm,
static const struct file_operations mmu_rmaps_stat_fops
◆ kvm_mmu_rmaps_stat_open()
static int kvm_mmu_rmaps_stat_open |
( |
struct inode * |
inode, |
|
|
struct file * |
file |
|
) |
| |
|
static |
Definition at line 160 of file debugfs.c.
162 struct kvm *kvm = inode->i_private;
static int kvm_mmu_rmaps_stat_show(struct seq_file *m, void *v)
void kvm_put_kvm(struct kvm *kvm)
bool kvm_get_kvm_safe(struct kvm *kvm)
◆ kvm_mmu_rmaps_stat_release()
static int kvm_mmu_rmaps_stat_release |
( |
struct inode * |
inode, |
|
|
struct file * |
file |
|
) |
| |
|
static |
Definition at line 175 of file debugfs.c.
177 struct kvm *kvm = inode->i_private;
181 return single_release(inode, file);
◆ kvm_mmu_rmaps_stat_show()
static int kvm_mmu_rmaps_stat_show |
( |
struct seq_file * |
m, |
|
|
void * |
v |
|
) |
| |
|
static |
Definition at line 89 of file debugfs.c.
91 struct kvm_rmap_head *rmap;
92 struct kvm *kvm = m->private;
93 struct kvm_memory_slot *slot;
94 struct kvm_memslots *slots;
95 unsigned int lpage_size, index;
97 unsigned int *log[KVM_NR_PAGE_SIZES], *cur;
104 memset(log, 0,
sizeof(log));
105 for (i = 0; i < KVM_NR_PAGE_SIZES; i++) {
106 log[i] = kcalloc(
RMAP_LOG_SIZE,
sizeof(
unsigned int), GFP_KERNEL);
111 mutex_lock(&kvm->slots_lock);
112 write_lock(&kvm->mmu_lock);
114 for (i = 0; i < kvm_arch_nr_memslot_as_ids(kvm); i++) {
117 slots = __kvm_memslots(kvm, i);
118 kvm_for_each_memslot(slot, bkt, slots)
119 for (k = 0; k < KVM_NR_PAGE_SIZES; k++) {
120 rmap = slot->arch.rmap[k];
123 for (l = 0; l < lpage_size; l++) {
132 write_unlock(&kvm->mmu_lock);
133 mutex_unlock(&kvm->slots_lock);
136 seq_printf(m,
"Rmap_Count:\t0\t1\t");
140 seq_printf(m,
"%d-%d\t", j, k);
144 for (i = 0; i < KVM_NR_PAGE_SIZES; i++) {
148 seq_printf(m,
"%d\t", cur[j]);
154 for (i = 0; i < KVM_NR_PAGE_SIZES; i++)
static const char * kvm_lpage_str[KVM_NR_PAGE_SIZES]
unsigned int pte_list_count(struct kvm_rmap_head *rmap_head)
static unsigned long kvm_mmu_slot_lpages(struct kvm_memory_slot *slot, int level)
static bool kvm_memslots_have_rmaps(struct kvm *kvm)
◆ vcpu_get_guest_mode()
static int vcpu_get_guest_mode |
( |
void * |
data, |
|
|
u64 * |
val |
|
) |
| |
|
static |
Definition at line 24 of file debugfs.c.
26 struct kvm_vcpu *vcpu = (
struct kvm_vcpu *) data;
27 *val = vcpu->stat.guest_mode;
◆ vcpu_get_timer_advance_ns()
static int vcpu_get_timer_advance_ns |
( |
void * |
data, |
|
|
u64 * |
val |
|
) |
| |
|
static |
Definition at line 15 of file debugfs.c.
17 struct kvm_vcpu *vcpu = (
struct kvm_vcpu *) data;
18 *val = vcpu->arch.apic->lapic_timer.timer_advance_ns;
◆ vcpu_get_tsc_offset()
static int vcpu_get_tsc_offset |
( |
void * |
data, |
|
|
u64 * |
val |
|
) |
| |
|
static |
Definition at line 33 of file debugfs.c.
35 struct kvm_vcpu *vcpu = (
struct kvm_vcpu *) data;
36 *val = vcpu->arch.tsc_offset;
◆ vcpu_get_tsc_scaling_frac_bits()
static int vcpu_get_tsc_scaling_frac_bits |
( |
void * |
data, |
|
|
u64 * |
val |
|
) |
| |
|
static |
Definition at line 51 of file debugfs.c.
u8 tsc_scaling_ratio_frac_bits
◆ vcpu_get_tsc_scaling_ratio()
static int vcpu_get_tsc_scaling_ratio |
( |
void * |
data, |
|
|
u64 * |
val |
|
) |
| |
|
static |
Definition at line 42 of file debugfs.c.
44 struct kvm_vcpu *vcpu = (
struct kvm_vcpu *) data;
45 *val = vcpu->arch.tsc_scaling_ratio;
◆ kvm_lpage_str
const char* kvm_lpage_str[KVM_NR_PAGE_SIZES] = { "4K", "2M", "1G" } |
|
static |
◆ mmu_rmaps_stat_fops
const struct file_operations mmu_rmaps_stat_fops |
|
static |
Initial value:= {
.owner = THIS_MODULE,
.read = seq_read,
.llseek = seq_lseek,
}
static int kvm_mmu_rmaps_stat_open(struct inode *inode, struct file *file)
static int kvm_mmu_rmaps_stat_release(struct inode *inode, struct file *file)
Definition at line 175 of file debugfs.c.