mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
Merge tag 'kvm-x86-generic-7.0-rc3' of https://github.com/kvm-x86/linux into HEAD
KVM generic changes for 7.0 - Remove a subtle pseudo-overlay of kvm_stats_desc, which, aside from being unnecessary and confusing, triggered compiler warnings due to -Wflex-array-member-not-at-end. - Document that vcpu->mutex is take outside of kvm->slots_lock and kvm->slots_arch_lock, which is intentional and desirable despite being rather unintuitive.
This commit is contained in:
@@ -17,6 +17,8 @@ The acquisition orders for mutexes are as follows:
|
|||||||
|
|
||||||
- kvm->lock is taken outside kvm->slots_lock and kvm->irq_lock
|
- kvm->lock is taken outside kvm->slots_lock and kvm->irq_lock
|
||||||
|
|
||||||
|
- vcpu->mutex is taken outside kvm->slots_lock and kvm->slots_arch_lock
|
||||||
|
|
||||||
- kvm->slots_lock is taken outside kvm->irq_lock, though acquiring
|
- kvm->slots_lock is taken outside kvm->irq_lock, though acquiring
|
||||||
them together is quite rare.
|
them together is quite rare.
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vm_stats_desc[] = {
|
||||||
KVM_GENERIC_VM_STATS()
|
KVM_GENERIC_VM_STATS()
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ const struct kvm_stats_header kvm_vm_stats_header = {
|
|||||||
sizeof(kvm_vm_stats_desc),
|
sizeof(kvm_vm_stats_desc),
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
||||||
KVM_GENERIC_VCPU_STATS(),
|
KVM_GENERIC_VCPU_STATS(),
|
||||||
STATS_DESC_COUNTER(VCPU, hvc_exit_stat),
|
STATS_DESC_COUNTER(VCPU, hvc_exit_stat),
|
||||||
STATS_DESC_COUNTER(VCPU, wfe_exit_stat),
|
STATS_DESC_COUNTER(VCPU, wfe_exit_stat),
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#define CREATE_TRACE_POINTS
|
#define CREATE_TRACE_POINTS
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
||||||
KVM_GENERIC_VCPU_STATS(),
|
KVM_GENERIC_VCPU_STATS(),
|
||||||
STATS_DESC_COUNTER(VCPU, int_exits),
|
STATS_DESC_COUNTER(VCPU, int_exits),
|
||||||
STATS_DESC_COUNTER(VCPU, idle_exits),
|
STATS_DESC_COUNTER(VCPU, idle_exits),
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include <asm/kvm_eiointc.h>
|
#include <asm/kvm_eiointc.h>
|
||||||
#include <asm/kvm_pch_pic.h>
|
#include <asm/kvm_pch_pic.h>
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vm_stats_desc[] = {
|
||||||
KVM_GENERIC_VM_STATS(),
|
KVM_GENERIC_VM_STATS(),
|
||||||
STATS_DESC_ICOUNTER(VM, pages),
|
STATS_DESC_ICOUNTER(VM, pages),
|
||||||
STATS_DESC_ICOUNTER(VM, hugepages),
|
STATS_DESC_ICOUNTER(VM, hugepages),
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
#define VECTORSPACING 0x100 /* for EI/VI mode */
|
#define VECTORSPACING 0x100 /* for EI/VI mode */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vm_stats_desc[] = {
|
||||||
KVM_GENERIC_VM_STATS()
|
KVM_GENERIC_VM_STATS()
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ const struct kvm_stats_header kvm_vm_stats_header = {
|
|||||||
sizeof(kvm_vm_stats_desc),
|
sizeof(kvm_vm_stats_desc),
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
||||||
KVM_GENERIC_VCPU_STATS(),
|
KVM_GENERIC_VCPU_STATS(),
|
||||||
STATS_DESC_COUNTER(VCPU, wait_exits),
|
STATS_DESC_COUNTER(VCPU, wait_exits),
|
||||||
STATS_DESC_COUNTER(VCPU, cache_exits),
|
STATS_DESC_COUNTER(VCPU, cache_exits),
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
/* #define EXIT_DEBUG */
|
/* #define EXIT_DEBUG */
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vm_stats_desc[] = {
|
||||||
KVM_GENERIC_VM_STATS(),
|
KVM_GENERIC_VM_STATS(),
|
||||||
STATS_DESC_ICOUNTER(VM, num_2M_pages),
|
STATS_DESC_ICOUNTER(VM, num_2M_pages),
|
||||||
STATS_DESC_ICOUNTER(VM, num_1G_pages)
|
STATS_DESC_ICOUNTER(VM, num_1G_pages)
|
||||||
@@ -53,7 +53,7 @@ const struct kvm_stats_header kvm_vm_stats_header = {
|
|||||||
sizeof(kvm_vm_stats_desc),
|
sizeof(kvm_vm_stats_desc),
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
||||||
KVM_GENERIC_VCPU_STATS(),
|
KVM_GENERIC_VCPU_STATS(),
|
||||||
STATS_DESC_COUNTER(VCPU, sum_exits),
|
STATS_DESC_COUNTER(VCPU, sum_exits),
|
||||||
STATS_DESC_COUNTER(VCPU, mmio_exits),
|
STATS_DESC_COUNTER(VCPU, mmio_exits),
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
unsigned long kvmppc_booke_handlers;
|
unsigned long kvmppc_booke_handlers;
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vm_stats_desc[] = {
|
||||||
KVM_GENERIC_VM_STATS(),
|
KVM_GENERIC_VM_STATS(),
|
||||||
STATS_DESC_ICOUNTER(VM, num_2M_pages),
|
STATS_DESC_ICOUNTER(VM, num_2M_pages),
|
||||||
STATS_DESC_ICOUNTER(VM, num_1G_pages)
|
STATS_DESC_ICOUNTER(VM, num_1G_pages)
|
||||||
@@ -51,7 +51,7 @@ const struct kvm_stats_header kvm_vm_stats_header = {
|
|||||||
sizeof(kvm_vm_stats_desc),
|
sizeof(kvm_vm_stats_desc),
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
||||||
KVM_GENERIC_VCPU_STATS(),
|
KVM_GENERIC_VCPU_STATS(),
|
||||||
STATS_DESC_COUNTER(VCPU, sum_exits),
|
STATS_DESC_COUNTER(VCPU, sum_exits),
|
||||||
STATS_DESC_COUNTER(VCPU, mmio_exits),
|
STATS_DESC_COUNTER(VCPU, mmio_exits),
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#define CREATE_TRACE_POINTS
|
#define CREATE_TRACE_POINTS
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
||||||
KVM_GENERIC_VCPU_STATS(),
|
KVM_GENERIC_VCPU_STATS(),
|
||||||
STATS_DESC_COUNTER(VCPU, ecall_exit_stat),
|
STATS_DESC_COUNTER(VCPU, ecall_exit_stat),
|
||||||
STATS_DESC_COUNTER(VCPU, wfi_exit_stat),
|
STATS_DESC_COUNTER(VCPU, wfi_exit_stat),
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include <linux/kvm_host.h>
|
#include <linux/kvm_host.h>
|
||||||
#include <asm/kvm_mmu.h>
|
#include <asm/kvm_mmu.h>
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vm_stats_desc[] = {
|
||||||
KVM_GENERIC_VM_STATS()
|
KVM_GENERIC_VM_STATS()
|
||||||
};
|
};
|
||||||
static_assert(ARRAY_SIZE(kvm_vm_stats_desc) ==
|
static_assert(ARRAY_SIZE(kvm_vm_stats_desc) ==
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
#define VCPU_IRQS_MAX_BUF (sizeof(struct kvm_s390_irq) * \
|
#define VCPU_IRQS_MAX_BUF (sizeof(struct kvm_s390_irq) * \
|
||||||
(KVM_MAX_VCPUS + LOCAL_IRQS))
|
(KVM_MAX_VCPUS + LOCAL_IRQS))
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vm_stats_desc[] = {
|
||||||
KVM_GENERIC_VM_STATS(),
|
KVM_GENERIC_VM_STATS(),
|
||||||
STATS_DESC_COUNTER(VM, inject_io),
|
STATS_DESC_COUNTER(VM, inject_io),
|
||||||
STATS_DESC_COUNTER(VM, inject_float_mchk),
|
STATS_DESC_COUNTER(VM, inject_float_mchk),
|
||||||
@@ -91,7 +91,7 @@ const struct kvm_stats_header kvm_vm_stats_header = {
|
|||||||
sizeof(kvm_vm_stats_desc),
|
sizeof(kvm_vm_stats_desc),
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
||||||
KVM_GENERIC_VCPU_STATS(),
|
KVM_GENERIC_VCPU_STATS(),
|
||||||
STATS_DESC_COUNTER(VCPU, exit_userspace),
|
STATS_DESC_COUNTER(VCPU, exit_userspace),
|
||||||
STATS_DESC_COUNTER(VCPU, exit_null),
|
STATS_DESC_COUNTER(VCPU, exit_null),
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ EXPORT_SYMBOL_FOR_KVM_INTERNAL(enable_ipiv);
|
|||||||
bool __read_mostly enable_device_posted_irqs = true;
|
bool __read_mostly enable_device_posted_irqs = true;
|
||||||
EXPORT_SYMBOL_FOR_KVM_INTERNAL(enable_device_posted_irqs);
|
EXPORT_SYMBOL_FOR_KVM_INTERNAL(enable_device_posted_irqs);
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vm_stats_desc[] = {
|
||||||
KVM_GENERIC_VM_STATS(),
|
KVM_GENERIC_VM_STATS(),
|
||||||
STATS_DESC_COUNTER(VM, mmu_shadow_zapped),
|
STATS_DESC_COUNTER(VM, mmu_shadow_zapped),
|
||||||
STATS_DESC_COUNTER(VM, mmu_pte_write),
|
STATS_DESC_COUNTER(VM, mmu_pte_write),
|
||||||
@@ -269,7 +269,7 @@ const struct kvm_stats_header kvm_vm_stats_header = {
|
|||||||
sizeof(kvm_vm_stats_desc),
|
sizeof(kvm_vm_stats_desc),
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
const struct kvm_stats_desc kvm_vcpu_stats_desc[] = {
|
||||||
KVM_GENERIC_VCPU_STATS(),
|
KVM_GENERIC_VCPU_STATS(),
|
||||||
STATS_DESC_COUNTER(VCPU, pf_taken),
|
STATS_DESC_COUNTER(VCPU, pf_taken),
|
||||||
STATS_DESC_COUNTER(VCPU, pf_fixed),
|
STATS_DESC_COUNTER(VCPU, pf_fixed),
|
||||||
|
|||||||
@@ -1940,15 +1940,10 @@ enum kvm_stat_kind {
|
|||||||
|
|
||||||
struct kvm_stat_data {
|
struct kvm_stat_data {
|
||||||
struct kvm *kvm;
|
struct kvm *kvm;
|
||||||
const struct _kvm_stats_desc *desc;
|
const struct kvm_stats_desc *desc;
|
||||||
enum kvm_stat_kind kind;
|
enum kvm_stat_kind kind;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _kvm_stats_desc {
|
|
||||||
struct kvm_stats_desc desc;
|
|
||||||
char name[KVM_STATS_NAME_SIZE];
|
|
||||||
};
|
|
||||||
|
|
||||||
#define STATS_DESC_COMMON(type, unit, base, exp, sz, bsz) \
|
#define STATS_DESC_COMMON(type, unit, base, exp, sz, bsz) \
|
||||||
.flags = type | unit | base | \
|
.flags = type | unit | base | \
|
||||||
BUILD_BUG_ON_ZERO(type & ~KVM_STATS_TYPE_MASK) | \
|
BUILD_BUG_ON_ZERO(type & ~KVM_STATS_TYPE_MASK) | \
|
||||||
@@ -1959,37 +1954,29 @@ struct _kvm_stats_desc {
|
|||||||
.bucket_size = bsz
|
.bucket_size = bsz
|
||||||
|
|
||||||
#define VM_GENERIC_STATS_DESC(stat, type, unit, base, exp, sz, bsz) \
|
#define VM_GENERIC_STATS_DESC(stat, type, unit, base, exp, sz, bsz) \
|
||||||
{ \
|
{ \
|
||||||
{ \
|
|
||||||
STATS_DESC_COMMON(type, unit, base, exp, sz, bsz), \
|
STATS_DESC_COMMON(type, unit, base, exp, sz, bsz), \
|
||||||
.offset = offsetof(struct kvm_vm_stat, generic.stat) \
|
.offset = offsetof(struct kvm_vm_stat, generic.stat), \
|
||||||
}, \
|
|
||||||
.name = #stat, \
|
.name = #stat, \
|
||||||
}
|
}
|
||||||
#define VCPU_GENERIC_STATS_DESC(stat, type, unit, base, exp, sz, bsz) \
|
#define VCPU_GENERIC_STATS_DESC(stat, type, unit, base, exp, sz, bsz) \
|
||||||
{ \
|
{ \
|
||||||
{ \
|
|
||||||
STATS_DESC_COMMON(type, unit, base, exp, sz, bsz), \
|
STATS_DESC_COMMON(type, unit, base, exp, sz, bsz), \
|
||||||
.offset = offsetof(struct kvm_vcpu_stat, generic.stat) \
|
.offset = offsetof(struct kvm_vcpu_stat, generic.stat), \
|
||||||
}, \
|
|
||||||
.name = #stat, \
|
.name = #stat, \
|
||||||
}
|
}
|
||||||
#define VM_STATS_DESC(stat, type, unit, base, exp, sz, bsz) \
|
#define VM_STATS_DESC(stat, type, unit, base, exp, sz, bsz) \
|
||||||
{ \
|
{ \
|
||||||
{ \
|
|
||||||
STATS_DESC_COMMON(type, unit, base, exp, sz, bsz), \
|
STATS_DESC_COMMON(type, unit, base, exp, sz, bsz), \
|
||||||
.offset = offsetof(struct kvm_vm_stat, stat) \
|
.offset = offsetof(struct kvm_vm_stat, stat), \
|
||||||
}, \
|
|
||||||
.name = #stat, \
|
.name = #stat, \
|
||||||
}
|
}
|
||||||
#define VCPU_STATS_DESC(stat, type, unit, base, exp, sz, bsz) \
|
#define VCPU_STATS_DESC(stat, type, unit, base, exp, sz, bsz) \
|
||||||
{ \
|
{ \
|
||||||
{ \
|
|
||||||
STATS_DESC_COMMON(type, unit, base, exp, sz, bsz), \
|
STATS_DESC_COMMON(type, unit, base, exp, sz, bsz), \
|
||||||
.offset = offsetof(struct kvm_vcpu_stat, stat) \
|
.offset = offsetof(struct kvm_vcpu_stat, stat), \
|
||||||
}, \
|
|
||||||
.name = #stat, \
|
.name = #stat, \
|
||||||
}
|
}
|
||||||
/* SCOPE: VM, VM_GENERIC, VCPU, VCPU_GENERIC */
|
/* SCOPE: VM, VM_GENERIC, VCPU, VCPU_GENERIC */
|
||||||
#define STATS_DESC(SCOPE, stat, type, unit, base, exp, sz, bsz) \
|
#define STATS_DESC(SCOPE, stat, type, unit, base, exp, sz, bsz) \
|
||||||
SCOPE##_STATS_DESC(stat, type, unit, base, exp, sz, bsz)
|
SCOPE##_STATS_DESC(stat, type, unit, base, exp, sz, bsz)
|
||||||
@@ -2066,7 +2053,7 @@ struct _kvm_stats_desc {
|
|||||||
STATS_DESC_IBOOLEAN(VCPU_GENERIC, blocking)
|
STATS_DESC_IBOOLEAN(VCPU_GENERIC, blocking)
|
||||||
|
|
||||||
ssize_t kvm_stats_read(char *id, const struct kvm_stats_header *header,
|
ssize_t kvm_stats_read(char *id, const struct kvm_stats_header *header,
|
||||||
const struct _kvm_stats_desc *desc,
|
const struct kvm_stats_desc *desc,
|
||||||
void *stats, size_t size_stats,
|
void *stats, size_t size_stats,
|
||||||
char __user *user_buffer, size_t size, loff_t *offset);
|
char __user *user_buffer, size_t size, loff_t *offset);
|
||||||
|
|
||||||
@@ -2111,9 +2098,9 @@ static inline void kvm_stats_log_hist_update(u64 *data, size_t size, u64 value)
|
|||||||
|
|
||||||
|
|
||||||
extern const struct kvm_stats_header kvm_vm_stats_header;
|
extern const struct kvm_stats_header kvm_vm_stats_header;
|
||||||
extern const struct _kvm_stats_desc kvm_vm_stats_desc[];
|
extern const struct kvm_stats_desc kvm_vm_stats_desc[];
|
||||||
extern const struct kvm_stats_header kvm_vcpu_stats_header;
|
extern const struct kvm_stats_header kvm_vcpu_stats_header;
|
||||||
extern const struct _kvm_stats_desc kvm_vcpu_stats_desc[];
|
extern const struct kvm_stats_desc kvm_vcpu_stats_desc[];
|
||||||
|
|
||||||
static inline int mmu_invalidate_retry(struct kvm *kvm, unsigned long mmu_seq)
|
static inline int mmu_invalidate_retry(struct kvm *kvm, unsigned long mmu_seq)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,6 +14,10 @@
|
|||||||
#include <linux/ioctl.h>
|
#include <linux/ioctl.h>
|
||||||
#include <asm/kvm.h>
|
#include <asm/kvm.h>
|
||||||
|
|
||||||
|
#ifdef __KERNEL__
|
||||||
|
#include <linux/kvm_types.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define KVM_API_VERSION 12
|
#define KVM_API_VERSION 12
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1601,7 +1605,11 @@ struct kvm_stats_desc {
|
|||||||
__u16 size;
|
__u16 size;
|
||||||
__u32 offset;
|
__u32 offset;
|
||||||
__u32 bucket_size;
|
__u32 bucket_size;
|
||||||
|
#ifdef __KERNEL__
|
||||||
|
char name[KVM_STATS_NAME_SIZE];
|
||||||
|
#else
|
||||||
char name[];
|
char name[];
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#define KVM_GET_STATS_FD _IO(KVMIO, 0xce)
|
#define KVM_GET_STATS_FD _IO(KVMIO, 0xce)
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
* Return: the number of bytes that has been successfully read
|
* Return: the number of bytes that has been successfully read
|
||||||
*/
|
*/
|
||||||
ssize_t kvm_stats_read(char *id, const struct kvm_stats_header *header,
|
ssize_t kvm_stats_read(char *id, const struct kvm_stats_header *header,
|
||||||
const struct _kvm_stats_desc *desc,
|
const struct kvm_stats_desc *desc,
|
||||||
void *stats, size_t size_stats,
|
void *stats, size_t size_stats,
|
||||||
char __user *user_buffer, size_t size, loff_t *offset)
|
char __user *user_buffer, size_t size, loff_t *offset)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -973,9 +973,9 @@ static void kvm_free_memslots(struct kvm *kvm, struct kvm_memslots *slots)
|
|||||||
kvm_free_memslot(kvm, memslot);
|
kvm_free_memslot(kvm, memslot);
|
||||||
}
|
}
|
||||||
|
|
||||||
static umode_t kvm_stats_debugfs_mode(const struct _kvm_stats_desc *pdesc)
|
static umode_t kvm_stats_debugfs_mode(const struct kvm_stats_desc *desc)
|
||||||
{
|
{
|
||||||
switch (pdesc->desc.flags & KVM_STATS_TYPE_MASK) {
|
switch (desc->flags & KVM_STATS_TYPE_MASK) {
|
||||||
case KVM_STATS_TYPE_INSTANT:
|
case KVM_STATS_TYPE_INSTANT:
|
||||||
return 0444;
|
return 0444;
|
||||||
case KVM_STATS_TYPE_CUMULATIVE:
|
case KVM_STATS_TYPE_CUMULATIVE:
|
||||||
@@ -1010,7 +1010,7 @@ static int kvm_create_vm_debugfs(struct kvm *kvm, const char *fdname)
|
|||||||
struct dentry *dent;
|
struct dentry *dent;
|
||||||
char dir_name[ITOA_MAX_LEN * 2];
|
char dir_name[ITOA_MAX_LEN * 2];
|
||||||
struct kvm_stat_data *stat_data;
|
struct kvm_stat_data *stat_data;
|
||||||
const struct _kvm_stats_desc *pdesc;
|
const struct kvm_stats_desc *pdesc;
|
||||||
int i, ret = -ENOMEM;
|
int i, ret = -ENOMEM;
|
||||||
int kvm_debugfs_num_entries = kvm_vm_stats_header.num_desc +
|
int kvm_debugfs_num_entries = kvm_vm_stats_header.num_desc +
|
||||||
kvm_vcpu_stats_header.num_desc;
|
kvm_vcpu_stats_header.num_desc;
|
||||||
@@ -6171,11 +6171,11 @@ static int kvm_stat_data_get(void *data, u64 *val)
|
|||||||
switch (stat_data->kind) {
|
switch (stat_data->kind) {
|
||||||
case KVM_STAT_VM:
|
case KVM_STAT_VM:
|
||||||
r = kvm_get_stat_per_vm(stat_data->kvm,
|
r = kvm_get_stat_per_vm(stat_data->kvm,
|
||||||
stat_data->desc->desc.offset, val);
|
stat_data->desc->offset, val);
|
||||||
break;
|
break;
|
||||||
case KVM_STAT_VCPU:
|
case KVM_STAT_VCPU:
|
||||||
r = kvm_get_stat_per_vcpu(stat_data->kvm,
|
r = kvm_get_stat_per_vcpu(stat_data->kvm,
|
||||||
stat_data->desc->desc.offset, val);
|
stat_data->desc->offset, val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6193,11 +6193,11 @@ static int kvm_stat_data_clear(void *data, u64 val)
|
|||||||
switch (stat_data->kind) {
|
switch (stat_data->kind) {
|
||||||
case KVM_STAT_VM:
|
case KVM_STAT_VM:
|
||||||
r = kvm_clear_stat_per_vm(stat_data->kvm,
|
r = kvm_clear_stat_per_vm(stat_data->kvm,
|
||||||
stat_data->desc->desc.offset);
|
stat_data->desc->offset);
|
||||||
break;
|
break;
|
||||||
case KVM_STAT_VCPU:
|
case KVM_STAT_VCPU:
|
||||||
r = kvm_clear_stat_per_vcpu(stat_data->kvm,
|
r = kvm_clear_stat_per_vcpu(stat_data->kvm,
|
||||||
stat_data->desc->desc.offset);
|
stat_data->desc->offset);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6345,7 +6345,7 @@ static void kvm_uevent_notify_change(unsigned int type, struct kvm *kvm)
|
|||||||
static void kvm_init_debug(void)
|
static void kvm_init_debug(void)
|
||||||
{
|
{
|
||||||
const struct file_operations *fops;
|
const struct file_operations *fops;
|
||||||
const struct _kvm_stats_desc *pdesc;
|
const struct kvm_stats_desc *pdesc;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
kvm_debugfs_dir = debugfs_create_dir("kvm", NULL);
|
kvm_debugfs_dir = debugfs_create_dir("kvm", NULL);
|
||||||
@@ -6358,7 +6358,7 @@ static void kvm_init_debug(void)
|
|||||||
fops = &vm_stat_readonly_fops;
|
fops = &vm_stat_readonly_fops;
|
||||||
debugfs_create_file(pdesc->name, kvm_stats_debugfs_mode(pdesc),
|
debugfs_create_file(pdesc->name, kvm_stats_debugfs_mode(pdesc),
|
||||||
kvm_debugfs_dir,
|
kvm_debugfs_dir,
|
||||||
(void *)(long)pdesc->desc.offset, fops);
|
(void *)(long)pdesc->offset, fops);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < kvm_vcpu_stats_header.num_desc; ++i) {
|
for (i = 0; i < kvm_vcpu_stats_header.num_desc; ++i) {
|
||||||
@@ -6369,7 +6369,7 @@ static void kvm_init_debug(void)
|
|||||||
fops = &vcpu_stat_readonly_fops;
|
fops = &vcpu_stat_readonly_fops;
|
||||||
debugfs_create_file(pdesc->name, kvm_stats_debugfs_mode(pdesc),
|
debugfs_create_file(pdesc->name, kvm_stats_debugfs_mode(pdesc),
|
||||||
kvm_debugfs_dir,
|
kvm_debugfs_dir,
|
||||||
(void *)(long)pdesc->desc.offset, fops);
|
(void *)(long)pdesc->offset, fops);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user